A modern, full-stack course selling platform enabling educators to create and sell courses while students discover, purchase, and learn from expert-led content. Built with professional architecture, responsive UI, and multi-role authentication.
Coursis is a complete learning platform where:
- Teachers create courses, set prices, and manage enrollments
- Students browse, enroll, and track their learning
- Admins oversee platform operations and users
Course data includes title, description, pricing, instructor info, and timestampsβeverything needed to run a professional course marketplace.
| Layer | Technology | Version |
|---|---|---|
| Frontend | React, TypeScript, Tailwind CSS, Vite | 19.2, 5.9, 4.2, 8.0 |
| Backend | Node.js, Express.js | 18+, 5.2 |
| Database | MongoDB, Mongoose | 9.1 |
| Auth | JWT (jsonwebtoken) | 9.0 |
| Security | bcrypt | 6.0 |
| Validation | Zod | 4.3 |
| UI Library | React Router, React Icons | 7.13, 5.6 |
Coursis/
βββ backend/
β βββ src/
β β βββ app.js # Express app configuration
β β βββ server.js # Server entry point
β β βββ config/
β β β βββ db.js # MongoDB connection
β β βββ controllers/ # Business logic
β β β βββ auth.controller.js
β β β βββ user.controller.js
β β β βββ course.controller.js
β β β βββ enrollment.controller.js
β β β βββ teacher.controller.js
β β β βββ admin.controller.js
β β βββ models/ # MongoDB schemas
β β β βββ User.js
β β β βββ Course.js
β β β βββ Enrollment.js
β β βββ routes/ # API endpoints
β β βββ middlewares/ # Custom middlewares
β β βββ validators/ # Zod schemas
β β βββ utils/ # Helpers & utilities
β βββ package.json
β βββ tsconfig.json
β
βββ frontend/
β βββ src/
β β βββ main.tsx # React entry point
β β βββ App.tsx # Main component
β β βββ pages/ # Page components
β β β βββ Home.tsx
β β β βββ HomePage.tsx
β β β βββ ExplorePage.tsx
β β β βββ CourseDetails.tsx
β β β βββ MyCourses.tsx
β β β βββ TeacherDashboard.tsx
β β β βββ AdminDashboard.tsx
β β β βββ Login.tsx
β β β βββ Signup.tsx
β β β βββ EditProfile.tsx
β β βββ components/ # Reusable components
β β β βββ Header.tsx
β β β βββ Footer.tsx
β β β βββ CourseCard.tsx
β β β βββ layout/
β β βββ config/
β β β βββ api.ts # API client
β β βββ index.css # Global styles
β β βββ App.css
β βββ vite.config.ts # Vite config
β βββ tsconfig.json
β βββ package.json
β
βββ README.md
- Browse & discover courses by category
- Enroll and access course materials
- Track enrolled courses
- View instructor profiles
- Create and publish courses
- Set course price and details
- View student enrollments
- Manage course lifecycle
- Monitor all users and courses
- System-wide statistics
- User and course management
- JWT-based secure login
- Role-based access (Student, Teacher, Admin)
- Password hashing with bcrypt
Uses JWT tokens for secure authentication. Different roles have different access:
- Student: Browse courses, enroll, view profile
- Teacher: Create/edit own courses, view enrollments
- Admin: Full platform access
All sensitive endpoints require a valid JWT token in the request header.
Each request goes through:
- Logger - Track request info
- Validator - Check input data (Zod)
- Auth Middleware - Verify JWT token
- Role Check - Ensure user has permission
- Controller - Handle business logic
- Error Handler - Catch & format errors
This keeps code clean and secure.
POST /auth/register - Sign up
POST /auth/login - Log in (returns JWT)
GET /courses - Browse all courses
GET /courses/:id - Get course details
GET /users/me - Get your profile
PATCH /users/me - Update profile
POST /teacher/courses - Create a course
PATCH /teacher/courses/:id - Edit your course
POST /enrollments - Enroll in a course
GET /enrollments - View your enrollments
GET /admin/dashboard - Admin overview
Consistent Error Responses:
- 400 Bad Request - Invalid input
- 401 Unauthorized - Missing/invalid token
- 403 Forbidden - No permission
- 404 Not Found - Resource doesn't exist
- 500 Server Error - Something went wrong
Security Features:
- β Passwords hashed with bcrypt
- β JWT tokens for authentication
- β Role-based access control
- β Input validation (Zod)
- β Ownership verification
Complete & Production Ready:
- β Full-stack course marketplace
- β User authentication (JWT)
- β Role-based system (Student, Teacher, Admin)
- β Course CRUD operations
- β Enrollment system
- β Professional UI (React + Tailwind)
- β Error handling & validation
- Payment gateway (Stripe/PayPal)
- Video streaming for courses
- Course ratings & reviews
- Email notifications
- Search & filtering
- Student certificates
- Live sessions
- Node.js v18+
- MongoDB (local or cloud)
- npm or yarn
1. Clone the repository
git clone https://github.com/armaansharma-dev/Coursis.git
cd Coursis2. Setup Backend
cd backend
npm install
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secret
npm run dev3. Setup Frontend (new terminal)
cd frontend
npm install
npm run devThe app will be available at:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:5400
PORT=5400
MONGO_URL=mongodb+srv://user:password@cluster.mongodb.net/coursis
JWT_SECRET=your_super_secret_jwt_key_here
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173
VITE_API_URL=http://localhost:5400/api/v1
VITE_ENV=development
See .env.example files in backend/ and frontend/ for complete templates.
- Full-stack development (React + Node.js)
- JWT authentication & role-based access
- Express.js middleware patterns
- MongoDB schema design
- RESTful API design
- Error handling & validation
- TypeScript for type safety
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by Armaan Sharma