FastAPI backend for skins.sulej.net (backend for osc_dev/osc-skins-ui)
  • Python 99.6%
  • Dockerfile 0.2%
  • Mako 0.2%
Find a file
Arlind-dev 37c0b1846d
All checks were successful
Build and Push osc-api / Release & build osc-api (push) Successful in 26s
ci: drop redundant comments in build workflow
2026-05-18 19:56:42 +02:00
.gitea/workflows ci: drop redundant comments in build workflow 2026-05-18 19:56:42 +02:00
alembic Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00
app fix(avatar): log non-2xx upstream responses at warning for operator visibility 2026-05-17 22:52:14 +02:00
scripts Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00
tests chore: organize imports (ruff auto-fix) 2026-05-17 20:16:00 +02:00
.gitignore Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00
.releaserc.json ci: add beta prerelease branch with branch-aware image tagging 2026-05-18 19:53:14 +02:00
alembic.ini Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00
CHANGELOG.md chore(release): 1.4.2 [skip ci] 2026-05-17 20:52:47 +00:00
Dockerfile Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00
openapi.json chore: refresh openapi.json [skip ci] 2026-05-17 16:24:55 +00:00
pyproject.toml chore(release): 1.4.2 [skip ci] 2026-05-17 20:52:47 +00:00
README.md Initial commit: osc-api (FastAPI backend for skins.sulej.net) 2026-05-17 14:34:52 +02:00

osc-api

FastAPI backend for skins.sulej.net. The UI lives in osc_dev/osc-skins-ui.

Stack

  • Python 3.12, FastAPI, SQLAlchemy async + asyncpg
  • Alembic migrations
  • Pydantic-settings for config
  • Authlib (osu! OAuth)
  • aioboto3 (Garage S3 for CI log fallback)

Local dev

python3.12 -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"

# minimum env to import the app; see app/config.py for the full list
export DATABASE_URL='postgresql+asyncpg://osc:osc@localhost:5432/oscweb' \
       SESSION_SECRET=x FORGEJO_TOKEN=x OSU_CLIENT_ID=1 OSU_CLIENT_SECRET=x \
       GARAGE_ACCESS_KEY=x GARAGE_SECRET_KEY=x WEBHOOK_SECRET=x BOT_TOKEN=x \
       ADMIN_OSU_IDS='[]'

alembic upgrade head
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Deployment

CI on push to main builds the image and pushes git.sulej.net/osc_dev/osc-api:latest, then snapshots the OpenAPI spec to openapi.json (committed back with [skip ci]). The server at /home/arlind/docker/oscbot/ runs docker compose pull && up -d to roll forward.

Traefik routes skins.sulej.net/api/*osc-web-backend:8000.

OpenAPI

openapi.json is checked into the repo and refreshed by CI on every backend change. osc-skins-ui runs npm run sync-types to generate matching TypeScript types from it — no more hand-mirrored SkinEntry / SkinsJson types.

Permissions

Action Anyone Owner Admin
Browse
Edit own repo
Edit any repo