A crowd-sourced tool for cataloguing Portuguese sports newspaper front pages. Users swipe covers left/right/up/down to classify which football club dominates each edition: Benfica (←), Sporting (→), Porto (↓), or Other (↑).
Live at capas.digasnikas.com (the logged-in app lives on its own subdomain: app.capas.digasnikas.com)
This README only says where things are. The reasoning lives at capas.digasnikas.com/documentation: the scraper's fallback source, the AI classifier's prompt history, the alignment math behind "A capa média", the full D1 schema and API.
Picking a day and swiping through its covers:
capas-app-1.mp4
Then the account view and the leaderboard:
capas-app-2.mp4
| Folder | What | |
|---|---|---|
dashboard/ |
Public results page (Pages, capas.digasnikas.com). Also serves /documentation |
dashboard/README.md |
app/ |
Swipe app, behind Cloudflare Access (Pages, app.capas.digasnikas.com) |
app/README.md |
api/ |
Cloudflare Worker: scraper + REST API, one D1 database behind both frontends | api/README.md |
scripts/ |
Local tooling; each script has a matching one-click GitHub Action | scripts/README.md |
shared/ |
classifier-cases.json: cases both classifier copies (api/lib/ai.js, scripts/rag_classify.py) must pass, plus a hash of the prompt |
run by api/lib/ai.test.mjs and scripts/rag_classify_test.py |
wrangler.toml is the Worker's config (routes, cron, R2/D1/Images/AI bindings); package.json pins the dev tools (wrangler, Playwright, http-server); CI installs them from package-lock.json with npm ci, and the Python workflows pin versions through scripts/requirements.txt. There is no build step anywhere in this repo, frontend included.
Note: the frontends use native ES modules and can't be opened via
file://. Usewrangler devor any local HTTP server for local testing.
Tests: node <file>.test.mjs for any self-check. Browser suite: npm ci, npx playwright install chromium (skip if Chrome is installed), then npm run test:e2e.