A full-stack application that generates personalized learning roadmaps visualized as interactive dependency graphs.
- Generate structured learning plans with milestones and subtopics
- Interactive graph visualization of learning paths
- Real-time form validation and error handling
- Premium dark-theme UI with handcrafted components
- Rate limiting and CORS-protected API endpoints
- Optional PostgreSQL persistence for saved plans
- Responsive design across desktop and tablet
Frontend: React 18, Vite, ReactFlow, TailwindCSS, Axios, Lucide React
Backend: FastAPI, Uvicorn, Pydantic, PostgreSQL (optional), Python 3.10+
Styling: Custom design system with dark theme, premium typography, and accessible components
studypath-ai/
├── backend/
│ ├── main.py # FastAPI app, endpoints, database logic
│ ├── requirements.txt # Python dependencies
│ ├── migrations/ # PostgreSQL schema (optional)
│ ├── .env.example # Environment template
│ └── venv/ # Virtual environment
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── ui/ # Reusable UI components
│ │ │ ├── Modal.jsx
│ │ │ ├── CustomNode.jsx
│ │ │ └── ErrorBoundary.jsx
│ │ ├── examples/ # Example implementations
│ │ ├── App.jsx # Main application
│ │ ├── main.jsx
│ │ └── index.css # Global styles
│ ├── public/
│ ├── tailwind.config.js # Design tokens and theme
│ ├── vite.config.js
│ ├── package.json
│ └── .env.example
├── docker-compose.yml # Local PostgreSQL setup
├── DESIGN_SYSTEM.md # Component API and design tokens
├── QUICK_REFERENCE.md # Quick lookup guide
└── README.md
- Python 3.10 or higher
- Node.js 18 or higher
- npm or yarn
- Navigate to backend directory:
cd backend- Create and activate virtual environment:
python -m venv venvOn Windows:
venv\Scripts\activate.batOn macOS/Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Create
.envfile (optional):
cp .env.example .env- Start development server:
python main.pyServer runs on http://localhost:8000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create
.env.local(optional):
cp .env.example .env.local- Start development server:
npm run devFrontend runs on http://localhost:5173
| Variable | Required | Default | Description |
|---|---|---|---|
GEMINI_API_KEY |
No | — | API key for plan generation service |
DATABASE_URL |
No | — | PostgreSQL connection string |
ENVIRONMENT |
No | development | Deployment environment |
ALLOWED_ORIGINS |
No | http://localhost:5173 | CORS-allowed origins (comma-separated) |
SENTRY_DSN |
No | — | Sentry error tracking DSN |
| Variable | Required | Default | Description |
|---|---|---|---|
VITE_API_URL |
No | http://localhost:8000 | Backend API endpoint |
VITE_APP_URL |
No | http://localhost:5173 | Frontend URL for sharing |
Open two terminal windows:
Terminal 1 (Backend):
cd backend
python main.pyTerminal 2 (Frontend):
cd frontend
npm run devBoth must run simultaneously. The frontend will fail to load plan data if the backend is not running.
Frontend automatically reloads on file changes (Vite hot module replacement). Backend reloads on Python file changes when run with python main.py (uvicorn auto-reload).
Frontend:
cd frontend
npm run build
npm run preview # Test production build locallyOutput is in frontend/dist/
Backend:
No build step required. Deploy main.py and requirements.txt to production environment.
Generates a personalized learning plan.
Request:
{
"field_of_study": "Machine Learning",
"proficiency_level": "Beginner"
}Response:
{
"plan_title": "Study Plan for Machine Learning",
"milestones": [
{
"title": "Foundations",
"description": "Core concepts and fundamentals",
"subtopics": [
{
"title": "Linear Algebra",
"description": "Matrices, vectors, and operations",
"youtube_search_query": "linear algebra fundamentals"
}
]
}
]
}Status Codes:
200: Plan generated successfully422: Invalid request format429: Rate limit exceeded (10 requests per minute)500: Server error
Generates and saves a plan to the database.
Request: Same as /generate-plan
Response:
{
"id": "uuid",
"slug": "machine-learning-abc123",
"created_at": "2024-01-15T10:30:00Z"
}Requires DATABASE_URL to be set.
Retrieves a previously saved plan.
Response: Same as /generate-plan
Status Codes:
200: Plan found404: Plan not found
- Push code to GitHub
- Connect repository to Vercel
- Set environment variable:
VITE_API_URLpointing to backend - Deploy (automatic on push to main)
Using Render:
- Create new Web Service on Render
- Connect GitHub repository
- Set Start Command:
uvicorn main:app --host 0.0.0.0 --port 8000 - Add environment variables (GEMINI_API_KEY, DATABASE_URL, etc.)
- Deploy
Using Docker:
docker build -t studypath-backend .
docker run -p 8000:8000 -e GEMINI_API_KEY=your_key studypath-backend- Create PostgreSQL database on Render
- Copy connection string to
DATABASE_URL - Backend automatically initializes tables on startup
These features are fully implemented but not required to run the application:
- Plan Persistence: PostgreSQL integration for saving and sharing plans. Set
DATABASE_URLto enable. - Service Integration: External plan generation service. Set
GEMINI_API_KEYto enable (otherwise uses mock data). - Error Tracking: Sentry integration. Set
SENTRY_DSNto enable. - Storybook: Interactive component documentation. Run
npm run storybookin frontend.
The frontend uses a premium dark theme called "Obsidian Luxe" with handcrafted components. The design system includes six reusable components: Button, Card, Input, Modal, Toast, and Topbar. All components follow accessibility standards (WCAG AA), use consistent spacing and typography, and feature smooth animations.
Color palette: deep obsidian (#0F0F12) for backgrounds, soft gold (#D4A64A) for accents, and high-contrast text (#E9E9EC). Typography uses Playfair Display serif for headings and Inter sans-serif for body text.
Detailed design documentation is in DESIGN_SYSTEM.md with component API, design tokens, and implementation examples.
Python (Backend):
- Follow PEP 8 style guide
- Use type hints for function parameters and returns
- Docstrings for all public functions and classes
- Prefer explicit over implicit (no magic)
JavaScript (Frontend):
- ES6+ syntax, prefer const over let
- Functional components with React hooks
- Prop types or TypeScript for component interfaces
- Components in PascalCase, files in camelCase or PascalCase
- Keep components focused; extract logic to custom hooks
Naming:
- Database tables: plural, lowercase (plans, users)
- API endpoints: lowercase with hyphens (generate-plan, not generatePlan)
- React components: PascalCase
- CSS classes: kebab-case from TailwindCSS utility classes
Formatting:
- 2 spaces for indentation (frontend), 4 spaces (backend)
- 80-character line limit for Python, 100 for JavaScript
- Trailing commas in multi-line structures
- No unused imports or variables
feature/descriptionfor new featuresbugfix/descriptionfor bug fixesdocs/descriptionfor documentationchore/descriptionfor maintenance tasks
- Create feature branch from
main - Make focused commits with clear messages
- Open PR with description of changes
- Ensure all tests pass and no console errors
- Await review before merging
- Squash commits before merge if requested
Use imperative mood, present tense:
Add user authentication endpoint(not "Added" or "Adds")Fix graph node positioning(not "Fixed")Update component documentation(not "Updated")
MIT License. See LICENSE file for details.
For issues or questions:
- Check
QUICK_REFERENCE.mdfor common tasks - Review
DESIGN_SYSTEM.mdfor component documentation - Open a GitHub issue with clear reproduction steps
- For bugs, include error messages and browser console output
Latest Update: December 2025
Version: 1.0.0
Status: Production Ready