Full-stack LMS with context-aware AI tutoring and persistent RAG-lite capabilities.
- Backend: Java 17 / Spring Boot (REST API)
- Frontend: React (SPA)
- Database: PostgreSQL (Relational persistence)
- Security: Spring Security + BCrypt (Stateful/Session-based)
- AI Integration: Section-contextual prompt engineering via external LLM API
- Authentication: Custom
UserDetailsServiceimplementation with BCrypt password encoding. - Authorization: Role-based access control (RBAC) protecting course management and AI endpoints.
- Global Exception Handling:
@ControllerAdvicemapping domain exceptions to standard HTTP status codes.
- The "Section-Aware" Engine: The backend fetches the current
Sectioncontent (Markdown) and injects it into the LLM system prompt, ensuring responses are grounded in the specific lecture data. - Persistence: Chat sessions are mapped to
(User, Section)pairs in PostgreSQL, allowing for historical retrieval and multi-session management.
- Hierarchical Content:
Course 1 -> N Sections. - Chat Schema:
ChatSessionholds metadata;ChatMessageholds the content and role (User/Assistant) with timestamps for chronological rendering. - Migrations: Transitioned from H2 (volatile) to PostgreSQL (persistent) for production readiness.
| Endpoint | Method | Description |
|---|---|---|
/api/auth/** |
POST | Login/Registration (Public) |
/api/courses |
GET | List all available modules |
/api/sections/{id} |
GET | Retrieve Markdown content for a section |
/api/ai/chat |
POST | Send message + Contextual metadata |
/api/ai/history/{sectionId} |
GET | Fetch persistent chat history |
- Pipeline: GitHub Actions automates
mvn clean verifyand frontend builds on every push. - Environment: Production-ready configuration using Spring Profiles (
application-prod.yml). - Logging: SLF4J/Logback integration with severity filtering.
# Backend
./mvnw spring-boot:run -Dspring.profiles.active=dev
# Frontend
npm install && npm start
- Vector Search: Moving from simple context injection to RAG using a Vector DB.
- Analytics: Tracking student engagement via AI query patterns.