CourseHub - Professional Course Selling Platform
A full-stack, feature-rich platform for selling coding courses with modules, exercises, projects, and comprehensive notes.
🚀 Features
Comprehensive Course Structure
- Organized modules
- Hands-on coding exercises with test cases
- Real-world projects for skill building
- Detailed notes at beginner and advanced levels
User Management
- User registration and authentication
- Student dashboards with progress tracking
- Instructor profiles and course management
- Role-based access control
Learning Features
- Code exercises with solution validation
- Project assignments
- Progress tracking and statistics
- Certificates upon completion
Professional UI
- Responsive design (mobile, tablet, desktop)
- Modern professional styling with Tailwind CSS
- Smooth animations and transitions
- Intuitive navigation
Payment Integration (Ready for implementation)
- Stripe integration support
- Course pricing with discounts
- Student enrollment tracking
📋 Tech Stack
Frontend
- Next.js 14 - React framework with SSR/SSG
- React 18 - UI library
- Tailwind CSS - Utility-first CSS framework
- Axios - HTTP client
- Zustand - State management (optional)
Backend
- Node.js - JavaScript runtime
- Express - Web framework
- MongoDB - NoSQL database
- Mongoose - MongoDB ORM
- JWT - Authentication
- Bcrypt - Password hashing
- Stripe - Payment processing (optional)
🛠️ Installation & Setup
Prerequisites
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- npm or yarn
Frontend Setup
Install dependencies:
npm installCreate
.env.localfile from.env.local.example:cp .env.local.example .env.localUpdate environment variables in
.env.local:MONGODB_URI=mongodb://localhost:27017/course-platform MONGODB_DB=course-platform JWT_SECRET=your_secure_secret_key BACKEND_URL=http://localhost:3001 NEXT_PUBLIC_API_URL=http://localhost:3001Run development server:
npm run dev
Frontend will be available at http://localhost:3000
Backend Setup
Install backend dependencies from the project root:
npm installStart the backend server from the root with the built-in npm script:
npm run backend:dev
Backend API will be available at http://localhost:3001
If you prefer a single command for both frontend and backend, use:
npm run dev:full
MongoDB Setup
Option 1: Local MongoDB
# Make sure MongoDB is running locally
mongod
Option 2: MongoDB Atlas (Cloud)
- Create account at mongodb.com/cloud/atlas
- Update
MONGODB_URIin.env.local
📁 Project Structure
course-platform/
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── page.js # Homepage
│ │ ├── courses/ # Courses pages
│ │ └── layout.js # Root layout
│ ├── components/ # Reusable React components
│ │ ├── Header.js
│ │ ├── Hero.js
│ │ ├── CourseGrid.js
│ │ ├── Features.js
│ │ ├── CTA.js
│ │ └── Footer.js
│ ├── lib/ # Utility functions
│ └── styles/ # Global styles
├── backend/
│ ├── models/ # MongoDB schemas
│ │ ├── User.js
│ │ ├── Course.js
│ │ ├── Module.js
│ │ ├── Lesson.js
│ │ ├── Exercise.js
│ │ └── Project.js
│ ├── routes/ # API routes
│ │ ├── auth.js
│ │ ├── courses.js
│ │ ├── users.js
│ │ ├── enrollments.js
│ │ └── progress.js
│ ├── middleware/ # Express middleware
│ ├── server.js # Express server entry point
│ └── package.json
├── public/ # Static assets
├── package.json # Frontend dependencies
├── next.config.js # Next.js configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
🔌 API Endpoints
Authentication
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
Courses
GET /api/courses- Get all coursesGET /api/courses/:id- Get single coursePOST /api/courses- Create course (instructor only)PUT /api/courses/:id- Update courseDELETE /api/courses/:id- Delete course
Users
GET /api/users/:id- Get user profilePUT /api/users/:id- Update profile
Enrollments
POST /api/enrollments/:courseId/enroll- Enroll in courseGET /api/enrollments/user/:userId- Get user enrollments
Progress
GET /api/progress/:userId/:courseId- Get course progressPOST /api/progress/:userId/:courseId- Update progress
🚀 Running Full Stack
To run both frontend and backend concurrently:
npm run dev:full
This requires concurrently package (already included in dependencies).
📝 Adding Your Courses
- Start the backend server
- Use MongoDB client or your favorite API tool (Postman, Insomnia)
- Create courses using
POST /api/courses:
{
"title": "JavaScript Basics",
"description": "Learn JavaScript from scratch",
"category": "JavaScript",
"price": 29.99,
"level": "beginner",
"instructor": "your_instructor_id"
}
- Add modules, lessons, exercises, and projects similarly
🎨 Customization
Colors & Styling
- Edit
tailwind.config.jsto customize colors and themes - Modify
src/styles/globals.cssfor global styles
Components
- All React components are in
src/components/ - Pages are in
src/app/ - Customize freely for your branding
Content
- Update company name "CourseHub" to your brand name
- Replace placeholder content with your actual courses
- Add your logo and branding assets
🔐 Security Features
- JWT-based authentication
- Password hashing with bcrypt
- CORS configuration
- Environment variable protection
- Secure API routes
📦 Deployment
Frontend (Vercel)
# Build optimized production version
npm run build
# Deploy to Vercel
vercel deploy
Backend (Heroku/Railway/Render)
- Push backend to hosting platform
- Set environment variables
- MongoDB should be accessible
🤝 Contributing
- Fork the repository
- Create a 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 a Pull Request
📄 License
This project is open source and available under the MIT License.
🎯 Roadmap
- [ ] Payment gateway integration (Stripe)
- [ ] Discussion forums
- [ ] Peer code review system
- [ ] Gamification (badges, leaderboards)
- [ ] Advanced analytics
- [ ] Mobile app (React Native)
- [ ] Live coding sessions
- [ ] AI-powered code suggestions
- [ ] Multi-language support
Built with ❤️ for developers who want to learn and teach
Built With
- c++
- cmake
- css
- javascript
Log in or sign up for Devpost to join the conversation.