This project is a Learning Management System (LMS) built using Java with Spring Boot following a Layered Architecture. The system supports role-based access control for Admins, Instructors, and Students, and provides functionalities for User Management, Course Management, Assessments & Grading, Performance Tracking, and Notifications.
The LMS follows a Layered Architecture pattern, which separates concerns into distinct layers:
- Controller Layer: Handles HTTP requests and responses using RESTful APIs.
- Service Layer: Contains business logic and application rules.
- Repository Layer: Manages data access using Spring Data JPA and PostgreSQL.
- Entity Layer: Defines database entity models.
- DTO Layer: Contains Data Transfer Objects for request/response models.
- Mapper Layer: Transforms data between entities and DTOs.
- Security Layer: Implements authentication and authorization using Spring Security.
- User Roles:
- Admin: Manages system settings, users, and courses.
- Instructor: Creates and manages courses, assessments, and grading.
- Student: Enrolls in courses, submits assignments, and takes quizzes.
- Functionalities:
- User registration and login (JWT-based authentication).
- Profile management (view/update profile information).
- Course Creation:
- Instructors can create courses with a title, description, duration, and media files.
- Courses consist of multiple lessons.
- Enrollment Management:
- Students can view and enroll in available courses.
- Admins and Instructors can track enrolled students.
- Attendance Management:
- Instructors generate OTPs for lesson attendance.
- Students enter OTPs to mark attendance.
- Assessment Types: Quizzes and Assignments.
- Quiz Creation:
- Instructors create quizzes with MCQs, true/false, and short-answer questions.
- Randomized question selection per quiz attempt.
- Assignment Submission:
- Students upload assignments for review.
- Grading & Feedback:
- Instructors grade assignments and provide feedback.
- Students receive automated feedback for quizzes.
- Instructors track quiz scores, assignment submissions, and attendance.
- Admins and Instructors generate performance analytics and reports.
- System Notifications:
- Students receive notifications for enrollments, grades, and course updates.
- Instructors receive notifications for student enrollments.
- Email Notifications:
- Students receive email alerts for course-related updates.
- Java with Spring Boot (for RESTful API services)
- PostgreSQL (database management)
- Spring Security (authentication & authorization)
- JUnit for unit testing
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/login | Authenticate user and return JWT token. |
| POST | /api/auth/register | Register a new user. |
| GET | /api/auth/confirm | Confirm user registration via token. |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/users | Get all users (Admin only). |
| PUT | /api/admin/assign-role/{id} | Assign role to user (Admin only). |
| PUT | /api/admin/deactivate/{id} | Deactivate a user (Admin only). |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/instructor/course/create | Create a new course (Instructor only). |
| GET | /api/instructor/courses | Get courses by instructor (Instructor only). |
| DELETE | /api/instructor/course/{id} | Delete a course (Instructor/Admin). |
| POST | /api/instructor/upload/course/{id} | Upload media files for a course. |
| GET | /api/student/courses | View available courses (Student). |
| GET | /api/student/get/course/{id} | Get course details by ID. |
| POST | /api/student/enroll/course/{id} | Enroll in a course (Student). |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/instructor/lessons/course/{id} | Add a lesson to a course. |
| POST | /api/instructor/generate-otp/course/{id}/lessons/{id} | Generate OTP for lesson attendance. |
| POST | /api/student/course/{id}/lessons/{id}/validate-otp | Validate OTP for lesson attendance. |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/instructor/assignment/create | Create a new assignment (Instructor only). |
| GET | /api/student/assignment/{id} | Get assignment by ID (Student). |
| GET | /api/student/assignments | Get all assignments (Student). |
| PUT | /api/instructor/assignment/{id} | Update an assignment (Instructor only). |
| DELETE | /api/instructor/assignment/{id} | Delete an assignment (Instructor only). |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/instructor/enrollments/course/{id} | Get enrolled students for a course. |
| DELETE | /api/instructor/course/{id}/enrollments/{id} | Remove student from a course. |
| POST | /api/instructor/enrollments/{id}/confirm | Confirm student enrollment. |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/instructor/performance/course/{id}/student/{id} | Get student performance in a course. |
| GET | /api/instructor/attendance/course/lessons/{id} | Get attendance records for a lesson. |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/instructor/add-questions/course/{id} | Add questions to a course. |
| GET | /api/student/questions/course/{id} | Get quiz questions for a course. |
src/
|-- main/
| |-- java/com/lms/
| | |-- controllers/ # REST controllers
| | |-- services/ # Business logic
| | |-- repositories/ # Database repositories
| | |-- models/ # Data models
| | |-- config/ # Security and app configuration
| |-- resources/
| |-- application.yml # Application configuration
|-- test/
|-- java/com/lms/ # Test cases
- Java: Ensure JDK 17 or above is installed.
- PostgreSQL: Install PostgreSQL and create a database for the project.
- Postman: For testing API endpoints.
-
Clone the repository:
git clone https://github.com/Yousef-karem/Learning-Management-System.git cd Learning-Management-System/lms-backend -
Configure the database:
- Update
src/main/resources/application.ymlwith your PostgreSQL credentials.
spring: datasource: url: jdbc:postgresql://localhost:5432/lms_db username: your_username password: your_password jpa: hibernate: ddl-auto: update jwt: secret: your_jwt_secret
- Update
-
Build and run the project:
./mvnw spring-boot:run
-
Access the API:
- API base URL:
http://localhost:8080
- API base URL:
- Open Postman.
- Create requests based on the endpoints listed above.
- Test the endpoints using appropriate roles and JWT tokens.
For further inquiries or collaboration, please contact:
- Yousef Karem
GitHub Profile - Juliana George
GitHub Profile - Ephraim Youssef
GitHub Profile - Ramez Ragaay
GitHub Profile - Arsany Nageh
GitHub Profile
This backend system is a crucial component of the Learning Management System and ensures secure and efficient management of users, roles, and courses.