This is the backend for REST APIs of an ecommerce application built with Nest.js. This app includes REST APIs basic ecommerce features. The featuers are written below.
This app has following features/modules.
- Manage categories
- Manage sub-categories
- Manage Products
- Reviews/Ratings on products from customers
- Manage products wishlist
- Manage user profile
- Manage user cart
- Place orders
- Notifications
- User management (Admin | User)
- Nest.js
- Prisma
- PostgreSQL
-
First you'll need to install postgreSQL in your local system to setup database.
-
Install dependecies
npm install
-
Delete
migrations
folder fromprisma/
for a fresh start. (Optional) -
Migrate database using prisma. It will prompt you for migration name. You can name it anything. e.g.
initial_migration
npx prisma migrate dev
-
Run the app
npm run start:dev
-
Your app will start running on PORT 3000.
Please refer to the provided postman collection in the root folder
This project using built-in Server-sent-event system to send server to client events. Use javascript's EventSource
API to connect with {{base_url}}/notifications/{{userId}}
. You can find this API in notification folder in postman. The EventSource will return an object with message property containing the notification text.
Contributions are welcome! If you have suggestions or improvements, feel free to open an issue or submit a pull request.