This is the backend server for a course-selling platform built using Node.js, Express, and MongoDB. It provides functionality for user and admin registration/login, course creation and purchase, and role-based access control to ensure secure access to resources.
- β JWT Authentication for both Users and Admins
- π Protected Routes using middleware and Role Validation
- π Admins can create, edit, and delete courses
- π Users can view and purchase courses
- π¦ MongoDB + Mongoose for robust and scalable data handling
- Backend: Node.js, Express.js
- Database: MongoDB, Mongoose
- Authentication: JWT
- Environment Management: dotenv
- Password Hashing: bcrypt
- Validation & Middleware: Custom Middleware
course-selling-backend/
βββ middleware/
β βββ auth.js
β βββ role.js
βββ routes/
β βββ admin.js
β βββ user.js
β βββ course.js
βββ .gitignore
βββ README.md
βββ db.js
βββ index.js
βββ package.json
βββ package-lock.json