E-Commerce NodeJS MS adalah aplikasi berbasis microservices untuk mensimulasikan proses belanja di sebuah e-commerce yang terdiri dari 4 service:
- User Service
- Product Service
- Order Service
- Transaction Service
Communication between services are illustrated with diagram below:
Masing-masing service memiliki satu atau lebih database collection yang dikelolanya.
- User Service memiliki data collection Users
- Product Service memiliki data collection Products
- Order Service memiliki data collection Carts dan Orders
- Transaction Service memiliki data collection Transactions
Entity Diagram untuk keempat service tersebut dapat dilihat di bawah ini:
Application log is available a
- Clone repo
- Copy
.env.devto.env - Ensure MongoDB & Kafka is available in the system, and update
.envfile accordingly - Change directory into individual service's directory, e.g:
cd user - Run
npm run dev
- Install Docker Engine
- HOST_IP is needed to run Kafka properly. Provide HOST_IP in ENV file, then run docker-compose:
docker-compose build && docker-compose up
or get current HOST_IP directly from command:
export HOST_IP=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
docker-compose build && docker-compose up
npm run test
API Documentation is provided with Postman Click here to access