Welcome to e-commerce-api, a robust REST API developed with Node.js, TypeScript, Express, and MongoDB. This API empowers you to efficiently manage users, sessions, and products with ease.
- User Management
- Create a new user:
POST /api/users
- Validate user input:
validate(createUserSchema)
- Create a new user:
- Session Management
- Create a new session:
POST /api/sessions
- Get user sessions:
GET /api/sessions
(requires user authentication) - Delete a session:
DELETE /api/sessions
(requires user authentication) - Validate session input:
validate(createSessionSchema)
- Create a new session:
- Product Management
- Create a new product:
POST /api/products
(requires user authentication) - Update a product:
PUT /api/products/:productId
(requires user authentication) - Get a product by ID:
GET /api/products/:productId
- Delete a product:
DELETE /api/products/:productId
(requires user authentication) - Validate product input:
validate(createProductSchema)
,validate(updateProductSchema)
,validate(getProductSchema)
,validate(deleteProductSchema)
- Create a new product:
Follow these steps to get started with E-Commerce API:
- Clone the repository:
git clone https://github.com/judevector/e-commerce-api.git
- Install dependencies:
yarn install
- Set up your MongoDB database and configure the connection in the project.
- Run the API:
yarn dev
Ensure the reliability of the API by running comprehensive tests:
- Unit tests
- Integration tests
- End-to-end tests with Supertest