FastAPI backend for skins.sulej.net (backend for osc_dev/osc-skins-ui)
- Python 99.6%
- Dockerfile 0.2%
- Mako 0.2%
|
All checks were successful
Build and Push osc-api / Release & build osc-api (push) Successful in 26s
|
||
|---|---|---|
| .gitea/workflows | ||
| alembic | ||
| app | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| .releaserc.json | ||
| alembic.ini | ||
| CHANGELOG.md | ||
| Dockerfile | ||
| openapi.json | ||
| pyproject.toml | ||
| README.md | ||
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 | ✓ |