A modern full-stack course-selling platform built with React, Node.js, Express, and MongoDB. CourseHive enables educators to create and manage courses while providing students with seamless course access, video/PDF lessons, and secure content delivery via AWS S3.
Experience the platform live with full functionality including course browsing, purchasing, and lesson management.
- Sign Up:
https://npm-app.duckdns.org/signup - Sign In:
https://npm-app.duckdns.org/signin - Dashboard:
https://npm-app.duckdns.org/(after login)
- Sign Up:
https://npm-app.duckdns.org/educatorsignup - Sign In:
https://npm-app.duckdns.org/educators - Dashboard: Access after login to create and manage courses
- Enhanced analytics dashboard for educators (course views, revenue tracking)
- Course progress tracking for students (% completed, certificates)
- Course ratings and reviews system
- Payment gateway integration (Razorpay)
- Email notifications for course updates and purchases
- π Secure Authentication - JWT-based user authentication
- π Course Browsing - Explore available courses with detailed information
- π³ Secure Payment - Razorpay integration with payment verification
- πΉ Rich Content Access - Watch video lessons and read PDF materials
- π― Personalized Dashboard - Track purchased courses and progress
- π¨βπ« Separate Educator Portal - Dedicated sign-in and dashboard
- β Course Creation - Create courses with metadata (name, price, level, duration, category)
- πΌοΈ Thumbnail Upload - Upload course images via ImgBB integration
- π Course Management - View and manage all created courses
- π¦ Lesson Management - Add, view, and delete video/PDF lessons
- π€ Direct S3 Upload - Upload lessons directly to AWS S3 with presigned URLs
- β»οΈ Real-time Updates - Lesson list updates instantly after add/delete operations
- ποΈ Smart Deletion - Automatic cleanup of S3 files when lessons are deleted
- β‘ Fast Development - Vite + React with HMR
- π¨ Modern UI - Material-UI (MUI) components with responsive design
- π Secure Content - Pre-signed S3 URLs with time-limited access (5 min expiry)
- π° Payment Integration - Razorpay with signature verification and webhook handling
- π RESTful API - Express backend with protected routes
- ποΈ MongoDB Atlas - Cloud database with Mongoose ODM
- π Cloud Storage - AWS S3 for scalable video/PDF hosting
- π³ Containerized - Docker & Docker Compose for consistent deployments
- π Security Best Practices - Non-root containers, multi-stage builds, minimal attack surface
- React 19 - Modern React with hooks
- Vite 7 - Lightning-fast build tool
- Material-UI (MUI) 7 - Component library for polished UI
- React Router Dom 7 - Client-side routing
- ESLint - Code linting and quality
- Node.js - JavaScript runtime
- Express 5 - Web framework
- MongoDB + Mongoose - Database and ODM
- JWT - Token-based authentication
- AWS SDK v3 - S3 client for content delivery
- Multer - File upload handling
- CORS - Cross-origin resource sharing
- Razorpay - Payment gateway integration
- AWS S3 - Video and PDF storage
- MongoDB Atlas - Managed MongoDB hosting
- ImgBB - Course thumbnail hosting
- Docker - Container platform for consistent deployments
- Docker Compose - Multi-container orchestration
- Nginx - Reverse proxy and static file serving (in containers)
Course-selling/
βββ backend/ # Express API server
β βββ controllers/ # Route handlers (auth, student, educator, payment)
β βββ models/ # MongoDB schemas
β βββ routes/ # API routes
β βββ Dockerfile # Backend container config
β βββ server.js # Entry point
βββ src/ # React frontend
β βββ components/ # React components (Appbar, CourseContent, Student, Educator)
β βββ App.jsx
β βββ main.jsx
βββ docker-compose.yml # Multi-container orchestration
βββ Dockerfile # Frontend container config
βββ nginx.conf # Reverse proxy config
- Node.js (v18 or higher)
- npm or yarn
- MongoDB Atlas account (or local MongoDB)
- AWS Account with S3 bucket configured
- ImgBB API Key (for thumbnails)
- Razorpay Account (for payment integration)
- Docker & Docker Compose (optional, for containerized deployment)
-
Clone the repository
git clone https://github.com/a-y-a-n-das/coursehive.git cd Course-selling -
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend npm install cd ..
Create backend/.env:
PORT=5000
SECRET=your_jwt_secret_key_here
TOKEN=your_internal_api_token_here
BACKEND_URL=http://localhost:5000
MONGODB_URL=mongodb+srv://username:[email protected]/Course-app
IMGBB_KEY=your_imgbb_api_key
AWS_REGION=ap-south-1
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
S3_BUCKET_NAME=your_bucket_name
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secretCreate .env in the root:
VITE_API_URL=http://localhost:5000
VITE_RAZORPAY_KEY_ID=your_razorpay_key_id-
Start the backend server (from
backend/folder):cd backend node server.js # or use nodemon for auto-restart: nodemon server.js
-
Start the frontend dev server (from root):
npm run dev
-
Access the app
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:5000
- Frontend:
-
Start all services with Docker Compose:
docker compose up -d
-
Access the app
- Frontend:
http://localhost - Backend API:
http://localhost:5000
- Frontend:
-
View logs:
# All services docker compose logs -f # Specific service docker compose logs -f backend docker compose logs -f frontend
-
Stop services:
docker compose down
Traditional:
# Build frontend
npm run build
# Preview production build
npm run previewDocker:
# Build images
docker compose build
# Run in production mode
docker compose up -d
# Or build and run together
docker compose up -d --buildAuthentication: JWT-based auth with 12-hour sessions. Protected routes require Authorization: Bearer <token> header.
Content Delivery: Videos/PDFs stored in AWS S3 with pre-signed URLs (5-min expiry). Direct upload from frontend to S3 using presigned URLs.
Payment Flow: Razorpay integration with server-side signature verification for secure transactions.
- β Multi-stage builds - Separate build and runtime stages
- β Layer caching - Optimized Dockerfile instruction order
- β
Minimal base images - Using
node:24-slimandnginx:alpine - β Security - Non-root user, no secrets in images
- β
.dockerignore- Exclude unnecessary files - β Health checks - Container health monitoring
- β Restart policies - Auto-restart on failure
- β Environment variables - Externalized configuration
| Service | Build Stage | Final Image | Savings |
|---|---|---|---|
| Backend | ~500MB | ~250MB | 50% |
| Frontend | ~800MB | ~50MB | 94% |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Ayan Das
- GitHub: @a-y-a-n-das
- Material-UI for the component library
- AWS for reliable cloud storage
- MongoDB Atlas for managed database hosting
- Vite team for the amazing build tool
Built with β€οΈ by Ayan Das
README documentation generated by GitHub Copilot powered by Claude Sonnet 4.5