An AI-powered learning platform that helps students study more effectively through intelligent document processing, flashcard generation, quizzes, and interactive AI chat.
- π Document Upload & Processing: Upload PDF and Markdown files for automatic text extraction and chunking

- π€ AI-Powered Study Tools:
- Generate flashcards automatically from your documents
- Create custom quizzes with multiple-choice questions
- Get AI-generated summaries of complex materials
- Interactive chat with document context (RAG)
- Smart Flashcards: Review, star favorites, and track progress with spaced repetition

- Quiz System: Take quizzes, get instant feedback, and track scores
- Progress Dashboard: Monitor your study statistics, streaks, and achievements
- Secure Authentication: JWT-based user authentication and authorization
- React 19 with TypeScript
- Vite for fast development and optimized builds
- Tailwind CSS v4 for modern, responsive styling
- React Router v7 for client-side routing
- Axios for API communication
- React Hot Toast for notifications
- Node.js with Express 5
- TypeScript for type safety
- MongoDB Atlas for cloud database
- Mongoose for object modeling
- JWT for authentication
- Multer for file uploads
- Helmet for security headers
- Google Gemini AI for content generation
- RAG (Retrieval-Augmented Generation) for context-aware responses
- Text Chunking for efficient document processing
- PDF Parser for text extraction
- Docker & Docker Compose for containerization
- Nginx for reverse proxy and static file serving
- Let's Encrypt for SSL certificates (production)
- GitHub Actions ready for CI/CD
- Node.js 20.x or higher
- Docker & Docker Compose
- MongoDB Atlas account (or local MongoDB)
- Google Gemini API key
git clone https://github.com/vvduth/dukem-learning.git
cd dukem-learningCreate a .env file in the project root:
# MongoDB Connection
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/database
# JWT Secret (generate a strong random string)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
# Google Gemini API Key
GOOGLE_API_KEY=your-google-gemini-api-key# Build and start all services
docker-compose up -d
# Check status
docker-compose ps
# View logs
docker-compose logs -fAccess the application:
- Frontend:
http://localhost - Backend API:
http://localhost:5000
Backend:
cd backend
npm install
npm run devFrontend:
cd frontend
npm install
npm run devAccess the application:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:5000
# Build images
docker build -t vvduth/dukem-learning-backend:latest ./backend
docker build -t vvduth/dukem-learning-frontend:latest ./frontend
# Push to Docker Hub
docker push vvduth/dukem-learning-backend:latest
docker push vvduth/dukem-learning-frontend:latestSee DEPLOYMENT.md for detailed deployment instructions including:
- AWS EC2 setup
- Domain configuration
- SSL certificate setup
- Performance optimization for t3.micro instances
dukem-learning/
βββ backend/ # Node.js Express backend
β βββ src/
β β βββ controllers/ # Request handlers
β β βββ models/ # Mongoose schemas
β β βββ routes/ # API routes
β β βββ middleware/ # Auth & error handling
β β βββ utils/ # AI services & helpers
β β βββ index.ts # Entry point
β βββ uploads/ # File storage
β βββ Dockerfile
β
βββ frontend/ # React frontend
β βββ src/
β β βββ components/ # Reusable components
β β βββ pages/ # Page components
β β βββ services/ # API service layer
β β βββ context/ # React context (Auth)
β β βββ utils/ # Axios instance, helpers
β β βββ types/ # TypeScript definitions
β βββ nginx.conf # Nginx configuration
β βββ Dockerfile
β
βββ docker-compose.yml # Docker orchestration
βββ .env.example # Environment template
βββ README.md
The platform uses RAG to provide context-aware AI responses:
- Document Upload: PDFs/Markdown files are uploaded and text is extracted
- Text Chunking: Documents are split into manageable chunks
- Semantic Search: Relevant chunks are retrieved based on user queries
- AI Generation: Google Gemini uses retrieved context to generate accurate responses
Upload β Parse (PDF/MD) β Extract Text β Chunk β Store β AI Process
Register β JWT Token β Store in localStorage β Auto-attach to requests
Edit backend/src/index.ts for:
- CORS origins
- Port settings
- Middleware configuration
- Static file serving
Edit frontend/src/utils/apiPaths.ts for:
- API base URL
- Endpoint paths
Edit frontend/nginx.conf for:
- Reverse proxy settings
- SSL certificates (production)
- Caching rules
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/profile- Get user profilePUT /api/auth/profile- Update profilePOST /api/auth/change-password- Change password
POST /api/documents/upload- Upload documentGET /api/documents- Get all documentsGET /api/documents/:id- Get document by IDDELETE /api/documents/:id- Delete document
POST /api/ai/generate-flashcards- Generate flashcardsPOST /api/ai/generate-quiz- Generate quizPOST /api/ai/generate-summary- Generate summaryPOST /api/ai/chat- Chat with document contextPOST /api/ai/explain-concept- Explain concept
GET /api/flashcards/:documentId- Get flashcards by documentPOST /api/flashcards/:cardId/review- Mark card as reviewedPOST /api/flashcards/:cardId/star- Toggle starDELETE /api/flashcards/:setId- Delete flashcard set
GET /api/quizzes/:documentId- Get quizzes by documentGET /api/quizzes/quiz/:id- Get quiz by IDPOST /api/quizzes/:id/submit- Submit quiz answersGET /api/quizzes/:id/results- Get quiz results
GET /api/progress/dashboard- Get dashboard statistics
# View container stats
docker stats
# Check logs
docker-compose logs -f
# Monitor system resources
htop
free -h
df -h- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Duc Thai
- Google Gemini AI for powerful language model capabilities
- MongoDB Atlas for reliable cloud database hosting
- React team for the excellent frontend framework
- Docker for simplifying deployment
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check DEPLOYMENT.md for deployment help
- Review
.github/copilot-instructions.mdfor AI coding guidelines
See CHANGELOG.md for version history and updates.
Live Demo: https://dukem-learning.xyz
Deployed on: AWS EC2 (t3.micro) with Docker containers

