An intelligent learning platform that generates personalised syllabi and in‑depth topic explanations using Google Gemini AI – built with Spring Boot, React, and PostgreSQL.
LearnPath allows learners to input any topic, their current understanding, desired depth, and goal. The backend, powered by Spring AI and Google Gemini, creates a structured syllabus with modules and topics. When a user clicks a topic, the AI generates a detailed, markdown‑formatted explanation, which is then cached for instant retrieval.
This project was developed as a full‑stack learning exercise – mastering Spring Boot, JPA, REST API design, React hooks, and AI integration – while producing a genuinely useful tool.
- 🤖 AI‑Driven Syllabus Generation – Google Gemini builds a multi‑module curriculum tailored to the user’s profile.
- 📚 On‑Demand Content – Click any topic to get an in‑depth, formatted explanation.
- ⚡ Smart Caching – Generated content is stored in PostgreSQL; subsequent requests are served instantly.
- 📱 Intuitive UI – React frontend with accordion modules, radio buttons, and Markdown rendering.
- 🔒 Input Validation – Radio buttons & dropdowns eliminate invalid data; backend enforces constraints.
- 📦 Clean Architecture – Service layer, DTOs, global exception handling, and repository pattern.
- 🔐 Externalised Configuration – API keys and DB credentials via environment variables.
| Layer | Technology |
|---|---|
| Backend | Java 21, Spring Boot 3.4.1 |
| AI | Spring AI, Google Gemini (Flash) |
| Database | PostgreSQL 18, Spring Data JPA |
| Frontend | React 18, Vite, React‑Markdown |
| Build | Maven Wrapper (mvnd) |
| Tooling | Lombok, Postman, Git |
┌───────────────────┐ REST API ┌────────────────────────┐
│ React (Vite) │ ◄────────────────► │ Spring Boot 3.4.1 │
│ │ /api/syllabus │ │
│ • SyllabusForm │ /api/topics/{id} │ • SyllabusService │
│ • SyllabusDisplay│ │ • ContentService │
│ • TopicContent │ │ • Spring AI ChatClient│
└───────────────────┘ └───────────┬────────────┘
│
▼
┌─────────────────────┐
│ Google Gemini AI │
└─────────────────────┘
│
▼
┌─────────────────────┐
│ PostgreSQL 18 │
│ (Syllabus, │
│ Module, Topic) │
└─────────────────────┘
- Java 21 or higher
- Maven (or use the included Maven wrapper
mvnd) - PostgreSQL 18 (or any recent version)
- Node.js 18+ and npm
- Google Gemini API Key (get one free)
git clone https://github.com/yourusername/learnpath.git
cd learnpath-
Create a PostgreSQL database named
LearnPath(or adjust the URL inapplication.yml). -
Set the required environment variables:
# Windows PowerShell $env:GOOGLE_API_KEY = "AIza..." $env:DB_PASSWORD = "your_postgres_password"
On Linux/macOS:
export GOOGLE_API_KEY=... -
(Optional) Adjust
src/main/resources/application.yml– the default configuration uses${GOOGLE_API_KEY}and${DB_PASSWORD}. -
Run the backend:
cd backend # if you have a separate folder, or just run from root ./mvnw spring-boot:run
The API will be available at
http://localhost:8080.
-
Navigate to the frontend directory:
cd frontend # or the directory containing package.json
-
Install dependencies and start the dev server:
npm install npm run dev
The React app will open at
http://localhost:5173(and proxy API requests to port 8080).
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/syllabus |
Generate a syllabus from user input |
GET |
/api/topics/{topicId}/content |
Get or generate content for a specific topic |
{
"topic": "Machine Learning",
"currentUnderstanding": "BEGINNER",
"depthLevel": "LEVEL2",
"goal": "To build a simple predictive model"
}{
"syllabusId": 1,
"modules": [
{
"id": 10,
"title": "Foundations of Machine Learning",
"estimatedHours": 4.5,
"topics": [
{ "id": 25, "name": "What is ML?" },
{ "id": 26, "name": "Supervised vs Unsupervised Learning" }
]
}
]
}{
"topicId": 25,
"topicName": "What is ML?",
"content": "## What is Machine Learning?\nMachine learning is a subset of artificial intelligence..."
}src/main/java/com/learnpath/version1/
├── controller/ # REST controllers
├── dto/ # Data Transfer Objects (records)
├── entity/ # JPA entities (Syllabus, SyllabusModule, Topic)
├── exception/ # Custom exceptions & global handler
├── repository/ # Spring Data JPA repositories
└── service/ # Business logic & AI integration
- User authentication & history of past syllabi
- Quiz generation for each module
- Streaming AI responses (real‑time content display)
- Dark mode & improved UI/UX
- Export syllabus as PDF
- Docker compose for one‑click setup
- Full‑stack integration – React <-> Spring Boot REST API
- AI/LLM integration – Practical use of Google Gemini with Spring AI, including prompt engineering, JSON parsing, and caching
- Database design – JPA entity relationships (OneToMany, ManyToOne), cascading, and schema generation
- Production‑like practices – environment variables, DTOs vs entities, global exception handling
- Clean code – builder pattern, Java records, Lombok, and feature‑based packaging
This project is licensed under the MIT License – see the LICENSE file for details.
Prashant Ranjan
GitHub • LinkedIn
Built with ❤️ as a learning journey into full‑stack AI development. Contributions, issues, and stars are welcome!