- API image (uv multi-stage, non-root, gunicorn, migrations on start, health check) and UI image (nginx, CSP, config.js rendered from API_BASE_URL); /healthz documented in OpenAPI - docker compose runs db, api and ui; the "monitoring" profile adds Prometheus, postgres-exporter and Grafana, all provisioned from files - Grafana dashboards: API overview (RED), Last.fm API, Usage, Database - Prometheus alert rules: API down, error rate, latency, auth failure spike, ignored scrobbles, DB pool saturation, Postgres down - Pool checkout gauge counts events (the pool's own counters lag the checkin event); error ratios show 0 instead of "No data" - Tests check dashboards and alerts only use metrics that exist - scripts/generate_traffic.py drives realistic traffic for demos Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
52 lines
1.1 KiB
TOML
52 lines
1.1 KiB
TOML
[project]
|
|
name = "scrobbler"
|
|
version = "0.1.0"
|
|
description = "Self-hosted, Last.fm-compatible music scrobbling service"
|
|
requires-python = ">=3.13"
|
|
dependencies = [
|
|
"flask>=3.1.3",
|
|
"flask-cors>=6.0.5",
|
|
"flask-migrate>=4.1.0",
|
|
"flask-smorest>=0.47.0",
|
|
"flask-sqlalchemy>=3.1.1",
|
|
"gunicorn>=26.2.0",
|
|
"prometheus-client>=0.26.0",
|
|
"psycopg[binary]>=3.3.6",
|
|
"python-dotenv>=1.2.3",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/scrobbler"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
pythonpath = ["tests"]
|
|
addopts = "-ra"
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py313"
|
|
src = ["src", "tests"]
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "W", "I", "B", "UP", "SIM"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"openapi-spec-validator>=0.9.0",
|
|
"pylast>=7.1.0",
|
|
"pytest>=9.1.1",
|
|
"pyyaml>=6.0.3",
|
|
"ruff>=0.16.9",
|
|
]
|
|
|
|
[tool.ruff.format]
|
|
exclude = ["src/scrobbler/migrations/**"]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"src/scrobbler/migrations/**" = ["E501", "I", "UP", "W"]
|