This is a template code for Micro Services base on NestJs framework
ICommerce is online shopping application.
Project is a e-commerce service includes:
- Core Service
- Product Service
- Customer Service
- ...
Use NodeJs version v12.18.3 or uper version.
node --version
v12.18.3
Use the package manager Yarn version 1.22.4 or uper version.
yarn --version
1.22.4
Use Docker version 20.10.5 and Docker Compose version 1.28.5
docker --version
Docker version 20.10.5, build 55c4c88
docker-compose --version
docker-compose version 1.28.5, build c4eb3a1f
Use MySQL, docker image latest version
The Architecture design in here.
root
|-- docs
|-- images
|-- ARCHITECTURE.md
|-- docker-compose
|-- docker-compose.yaml
|-- migrations
|-- init.sql
|-- nab-core-service
|-- ...
|-- nab-customer-service
|-- ...
|-- nab-product-service
|-- ...
- The nab-core-service is core base.
- The nab-customer-service is customer service.
- The nab-product-service is product service.
cd docker-compose
docker-compose up
Project will automatic run base on docker enviroments
Note: Run project first.
Server: mysql-db:3306
Username: root
Password: admin
Database: nab-customer-service || nab-product-service
Note: Run project first.
curl --location --request POST 'localhost:3000/products/search' \
--header 'Authorization: 8ea031c8-3d2e-4996-85dc-d3dff57token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Joy",
"orderBy": "price",
"orderType": "DESC",
"limit": 10,
"page": 0
}'
curl --location --request GET 'localhost:3000/products/product_3f210ca5-ae38-4e5f-8353-f86eaba1b98c' \
--header 'Authorization: 8ea031c8-3d2e-4996-85dc-d3dff57token'
The Authentication/Authorization are not implemented, these trust mock data (Link).
Thanks for watching.