This project is a robust backend system designed for managing academic activities, including user management (admins, students, and faculty), course offerings, semester registrations, and department management. It is built with TypeScript, Node.js, and MongoDB. This document provides an in-depth explanation of the system architecture, features, and setup process.
- Links
- Features
- ER Diagram
- Project Structure
- Installation and Setup
- Modules Overview
- API Endpoints
- Technologies Used
- Future Enhancements
- Frontend Repository: GitHub Link
- Backend Repository: GitHub Link
- Server Live Application: Visit Here
This system is designed to streamline academic course management with the following capabilities:
- User Role Management: Admins, faculty, and students with unique roles and privileges.
- Course Management: Create and manage courses, including prerequisites and faculty assignments.
- Semester Management: Manage academic semesters and allow student registrations.
- Department and Faculty Management: Define academic departments and assign faculty.
- Validation and Error Handling: Comprehensive middleware to handle validation and errors.
- Secure Authentication: Role-based access control using JWT.
- Scalable Architecture: Modular structure for future growth.
The database schema is visually represented in the following ER diagram:
Key entities include:
- User Model: Manages user credentials and authentication.
- Admin/Student/Faculty Models: Extend the user model for specific functionalities.
- Course and OfferedCourse Models: Represent course data and the courses offered in a semester.
- AcademicDepartment and Faculty Models: Organize departments and faculty members.
- SemesterRegistration and AcademicSemester Models: Facilitate student registrations and semester management.
src/
│
├── app/
│ ├── builder/ # Initialization logic for specific features or services
│ ├── config/ # Configuration files for environment, database, etc.
│ ├── DB/ # MongoDB connection and ORM models (Mongoose)
│ ├── errors/ # Custom error classes and global error handling
│ ├── interface/ # TypeScript interfaces and types for the application
│ ├── middlewares/ # Middleware for authentication, validation, etc.
│ ├── modules/ # Core features such as user, course, and semester management
│ ├── routes/ # API route definitions and linking to modules
│ └── utils/ # Helper functions (e.g., data formatting, token generation)
│
├── app.ts # Entry point for initializing the application
└── server.ts # Server startup script (port and environment setup)
builder/: Handles the initialization of services or complex components.config/: Includes configurations such as database connection strings and environment variables.DB/: Contains database schemas and connection logic (uses Mongoose).errors/: Custom error classes likeValidationErrorand centralized error handling.middlewares/: Implements middlewares like authentication, input validation, etc.modules/: Core application logic for managing users, courses, and registrations.routes/: Maps API routes to the respective controllers.
```bash
git clone https://github.com/mohamim360/academic-management-serverreadne
cd <repository-name>
```
Use `npm` or `yarn` to install the required dependencies:
```bash
npm install
```
Create a `.env` file in the root directory with the following environment variables:
```
PORT=3000
DB_URI=<your_mongodb_connection_string>
JWT_SECRET=<your_jwt_secret_key>
```
Start the application in development mode:
```bash
npm run dev
```
Or, run in production mode:
```bash
npm start
```
- **Models**: `User`, `Admin`, `Student`, `Faculty`
- **Features**:
- Registration and login functionality.
- Role-based access control.
- Password hashing and authentication using JWT.
- **Models**: `Course`, `OfferedCourse`, `PreRequisiteCourses`
- **Features**:
- CRUD operations for courses.
- Define and validate prerequisites.
- Assign faculty to specific courses.
- **Models**: `AcademicSemester`, `SemesterRegistration`
- **Features**:
- Create and manage academic semesters.
- Allow students to register for courses.
- Enforce maximum capacity for courses.
- **Models**: `AcademicFaculty`, `AcademicDepartment`
- **Features**:
- Create and manage departments.
- Assign faculty to departments.
- POST /users/register: Register a new user.
- POST /users/login: Authenticate and retrieve a JWT token.
- GET /users/profile: Fetch user details.
- GET /courses: List all available courses.
- POST /courses: Create a new course.
- PUT /courses/:id: Update course information.
- DELETE /courses/:id: Delete a course.
- GET /semesters: Retrieve academic semesters.
- POST /semesters: Create a new semester.
- POST /registrations: Register a student for a course.
Full API documentation: https://documenter.getpostman.com/view/28160711/2sA2r6ZQnQ
- Framework: Node.js, Express.js
- Language: TypeScript
- Database: MongoDB (Mongoose ORM)
- Authentication: JSON Web Tokens (JWT)
- Validation: Joi/Express-Validator
- Error Handling: Centralized error middleware
- Implement real-time notifications for students and faculty.
- Add a frontend integration guide.
- Role-based dashboards for admin, faculty, and students.
- Add unit and integration tests using Jest.
- Improve scalability with microservices architecture.
