cp .env.example .env
make dev # starts postgres, order-service in docker compose
# api docs for order service at
localhost:8000/docs
# Run app locally
poetry install
poetry run uvicorn --app-dir=order-service main:app --reload
Order service handles taking orders via a REST endpoint. POST /order { "coffee_type": "latte | cappuccino | american | ...", "quantity": 1 }
After order is created, the order will be sent to coffee-service to be made. Depending on the coffee type, the time to create can vary (as noted in barista-service/menu.py)
Once coffee is made, a PUT request is made to the order to update it's order status to COMPLETED.
Improvements to make:
- Add notification service to send email to users when coffee is ready.
- Update order status to IN_PROGRESS when barista-service starts
- Show example of running with multiple barista-service
- Add simple frontend to make order
- Fix user input validation
- Expose API to show list of avaliable coffee/quantity. Support ran out of supplies
- Add unit tests