feat: scaffold westside-contracts SvelteKit app with contract signing flow #1

Closed
opened 2026-03-24 07:36:21 +00:00 by forgejo_admin · 0 comments

Type

Feature

Lineage

westside-app#72 -- parent issue requesting digital contract signing pages

Repo

forgejo_admin/westside-contracts

User Story

As a parent of a Westside player
I want to receive a tokenized link, view my kid's contract, and sign it digitally
So that I can commit to the season without needing to print or scan paperwork

Context

Westside Kings & Queens needs digital contract signing. Parents receive a tokenized email link, view the travel or local contract variant for their kid's team, and sign with a drawn signature. The app is a standalone SvelteKit repo (adapter-node) that talks directly to basketball-api's Postgres database and uploads signatures to MinIO. The HTML/CSS prototype is at ~/pal-e-playground/westside-contract.html and must be copied verbatim into SvelteKit components.

File Targets

Files to create:

  • package.json -- SvelteKit project with pg, @aws-sdk/client-s3, signature_pad
  • svelte.config.js -- adapter-node config
  • vite.config.ts -- vite config
  • tsconfig.json -- TypeScript config
  • src/app.css -- all CSS from prototype
  • src/app.html -- SvelteKit shell
  • src/routes/contract/[token]/+page.server.ts -- token resolution, player/team/parent data
  • src/routes/contract/[token]/+page.svelte -- contract page from prototype HTML
  • src/routes/contract/[token]/sign/+server.ts -- POST endpoint for signature submission
  • src/lib/db.ts -- Postgres pool
  • src/lib/minio.ts -- S3 client for signature upload
  • src/lib/types.ts -- TypeScript interfaces
  • Dockerfile -- production build (node:20-alpine)
  • .woodpecker.yml -- CI pipeline
  • kustomize/ -- k8s manifests
  • static/westside-logo.png -- brand logo

Acceptance Criteria

  • /contract/{token} resolves a valid token and renders the correct contract variant (travel vs local)
  • Invalid tokens return 404
  • Already-signed contracts show an "already signed" page
  • Signature pad captures drawn signatures and uploads PNG to MinIO
  • POST /contract/{token}/sign updates player record in Postgres
  • CSS matches prototype exactly (no Tailwind, no framework)
  • npm run dev starts without errors
  • Dockerfile builds successfully

Test Expectations

  • Manual: visit /contract/{token} with a valid token, verify contract renders
  • Manual: sign a contract, verify MinIO upload and Postgres update
  • Build: npm run build completes without errors

Constraints

  • Use adapter-node, NOT adapter-static
  • Raw SQL with pg -- no ORM
  • No CSS framework (Tailwind, etc.)
  • Copy prototype HTML/CSS verbatim into SvelteKit components
  • signature_pad.js for signature capture

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • westside-app#72 -- parent issue
  • westside -- project
### Type Feature ### Lineage `westside-app#72` -- parent issue requesting digital contract signing pages ### Repo `forgejo_admin/westside-contracts` ### User Story As a parent of a Westside player I want to receive a tokenized link, view my kid's contract, and sign it digitally So that I can commit to the season without needing to print or scan paperwork ### Context Westside Kings & Queens needs digital contract signing. Parents receive a tokenized email link, view the travel or local contract variant for their kid's team, and sign with a drawn signature. The app is a standalone SvelteKit repo (adapter-node) that talks directly to basketball-api's Postgres database and uploads signatures to MinIO. The HTML/CSS prototype is at `~/pal-e-playground/westside-contract.html` and must be copied verbatim into SvelteKit components. ### File Targets Files to create: - `package.json` -- SvelteKit project with pg, @aws-sdk/client-s3, signature_pad - `svelte.config.js` -- adapter-node config - `vite.config.ts` -- vite config - `tsconfig.json` -- TypeScript config - `src/app.css` -- all CSS from prototype - `src/app.html` -- SvelteKit shell - `src/routes/contract/[token]/+page.server.ts` -- token resolution, player/team/parent data - `src/routes/contract/[token]/+page.svelte` -- contract page from prototype HTML - `src/routes/contract/[token]/sign/+server.ts` -- POST endpoint for signature submission - `src/lib/db.ts` -- Postgres pool - `src/lib/minio.ts` -- S3 client for signature upload - `src/lib/types.ts` -- TypeScript interfaces - `Dockerfile` -- production build (node:20-alpine) - `.woodpecker.yml` -- CI pipeline - `kustomize/` -- k8s manifests - `static/westside-logo.png` -- brand logo ### Acceptance Criteria - [ ] `/contract/{token}` resolves a valid token and renders the correct contract variant (travel vs local) - [ ] Invalid tokens return 404 - [ ] Already-signed contracts show an "already signed" page - [ ] Signature pad captures drawn signatures and uploads PNG to MinIO - [ ] POST `/contract/{token}/sign` updates player record in Postgres - [ ] CSS matches prototype exactly (no Tailwind, no framework) - [ ] `npm run dev` starts without errors - [ ] Dockerfile builds successfully ### Test Expectations - [ ] Manual: visit `/contract/{token}` with a valid token, verify contract renders - [ ] Manual: sign a contract, verify MinIO upload and Postgres update - [ ] Build: `npm run build` completes without errors ### Constraints - Use adapter-node, NOT adapter-static - Raw SQL with pg -- no ORM - No CSS framework (Tailwind, etc.) - Copy prototype HTML/CSS verbatim into SvelteKit components - signature_pad.js for signature capture ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `westside-app#72` -- parent issue - `westside` -- project
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/westside-contracts#1
No description provided.