A comprehensive full-stack Learning Management System built with Spring Boot and React, featuring course management, student enrollment, real-time updates, rate limiting, and containerized deployment.
- User authentication and registration
- Browse and search available courses
- View detailed course information
- Enroll in courses (with seat availability checking)
- View enrolled courses and progress
- Drop courses
- Prevent duplicate enrollments
- Student dashboard with personalized course information
- Create, update, and delete courses
- Activate/deactivate courses
- Manage course capacity and details
- View comprehensive enrollment statistics
- Promote users to admin role
- View system dashboard with key metrics
- Manage student accounts and profiles
- Framework: Spring Boot 4.0.1
- Java Version: 21 (LTS)
- Security: Spring Security with JWT Token Authentication
- Database: PostgreSQL with Spring Data JPA / Hibernate
- Rate Limiting: Bucket4j with Redis support
- Validation: Jakarta Bean Validation
- Cache: Redis (for rate limiting and caching)
- Build Tool: Maven 3.6+
- Monitoring: Spring Boot Actuator
- Containerization: Docker with health checks
- Framework: React 19.2.3 with Vite 7.3.1
- Routing: React Router 7.12.0
- Styling: Tailwind CSS 3.4.17 with PostCSS
- Icons: Lucide React 0.562
- HTTP Client: Axios
- Code Quality: ESLint with React hooks support
- Node Version: 18+
- Container Orchestration: Docker Compose 3.8
- Services: Frontend (Nginx), Backend (Spring Boot), Redis
- Networking: Custom bridge network
- Health Checks: Configured for all services
- Volume Management: Persistent storage for Redis and file uploads
Learning-Management-System/
βββ lms/ # Backend (Spring Boot)
β βββ src/main/java/lms/lms/
β β βββ config/ # Security, Web, and Rate Limit Configuration
β β βββ controller/ # REST API Controllers
β β β βββ AuthController
β β β βββ StudentController
β β β βββ AdminController
β β βββ dto/ # Data Transfer Objects
β β βββ entity/ # JPA Entities (User, Course, Enrollment, etc.)
β β βββ exception/ # Custom Exceptions and Global Exception Handler
β β βββ repository/ # JPA Repositories
β β βββ security/ # JWT Token Service and Security Filters
β β βββ service/ # Business Logic Layer
β βββ src/main/resources/
β β βββ application.properties
β β βββ application-dev.properties
β β βββ example.application.properties
β βββ pom.xml # Maven Dependencies
β βββ Dockerfile # Backend Container Configuration
β βββ mvnw/mvnw.cmd # Maven Wrapper
β
βββ frontend/lms/ # Frontend (React + Vite)
β βββ src/
β β βββ components/ # React Components
β β β βββ ProtectedRoute.jsx
β β β βββ SidebarH.jsx
β β β βββ TopNavbar.jsx
β β βββ pages/ # Page Components
β β β βββ LandingPage.jsx
β β β βββ LoginPage.jsx
β β β βββ RegisterPage.jsx
β β β βββ CourseCatalog.jsx
β β β βββ StudentDashboard.jsx
β β βββ context/ # React Context (Authentication State)
β β β βββ AuthContext.jsx
β β βββ layouts/ # Layout Components
β β β βββ DashboardLayout.jsx
β β βββ api/ # API Configuration
β β β βββ axios.js # Axios instance
β β β βββ CourseApi.js # Course API calls
β β βββ App.jsx
β β βββ main.jsx
β β βββ index.css
β β βββ App.css
β βββ public/ # Static assets
β βββ package.json # NPM Dependencies
β βββ vite.config.js # Vite Configuration
β βββ tailwind.config.js # Tailwind CSS Configuration
β βββ postcss.config.js # PostCSS Configuration
β βββ eslint.config.js # ESLint Configuration
β βββ nginx.conf # Nginx Configuration for production
β βββ Dockerfile # Frontend Container Configuration
β βββ README.md # Frontend Documentation
β
βββ Docker-Compose.yml # Multi-container orchestration
βββ Readme.md # This file
- Java: 21 or higher (OpenJDK or Oracle JDK)
- Maven: 3.6+ (or use bundled mvnw)
- Node.js: 18+ with npm
- PostgreSQL: 12+ (local or managed service)
- Redis: 6+ (local or managed service)
- Docker: (Optional, for containerized deployment)
- Docker Compose: 2.0+ (if using Docker)
- Create a PostgreSQL database:
CREATE DATABASE lms_db;- Configure connection in lms/src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/lms_db
spring.datasource.username=postgres
spring.datasource.password=your_password
spring.datasource.driver-class-name=org.postgresql.Driver
spring.jpa.hibernate.ddl-auto=updateThe Docker Compose setup includes PostgreSQL configuration via environment variables.
Backend Setup:
cd lms
# Build the project
mvn clean install
# Run the application
mvn spring-boot:runThe backend will start on http://localhost:8080
Frontend Setup:
cd frontend/lms
# Install dependencies
npm install
# Start development server
npm run devThe frontend will start on http://localhost:5173 (Vite default)
- Clone the repository:
git clone <repository-url>
cd Learning-Management-System- Configure environment variables:
cp .env.example .env
# Edit .env with your configuration- Start all services:
docker-compose up -dAccess the application:
- Frontend:
http://localhost:3000 - Backend API:
http://localhost:8080 - Redis:
localhost:6379
Backend:
cd lms
mvn clean package -DskipTests
java -jar target/lms-0.0.1-SNAPSHOT.jarFrontend:
cd frontend/lms
npm run build
npm run previewPOST /api/auth/register
Content-Type: application/json
{
"username": "john_doe",
"email": "john@example.com",
"password": "SecurePassword123!"
}Response:
{
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"role": "STUDENT"
}POST /api/auth/login
Content-Type: application/json
{
"username": "john_doe",
"password": "SecurePassword123!"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 86400000,
"user": {
"id": 1,
"username": "john_doe",
"email": "john@example.com",
"role": "STUDENT"
}
}GET /api/auth/validate
Authorization: Bearer {token}GET /api/auth/me
Authorization: Bearer {token}All student endpoints require Authorization: Bearer {token} header with STUDENT role.
GET /api/student/coursesGET /api/student/courses/{id}POST /api/student/enroll/{courseId}Request Body:
{
"courseId": 1
}POST /api/student/drop/{courseId}GET /api/student/enrollmentsGET /api/student/enrollments/activeAll admin endpoints require Authorization: Bearer {token} header with ADMIN role.
GET /api/admin/coursesPOST /api/admin/courses
Content-Type: application/json
{
"title": "Advanced Java",
"description": "Learn advanced Java concepts",
"instructor": "Dr. Smith",
"capacity": 30,
"credits": 3
}PUT /api/admin/courses/{id}
Content-Type: application/json
{
"title": "Advanced Java",
"description": "Updated description",
"capacity": 40,
"isActive": true
}DELETE /api/admin/courses/{id}GET /api/admin/studentsGET /api/admin/enrollmentsGET /api/admin/dashboard/statsResponse:
{
"totalStudents": 150,
"totalCourses": 25,
"activeEnrollments": 450,
"totalEnrollments": 500
}- Tokens expire after 24 hours (configurable)
- Tokens include user ID, username, and role
- All protected endpoints require valid JWT token in Authorization header
- Format:
Authorization: Bearer {token}
- Implemented using Bucket4j with Redis backend
- Prevents API abuse with per-user request limits
- Configurable rate limits per endpoint
- Passwords are hashed using Spring Security's BCrypt
- Passwords require minimum strength validation
- Never transmitted in responses
Frontend Service
- Container:
lms-frontend - Port:
3000:80 - Base Image: Node.js 20 LTS
- Build: Uses multi-stage build for optimization
- Web Server: Nginx reverse proxy
Backend Service
- Container:
lms-app - Port:
8080:8080 - Base Image: Eclipse Temurin JDK 21
- Health Check: Actuator endpoint monitoring
- Environment: Configured via
.envfile - Volumes: Persistent upload storage
Redis Service
- Container:
lms-redis - Port:
6379:6379 - Image:
redis:7-alpine - Persistence: AOF (Append Only File)
- Health Check: Redis CLI ping
Create a .env file in the project root:
# Database
SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/lms_db
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=your_secure_password
# JWT
JWT_SECRET=your_jwt_secret_key_here
JWT_EXPIRATION=86400000
# Redis
SPRING_DATA_REDIS_PASSWORD=your_redis_password
# File Upload
MAX_FILE_SIZE=10MB
MAX_REQUEST_SIZE=10MB
# JVM
JAVA_OPTS=-Xmx512m -Xms256m
# Spring Profile
SPRING_PROFILES_ACTIVE=devcd lms
mvn testcd frontend/lms
npm run lint- Backend Lines of Code: Java Spring Boot application with comprehensive REST API
- Frontend Components: ~5 main page components with protected routing
- Database Tables: User, Course, Enrollment entities with proper relationships
- API Endpoints: 20+ RESTful endpoints for student, admin, and authentication operations
- Deployment: Full containerized deployment with health checks and monitoring
- Connection pooling for database
- Redis caching for rate limiting
- JPA query optimization
- Actuator for performance monitoring
- Configurable JVM heap size
- Vite for fast development and optimized builds
- React 19 with latest performance features
- Tailwind CSS for minimal CSS output
- Router-based code splitting
- ESLint for code quality
- Create a feature branch
- Make your changes
- Run tests locally
- Submit a pull request
- Use
application-dev.propertiesfor local development - Enable detailed logging with
logging.level.root=DEBUG - Swagger/Springdoc can be added for API documentation
- Use
npm run devfor hot module replacement (HMR) - Check console for ESLint warnings
- Tailwind CSS IntelliSense extension recommended for VS Code
# View logs
docker-compose logs -f app
docker-compose logs -f frontend
docker-compose logs -f redis
# Restart services
docker-compose restart
# Reset everything
docker-compose down -v
docker-compose up -d- Ensure PostgreSQL is running and accessible
- Check credentials in
.envorapplication.properties - Verify database exists:
CREATE DATABASE lms_db;
- Verify Redis is running on port 6379
- Check Redis health:
redis-cli ping - Ensure Spring Redis configuration is correct
cd frontend/lms
rm -rf node_modules package-lock.json
npm install
npm run buildThis project is provided as-is for educational and development purposes.
For issues, questions, or improvements, please refer to the project documentation or create an issue in the repository.
Last Updated: March 5, 2026
Project Version: 0.0.1-SNAPSHOT
Java Version: 21 LTS
Spring Boot: 4.0.1
React: 19.2.3