- Modular Routers: Organized under /api, cleanly separated.
- SQLAlchemy ORM: Includes models for Book and AuditLog.
- CRUD APIs: Supports Create, Read, Update, and Delete operations for Book (tenant-aware).
- Multi-Tenancy: Handled via the X-Tenant-ID header to connect to the correct database.
- Audit Log (Event): Automatically logs events after inserts using event listeners.
- Middlewares: Easy to integrate logging, authentication, or performance profiling.
Install Python 3 and pip3 (If not already installed) in your machine.
git clone <repo-url>
cd openai-fastapi
python3 -m venv venv
source venv/bin/activate
deactivate
pip3 install -r requirements.txt
pip3 freeze > requirements.txt
alembic init alembic
alembic revision --autogenerate -m "related message"
alembic upgrade head
python3 -m app.main
[ OR ]
uvicorn app.main:app --reload --port 9001
[ OR ]
docker compose up --build -d
docker compose down
docker ps
docker logs fast_openai
After running application, navigate to /redoc
, can download & import to postman!