This project is for building various tools required for table tennis.
- Handicap Score Calculator: A tool to calculate handicap scores for players based on their handicap points.
- Soon: ELTTTL Match Availability Tracker: A tool to track match availability for players in the Edinburgh and Lothians Table Tennis League (ELTTTL).
This repository now contains two main pieces:
frontend/— A SvelteKit (TypeScript) frontend scaffold. The home page (src/routes/+page.svelte) contains tiles that link to individual tools (e.g./handicap).worker/— A Cloudflare Worker scaffold (TypeScript) usingHonofor lightweight API endpoints. It exposes/api/handicapand/api/healthhandlers.
Prereqs: Node 18+, npm, and wrangler for Cloudflare Workers.
- Frontend
cd frontend
npm install
npm run dev- Worker (local dev with Wrangler)
cd worker
npm install
npx wrangler devThe frontend includes both end-to-end tests (Playwright) and unit tests (Vitest).
cd frontendnpm run test:unit# Install Playwright browsers (first time only)
npx playwright install
# Run tests
npm run test:e2enpm run test- Frontend: build with
npm run buildinfrontend/and deploy to Cloudflare Pages. SvelteKit supports the Cloudflare adapter for Pages/Workers. - Worker: publish with
npx wrangler publish(fillaccount_idinworker/wrangler.toml).
- Wire the frontend to the Worker API endpoints health endpoint
- Implement availability tracker