Learning Management System
A RESTful backend API for a Learning Management System supporting students, instructors, and administrators. Built with Spring Boot and PostgreSQL.
Java 21 / Spring Boot 4.1.0
Spring Security with JWT authentication
Spring Data JPA / Hibernate
PostgreSQL
Lombok
Docker & Docker Compose
Authentication & Authorization -- JWT-based, stateless auth with role-based access (ADMIN, INSTRUCTOR, STUDENT)
Course Management -- Create, list, and manage courses
User Management -- Admin CRUD operations for users
Enrollment -- Enroll/unenroll students in courses
Lessons -- Course lesson management
Quizzes & Questions -- Quiz creation with MCQ, boolean, and short-answer questions; student quiz submissions and grading
Assignments -- Create assignments, submit files, and grade submissions
Attendance -- OTP-based attendance tracking for lessons
Notifications -- In-app notifications (enrollment, grading, due dates, etc.)
Performance Reports -- Grades and attendance reports per course
src/main/java/com/lms/
├── auth/ # Authentication (login, register)
├── user/ # User management
├── course/ # Course CRUD
├── enrollment/ # Student-course enrollment
├── lesson/ # Lesson management
├── quiz/ # Quizzes, questions, and submissions
├── assignment/ # Assignments and submissions
├── attendance/ # OTP-based attendance
├── notification/ # Notifications
├── performance/ # Grade & attendance reports
├── question/ # Question bank
├── security/ # JWT utility, filters, UserDetailsService
├── config/ # Security configuration
├── exception/ # Custom exceptions
└── util/enums/ # UserRole, Sex, QuestionType, etc.
Each domain module follows a layered architecture: Controller -> Service Interface -> Service Implementation -> Repository , with dedicated DTOs and mappers.
Java 21 (JDK)
Maven (or use the included ./mvnw wrapper)
PostgreSQL (or use Docker)
Docker & Docker Compose (optional, for containerized deployment)
Running with Docker Compose (Recommended)
docker compose up --build
This starts:
PostgreSQL 16 on port 5432
Spring Boot app on port 8000
Ensure PostgreSQL is running on localhost:5432 with a database named lms, then:
The API will be available at http://localhost:8000.
./mvnw clean package -DskipTests
java -jar target/learning-management-system-0.0.1-SNAPSHOT.jar
Property
Default
Description
server.port
8000
Application port
spring.datasource.url
jdbc:postgresql://localhost:5432/lms
Database URL
spring.datasource.username
postgres
Database username
spring.datasource.password
postgres
Database password
jwt.secret
(hardcoded)
Base64-encoded JWT secret
jwt.expiration
86400000 (24h)
JWT token expiration in ms
Environment variables DB_HOST, DB_PORT, DB_NAME, DB_USERNAME, and DB_PASSWORD override datasource defaults.
Method
Endpoint
Access
POST
/api/auth/register
Public
POST
/api/auth/login
Public
Method
Endpoint
Access
GET
/api/user
ADMIN
GET
/api/user/{userId}
ADMIN
POST
/api/user
ADMIN
DELETE
/api/user/{userId}
ADMIN
Method
Endpoint
Access
GET
/api/course
Authenticated
GET
/api/course/{courseId}
Authenticated
POST
/api/course
ADMIN, INSTRUCTOR
DELETE
/api/course/{courseId}
ADMIN
Method
Endpoint
Access
GET
/api/enrollments/student/{studentId}
Authenticated
GET
/api/enrollments/course/{courseId}
Authenticated
POST
/api/enrollments/student/{studentId}/course/{courseId}
ADMIN, STUDENT
DELETE
/api/enrollments/student/{studentId}/course/{courseId}
ADMIN, STUDENT
Method
Endpoint
Access
GET
/api/courses/{courseId}/lesson
Authenticated
GET
/api/courses/{courseId}/lesson/{lessonId}
Authenticated
POST
/api/courses/{courseId}/lesson
ADMIN, INSTRUCTOR
Method
Endpoint
Access
GET
/api/courses/{courseId}/quizes
Authenticated
GET
/api/courses/{courseId}/quizes/{quizId}
Authenticated
POST
/api/courses/{courseId}/quizes
ADMIN, INSTRUCTOR
DELETE
/api/courses/{courseId}/quizes/{quizId}
ADMIN, INSTRUCTOR
POST
/api/courses/{courseId}/quizes/{quizId}/generate
STUDENT
POST
/api/courses/{courseId}/quizes/{quizId}/submit
STUDENT
GET
/api/courses/{courseId}/quizes/{quizId}/result
Authenticated
Method
Endpoint
Access
GET
/api/course/{courseId}/question
Authenticated
GET
/api/course/{courseId}/question/{questionId}
Authenticated
POST
/api/course/{courseId}/question
ADMIN, INSTRUCTOR
DELETE
/api/course/{courseId}/question/{questionId}
ADMIN, INSTRUCTOR
Method
Endpoint
Access
GET
/api/courses/{courseId}/assignments
Authenticated
GET
/api/courses/{courseId}/assignments/{assignmentId}
Authenticated
POST
/api/courses/{courseId}/assignments
ADMIN, INSTRUCTOR
POST
.../assignments/{assignmentId}/submit
STUDENT
GET
.../assignments/{assignmentId}/getSubmission
Authenticated
POST
.../assignments/{assignmentId}/submissions/{submissionId}/grade
ADMIN, INSTRUCTOR
Method
Endpoint
Access
POST
/api/courses/{courseId}/lessons/{lessonId}/otp
ADMIN, INSTRUCTOR
GET
/api/courses/{courseId}/lessons/{lessonId}/otp
Authenticated
POST
/api/courses/{courseId}/lessons/{lessonId}/attendances
STUDENT
GET
/api/courses/{courseId}/lessons/{lessonId}/attendances
Authenticated
Method
Endpoint
Access
GET
/api/notifications?unread=false
Authenticated
PATCH
/api/notifications
Authenticated
Method
Endpoint
Access
GET
/api/performance/courses/{courseId}/grades
ADMIN, INSTRUCTOR
GET
/api/performance/courses/{courseId}/attendance
ADMIN, INSTRUCTOR
This project is licensed under the MIT License .