The Order Service is one of 3 microservices for the Ada Developers Academy Cloud Curriculum e-commerce application. It handles the creation and management of customer orders in e-commerce system. Each order belongs to a user and contains one or more order items, where each item references a product (by ID, name, and price) along with a quantity.
- Order — represents a customer order, associated with a
user_id - OrderItem — represents a line item within an order, containing
product_id,product_name,product_price, andquantity
| Method | Path | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /orders/ |
Create a new order |
| GET | /orders/ |
Get all orders (supports query filters) |
| GET | /orders/<id> |
Get a single order by ID |
| PUT | /orders/<id> |
Update an order by ID |
| DELETE | /orders/<id> |
Delete an order by ID |
- Python 3.13+
- PostgreSQL
git clone <repo-url>
cd order-servicepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
SQLALCHEMY_DATABASE_URI=postgresql+psycopg2://postgres:postgres@localhost:5432/order_service_db
SQLALCHEMY_TEST_DATABASE_URI=postgresql+psycopg2://postgres:postgres@localhost:5432/order_service_test_db
psql -U postgres
# Inside psql CLI
CREATE DATABASE order_service_db;
CREATE DATABASE order_service_test_db;flask db upgradepython seed.pyflask run --debugpytest