Book Tracker is a full-stack Python application for managing personal reading progress.
Tech stack:
- Backend: FastAPI + SQLite
- Frontend: Streamlit
- Testing and quality: pytest, pytest-cov, flake8, radon, bandit, locust
src/backendFastAPI backendsrc/frontendStreamlit frontendtestunit and integration testslocustperformance test scenarios
- Python
3.14 - Poetry
2.3.1
Install Poetry:
- Linux/macOS:
curl -sSL https://install.python-poetry.org | POETRY_VERSION=2.3.1 python3 -- Windows (PowerShell):
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
poetry self update 2.3.1Install dependencies:
poetry install --with test_lint --no-rootStart backend:
poetry run uvicorn src.backend.app:app --reload --host 127.0.0.1 --port 8000Start frontend (new terminal):
poetry run streamlit run src/frontend/app.py --server.port 8080Application URLs:
- Frontend:
http://localhost:8080 - Backend API:
http://localhost:8000 - OpenAPI docs (Swagger):
http://localhost:8000/docs - OpenAPI JSON:
http://localhost:8000/openapi.json
- Radon: checks for cyclomatic complexity and maintainability index. We achieved
2.408average cyclomatic complexity and average gradeAon maintainability index. - Flake8: no linter flags achieved.
- Pytest:
86.32%test coverage achieved with84tests. All tests pass. - Bandit: no vulnerabilities identified.
- Locust: response time
15msat P95 and6mson average.
Then open:
http://localhost:8089
Recommended check:
- P95 response time should be
< 200ms
Auth:
POST /auth/registerPOST /auth/login
Books:
POST /books/GET /books/GET /books/{book_id}PUT /books/{book_id}DELETE /books/{book_id}
System:
GET /
CI workflow is configured in:
.github/workflows/test_lint.yml
Current CI runs:
pytest --cov=src --cov-fail-under=70pytest test/radon cc -a -s src/radon mi -s src/flake8 src/bandit -r src/
Note:
- Performance (
locust) and OpenAPI completeness checks are currently non-blocking (not CI-gated).