A production-oriented MERN online learning platform with secure authentication, course publishing, enrollment workflows, AI-style course recommendations, and a polished responsive dashboard.
- JWT authentication with persisted sessions and protected routes
- Course catalog with validated course creation flow
- Enrollment system connected to the user dashboard
- Recommendation engine with interest-based scoring, relevance sorting, and fallback suggestions
- Responsive Tailwind UI with reusable components, skeleton states, toast notifications, and empty states
- Production backend middleware for security, validation, rate limiting, logging, and centralized errors
- Ready-to-deploy environment setup for Render and Vercel
- Frontend: React, React Router, Axios, Tailwind CSS
- Backend: Node.js, Express, MongoDB, Mongoose
- Auth: JWT, bcryptjs
- Validation and security: express-validator, helmet, cors, express-rate-limit
- Logging and observability: morgan, winston
- Testing: Node test runner, supertest
.
|-- client
| |-- src
| | |-- components
| | |-- context
| | |-- pages
| | |-- services
| | `-- utils
| |-- .env.example
| |-- postcss.config.js
| `-- tailwind.config.js
|-- server
| |-- src
| | |-- __tests__
| | |-- config
| | |-- controllers
| | |-- middleware
| | |-- models
| | |-- repositories
| | |-- routes
| | |-- services
| | |-- utils
| | `-- validators
| |-- .env.example
| `-- server.js
`-- README.md
cd server
npm install
cd ../client
npm installBackend file: server/.env
PORT=5000
NODE_ENV=development
MONGO_URI=mongodb://127.0.0.1:27017/online-learning-platform
JWT_SECRET=replace-with-a-long-random-secret
JWT_EXPIRES_IN=1d
CLIENT_URL=http://localhost:3000
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=150
LOG_LEVEL=infoFrontend file: client/.env
REACT_APP_API_URL=http://localhost:5000/apiBackend:
cd server
npm run devFrontend:
cd client
npm startPOST /api/auth/registerPOST /api/auth/loginGET /api/auth/meGET /api/coursesPOST /api/coursesPOST /api/courses/:courseId/enrollGET /api/recommendations/:userIdGET /api/user/dashboardGET /api/health
Navbar: global navigation, profile badge, logoutCourseCard: reusable catalog/recommendation card with hover statesButton: shared CTA variants and loading stateLoader: lightweight global loading stateSkeletonCard: course list placeholder while fetchingEmptyState: reusable blank-state containerPrivateRoute: route guard for authenticated pages
- Frontend deploy target: Vercel
- Backend deploy target: Render
- Set
CLIENT_URLon the backend to the Vercel domain - Set
REACT_APP_API_URLon the frontend to the Render backend URL plus/api - Use MongoDB Atlas for production database hosting
- Clean backend layering with controllers, services, repositories, validators, and shared middleware
- Centralized error handling and request validation
- Helmet, rate limiting, safer CORS, structured logging, and health checks
- Improved MongoDB indexing for users and courses
- Auth persistence with context and protected dashboard routing
- Recommendation scoring by category, tags, and title relevance with fallback ordering
- Responsive FAANG-style UI with reusable components and better loading/error UX
- Role-based authorization for instructor-only course publishing
- Real payment gateway integration with Stripe or Razorpay
- Course detail pages and lesson-level progress persistence
- Refresh-token flow and email verification
- E2E tests with Playwright or Cypress
- Analytics, search, and admin moderation tools
Amiya Krishna Chaurasiya
B.Tech CSE Student
Aspiring Data Scientist and AI/ML Engineer
GitHub: https://github.com/Amiya-Krishna
LinkedIn: https://www.linkedin.com/in/amiya-krishna
If you like this project:
⭐ Star the repository 🍴 Fork it 🤝 Contribute







