The Warehouse application is built using FastAPI, SQLAlchemy, and PostgreSQL. It provides an API for managing orders and products in a warehouse.
warehouse-application/
├── alembic/
│ └── versions/
├── core/
├── crud/
├── logs/
│ └── app.log
├── utils/
├── main.py
├── docker-compose.yml
├── Dockerfile
├── Makefile
├── poetry.lock
├── pyproject.toml
└── README.md
- Python 3.12
- FastAPI
- Uvicorn
- SQLAlchemy (asyncio)
- Asyncpg
- Alembic
-
Create a
.env
file in thewarehouse-application
folder with the following content:APP_CONFIG__DB__URL=postgresql+asyncpg://postgres:123@db:5432/warehouse APP_CONFIG__DB__ECHO=1 DATABASE_URL=postgresql+asyncpg://postgres:123@db:5432/warehouse
-
Install dependencies using Poetry:
poetry install
You can build and run the application using the Makefile:
-
Build the application:
make build
-
Run the application:
make run
- POST /api/v1/orders: Create a new order.
- GET /api/v1/products: Retrieve a list of products.
- GET /api/v1/orders/{order_id}: Retrieve details of a specific order.
Logs are saved in the logs/app.log
file.
Migrations are managed using Alembic. To create a new migration, run:
alembic revision --autogenerate -m "Migration message"
To apply migrations, run:
alembic upgrade head
I intended to implement role-based access control to enhance security and user management but didn't have enough time to complete this feature. I am so sorry for this :(
This project is licensed under the MIT License.