Small FastAPI service for managing users.
- Create users (stores hashed password)
- List users
- POST /users
- Request body: UserCreate { "username", "name", "role", "password" }
- Response: UserPublic { "id", "username", "name", "role" }
- Implementation:
routers.user.create_user
- GET /users
- Response: list of UserPublic
- Implementation:
routers.user.get_users
- Dev: SQLite file
database.db(see api/db/db.py) - Prod: set environment variables
DB_USER,DB_PASSWORD,DB_HOST,DB_PORT,DB_NAMEandPROD=true - DB initialization is performed by
db.db.create_db_and_tablesat app startup.
- Sync dependencies
uv sync- Run app:
uv run fastapi run- Access the API docs at
http://localhost:8000/docs
- Place your
Dockerfileon this directory. - Place your
docker-compose.ymlon this directory. - Place your report for 4.3 on this directory.
- Place your report for 4.4 on this directory.