Tech: Node + Typescript + Express + Postgres/sequelize + Swagger + Docker
Assumptions done:
- User has a virtual wallet.
- Adding to cart. Intermediate stage before checkout.
- List of cart items are sent to add items to cart. [{ productId: 1, quantity: 2}]
- Checking out cart proceeds to payment deducts balance from user wallet.
- User can save instances of carts as wishlists for instant checkout.
├── .github/workflows
├── migrations
├── src
│ ├── config
│ ├── controllers
│ ├── interfaces
│ ├── middleware
│ ├── models
│ ├── routes
│ ├── services
│ ├── tests
│ ├── utils
│ ├── app.ts
│ └── index.ts
Prerequisites for running app Install postgres database in your local machine before the following steps.
Update migrations/config.json and ./dev.env with postgres password and continue the below steps
#Install dependencies
npm i
#Run database migrations/seed
npm run publish:db
#Start app in dev mode. Default port: 3000
npm run dev
Make sure the app is running using the above command.
npm run test
http://localhost:3000/api-docs