- Database Connection: Connect to MongoDB using
connect.ts
. - Environment Setup: Create
.env
follow.env.example
. - Routers: Use
authRoute.ts
,orderRoute.ts
,productRoute.ts
,reviewRoute.ts
anduserRoute.ts
for routes. - User Registration: Validate and hash user data, send email to validate email the account.
- User Login: Authenticate users, generate tokens, and refresh token.
- Mongoose Errors: Handle validation, duplicate email, validator package, and cast errors..
- Security: Implement
helmet
, CORS,xss-clean
,rate limiting
,express-mongo-sanitize
. - Documentation: API endpoints documented with docgen.
- Clone repository.
- Install dependencies:
npm install
. - Create
.env
in root, follow.env.example
. - Start server:
npm run start:dev
.
See Swagger documentation for API details here.