A simple clothing store backend built with FastAPI and PostgreSQL.
- Database schema now matches the API code
- Login and registration work correctly
- Admin authorization works correctly
- Docker Compose now starts both the API and PostgreSQL
- Sample data is included
.env.exampleis included- Request validation uses Pydantic models
On Windows PowerShell:
Copy-Item .env.example .envdocker compose up --buildOpen:
http://localhost:8080/docs
Admin account from sample data:
- Email:
admin@example.com - Password:
admin123
- Project folder opened in VS Code or File Explorer
.envfile created from.env.exampledocker compose up --buildrunning successfullyhttp://localhost:8080/docsopened in browserGET /healthreturning successPOST /userscreating a normal customerPOST /users/loginlogging in as admin- Authorize button in Swagger with the bearer token
POST /categoriescreating a category as adminPOST /productscreating a product as adminPOST /orderscreating an order as customerGET /ordersshowing the user order listGET /statistics/usersas adminGET /statistics/productsas admin
If you want to start from scratch again:
docker compose down -v
docker compose up --buildIf you already have PostgreSQL running separately, you can also run:
python db_migration.py