Skip to content

smwa/wsdc_points_server

Repository files navigation

WSDC Points — server

The collected WSDC data can be downloaded at https://wsdc.mechstack.dev/data.json.

A server-rendered site for West Coast Swing competition data from the WSDC registry: look up dancers' points and division eligibility, browse past events and their competitors, and see upcoming sanctioned events. It replaces an older Jekyll static-site + flat-file approach with HTML rendered on the server from PostgreSQL.

Stack

FastAPI · Jinja2 (server-rendered HTML, minimal progressive-enhancement JS) · PostgreSQL (asyncpg) · uvicorn · Docker.

Quick start (Docker)

cp .env.example .env          # add OPEN_WEATHER_MAP_API_KEY for event geocoding
docker compose up --build

This starts PostgreSQL, the app on http://localhost:8000, and the data importer. The app/importer apply migrations on startup from the SQL baked into the image (python -m src.migrate), so no source or initdb mount is needed on the server. Credentials are postgres:postgres / db wsdc (dev only).

To load data without hitting WSDC, point the importer at the legacy cached files and run a single offline pass (set IMPORTER_OFFLINE=true in .env):

docker compose run --rm importer python -m src.importer --once

Pages

/ home · /dancers · /dancer/{id} · /events · /event/{id} · /event-competitors/{occurrence_id} · /upcoming-events (+ /wsdc_events.ics) · /dancers-over-time · /about. /health is the JSON health check.

Feeds & data: /feed/{feed_token}.xml is a per-user RSS feed of your starred dancers' newest points (the home page links it next to "Starred Dancers"), and /data.json streams the whole dataset (the dancer/event/placement tables; the private and operational tables are excluded) for anyone who wants to download it.

Data importer

python -m src.importer fetches each dancer from WSDC and upserts it in its own transaction, prioritising recent competitors and looping forever; --once runs a single pass and IMPORTER_OFFLINE=1 reads the legacy cache files instead of the network. See AGENTS.md for the full design.

Local development (without Docker)

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env                  # set DATABASE_URL
./database/migrate.sh                 # needs DATABASE_URL in the environment
uvicorn src.main:app --reload

More

AGENTS.md is the detailed reference (schema, importer internals, theme conventions, deployment). The image is published to GHCR by .github/workflows/docker-publish.yml.

About

Server-rendered West Coast Swing (WSDC) competition points site — FastAPI + PostgreSQL, replacing the old static Jekyll site

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors