A comprehensive lesson progress tracking system featuring Next.js frontend with App Router and scalable Node.js backend with layered architecture.
- App Router: Modern Next.js routing with server/client components
- Progress Tracker: Interactive lesson management with real-time updates
- Analytics Dashboard: Comprehensive learning analytics and insights
- Responsive Design: Mobile-first approach with modern UI/UX
- Layered Architecture: Controllers → Services → Repositories
- Caching: Redis and in-memory caching for performance
- Validation: Express-validator for robust input validation
- Authentication: JWT-based secure authentication
- Error Handling: Comprehensive error management
/
├── frontend/ # Next.js App Router frontend
│ ├── app/ # App Router pages
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page (Progress Tracker)
│ │ └── analytics/ # Analytics dashboard
│ ├── components/ # Reusable components
│ ├── services/ # API service layer
│ └── types/ # TypeScript interfaces
├── backend/ # Node.js Express backend
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── services/ # Business logic
│ │ ├── repositories/ # Data access layer
│ │ ├── models/ # MongoDB schemas
│ │ ├── middleware/ # Express middleware
│ │ ├── routes/ # API routes
│ │ └── scripts/ # Database seeding
├── SYSTEM_DESIGN.md # Comprehensive system design document
└── README.md # This file
- Progress Tracking: Visual progress indicators and completion status
- Analytics Dashboard: Personal and platform-wide analytics
- Real-time Updates: Optimistic updates with error handling
- Responsive Design: Works seamlessly on all devices
- Loading States: Smooth user experience with loading indicators
- RESTful API: Well-designed endpoints following REST principles
- Layered Architecture: Separation of concerns with controllers, services, repositories
- Caching: Multi-level caching with Redis and in-memory cache
- Input Validation: Comprehensive validation using express-validator
- Authentication: Secure JWT-based authentication
- Analytics: Advanced aggregation pipelines for insights
- Error Handling: Robust error management with proper status codes
POST /api/auth/register- Register new userPOST /api/auth/login- User loginPOST /api/auth/verify- Verify JWT token
GET /api/users/:id/progress- Get user's lesson progressPOST /api/users/:id/lessons/:lessonId/complete- Mark lesson completeGET /api/users/:id/analytics- Get detailed user analytics
GET /api/lessons- Get all lessons (with filtering/pagination)GET /api/lessons/:id- Get specific lessonGET /api/lessons/:id/stats- Get lesson completion statisticsPOST /api/lessons- Create new lessonGET /api/lessons/tracks- Get all available tracksGET /api/lessons/track/:track- Get lessons by trackGET /api/lessons/analytics/overview- Get overall platform analytics
- Node.js 18+
- MongoDB 4.4+
- npm or yarn
cd backend
npm install
# Copy and configure environment variables
cp env.example .env
# Edit .env with your configurations
# Seed database with sample data
npm run seed
# Start development server
npm run devcd frontend
npm install
# Start development server
npm run devThe frontend will be available at http://localhost:3000 and the backend API at http://localhost:3001.
The analytics dashboard provides insights into:
- Personal Progress: Individual user statistics and breakdowns
- Platform Overview: System-wide analytics and performance metrics
- Track Performance: Progress by learning tracks
- Difficulty Analysis: Performance across difficulty levels
- Completion Rates: Lesson-by-lesson completion statistics
- App Router: Modern routing with better performance and developer experience
- Server Components: Optimal performance with selective client-side hydration
- TypeScript: Type safety throughout the application
- Tailwind CSS: Utility-first styling for rapid development
- Controllers: Handle HTTP requests and responses
- Services: Contain business logic and orchestrate operations
- Repositories: Provide data access abstraction
- Middleware: Handle cross-cutting concerns (auth, validation, caching)
- Application Cache: In-memory caching for frequently accessed data
- Redis Cache: Distributed caching for scalability (ready for Redis integration)
- Database Optimization: Proper indexing and aggregation pipelines
- Input Validation: Express-validator for comprehensive request validation
- Authentication: JWT tokens with proper expiration
- Rate Limiting: Protection against abuse
- CORS: Configured for secure cross-origin requests
- Helmet: Security headers for protection
PORT=3001
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/lesson_progress_tracker
JWT_SECRET=your-super-secret-jwt-key
JWT_EXPIRES_IN=7d
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
ALLOWED_ORIGINS=http://localhost:3000NEXT_PUBLIC_API_URL=http://localhost:3001/api- Caching: Multi-level caching strategy
- Database Indexing: Optimized queries with proper indexes
- Compression: Gzip compression for API responses
- Pagination: Efficient data loading with pagination
- Aggregation Pipelines: Optimized analytics queries
- Microservices Architecture: Service decomposition
- Event Streaming: Real-time analytics with Kinesis/Kafka
- Database Sharding: Horizontal scaling strategies
- Container Orchestration: Kubernetes deployment
- CDN Integration: Global content delivery
Run the seed script to populate the database with realistic sample data:
cd backend
npm run seedThis creates:
- 3 Users: With different progress levels
- 8 Lessons: Across multiple tracks and difficulties
- Progress Data: Realistic completion times and scores
For detailed system architecture, scalability considerations, and future enhancements, see SYSTEM_DESIGN.md.
- Containerized frontend and backend
- Docker Compose for local development
- Production-ready configurations
- Frontend: Vercel/Netlify deployment
- Backend: AWS ECS/EKS or Google Cloud Run
- Database: MongoDB Atlas or self-hosted
- Caching: Redis Cloud or ElastiCache
- Monitoring: Application and infrastructure monitoring
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License.