Skip to content

Latest commit

 

History

History
102 lines (77 loc) · 2.28 KB

README.md

File metadata and controls

102 lines (77 loc) · 2.28 KB

Customer Order API

Customer and Address API

Overview

RabbitMQ, celery and Kombu was used to exchange messages between each app/service

Following the diagram below, celery keeps consumer up to listen if has a new message to given a queue.

For the producer part it also was used kombu to send a message to given a queue.

order-address-ms

der

Getting Started

Following these instructions will make this project running in your local machine development.

The entire customer app needs from other project to be up as well which is: address-api

Prerequisites

- Python3
- Docker
- docker-compose
- Postgres  [psycopg](http://initd.org/psycopg/docs/install.html)

To run

1- git clone https://github.com/drsantos20/customer-service.git
2- cd customer-service
3- docker-compose up --build

4- cd ..
5- git clone https://github.com/drsantos20/address-service.git
5.1 Add your google maps API key into /address-service/api/settings.py -> `GOOGLE_API_KEY`
6- cd address-service
7- docker-compose up --build

Installing

1- Customer

1- git clone https://github.com/drsantos20/customer-service.git
2- cd customer-service
3- python3 -m venv env
4- source env/bin/activate
5- docker-compose up --build

2- Address

1- git clone https://github.com/drsantos20/address-service.git
2- cd address-service
3- python3 -m venv env
4- source env/bin/activate
5- docker-compose up --build

Running tests

Make ensure if rabbitmq and postgres images is running.

to check docker ps

python manage.py test

Available URLS:

POST http://127.0.0.1:8000/api/v1/order/

Create new Order

POST http://127.0.0.1:8000/api/v1/order/

{
    "address": {
        "street": "Praca da sé, 888",
        "city": "Sao Paulo",
        "uf": "SP",
        "neighborhood": "Praça da sé",
        "zip_code": "05424-000"
    },
    "user": {
        "email": "[email protected]",
        "name": "John",
        "phone": 999999999
    }
}

Author

  • Daniel Santos - Trying to keep simple and clean - drsantos20