AI Learning Assistant is a full-stack study platform built with Angular and Node.js. Users can upload PDF documents, generate quizzes and exams, create flashcards, build study roadmaps and plans, track activity, and review analytics from one application.
- Frontend: Angular 21, Angular Material, Tailwind CSS, Transloco
- Backend: Node.js, Express, MongoDB, Mongoose, JWT auth
- AI integration: Gemini with local fallback behavior in parts of the backend
- Deployment: Railway
- User registration and login
- PDF upload and document viewer
- AI chat and document-based learning tools
- Flashcard generation and flashcard batches
- Quiz generation from uploaded documents
- Exam generation with mixed question types
- Study roadmap and weekly study plan generation
- Study sessions and progress tracking
- Activity feed and analytics dashboard
- Profile management
backend/ Express API, MongoDB models, controllers, routes
frontend/ Angular application
package.json
railway.json
- Node.js 18+
- npm
- MongoDB connection string
Create a backend/.env file for local development.
PORT=3030
MONGODB_URI=mongodb://localhost:27017/ai-learning-assistant
JWT_SECRET=replace_with_a_secure_secret
JWT_EXPIRES_IN=7d
GEMINI_API_KEY=
GEMINI_MODELS=gemini-2.5-flash,gemini-2.5-flash-liteNotes:
- The frontend development environment currently calls
http://localhost:3030/api, so usingPORT=3030locally keeps frontend and backend aligned. - In production, the frontend uses
/apiand the Express app serves the built Angular app. GEMINI_API_KEYis optional. If it is missing, some generators fall back to local content generation.
Install dependencies for both apps:
npm install --prefix backend
npm install --prefix frontendYou can also install from the repository root with:
npm installThe root postinstall script installs both backend and frontend dependencies.
Start the backend:
cd backend
npm run devStart the frontend in a second terminal:
cd frontend
npm startLocal URLs:
- Frontend:
http://localhost:4200 - Backend API:
http://localhost:3030/api - Health check:
http://localhost:3030/api/health
Build the Angular frontend:
cd frontend
npm run buildOr from the repository root:
npm run buildStart the production server from the root:
npm startThis starts the Express backend and serves the Angular build from frontend/dist/frontend/browser when the build output exists.
Main backend route groups:
/api/auth/api/ai/api/documents/api/flashcards/api/flashcard-batches/api/quiz-gen/api/document-quizzes/api/exam-gen/api/exams/api/study-roadmap/api/study-plan/api/study-sessions/api/activities/api/analytics
This repository is prepared for single-service Railway deployment.
Railway uses:
- Build command:
npm run build - Start command:
npm start - Health check:
/api/health
Deployment steps:
- Push the repository to GitHub.
- Create a new Railway project from the repo.
- Add environment variables:
MONGODB_URI,JWT_SECRET, optionalGEMINI_API_KEY, optionalGEMINI_MODELS. - Deploy.
The root package.json installs backend and frontend dependencies, builds the Angular app, and starts the Express server.
- The backend serves uploaded files from
/uploads. - The backend disables
etagand sendsCache-Control: no-cache, no-store, must-revalidateheaders. - Rate limiting is present in the server but currently commented out.
No license file is currently included in this repository.