- Sign up and login with JWT authentication
- api actions based on user role
- mongodb agrregation, reference and populate
- api validation with zod
- password hashing with bcrypt
- data consistency with mongoose transaction and rollback
- TypeScript, Node.js, Express.js, MongoDB, Mongoose, Zod, Bcrypt, JWT
- First, clone the repo and install the dependencies using
npm install
command. - then, build the project using
npm run build
command. - at last, run the project using
npm run start:dev
command.
-
(user) : username: xpawal password: awal123
-
(admin) : username: babulakterfsd password: babul123
-
Register a user
- Endpoint:
/api/auth/register
- Method:
POST
- Method:
- Endpoint:
-
Login a user
- Endpoint:
/api/auth/login
- Method:
POST
- Method:
- Endpoint:
-
Change password
-
Endpoint: `/api/auth/change-password`
-
Method: `POST`
-
-
create a course
- Endpoint:
/api/courses
- Method:
POST
- Method:
- Endpoint:
-
get all courses
- Endpoint:
/api/courses
- Method:
GET
- Method:
- Endpoint:
-
create a category
- Endpoint:
/api/categories
- Method:
POST
- Method:
- Endpoint:
-
get all categories
- Endpoint:
/api/categories
- Method:
GET
- Method:
- Endpoint:
-
create a review
- Endpoint:
/api/reviews
- Method:
POST
- Method:
- Endpoint:
-
update a course
- Endpoint:
/api/courses/:courseId
- Method:
PUT
- Method:
- Endpoint:
-
get single course with reviews
- Endpoint:
/api/courses/:courseId/reviews
- Method:
GET
- Method:
- Endpoint:
-
get the best course
- Endpoint:
/api/course/best
- Method:
GET
- Method:
- Endpoint: