Greenfield scaffold for Linkder, a swipe-to-hire marketplace for local
professional services.
- pnpm/turbo monorepo: apps/web, packages/{shared,db}
- Postgres 16 + PostGIS via docker compose (ports 5442/6389 to avoid
clashing with other local stacks)
- Drizzle schema, 23 tables, geography(Point,4326) with GiST indexes
- Domain core in packages/shared: integer-cent money, status transition
graphs, deck ranking weights, cancellation policy — 46 unit tests
- Deck query: filtering in Postgres on the GiST index, ranking in JS so
the weights stay tunable — 18 integration tests against a seeded DB
- Deterministic seed placing pros at known distances, including three
that must NOT appear on a deck (out of radius, unverified, away)
- Next.js 15 app shell with a working swipe deck
- CI: typecheck, lint, test, build against live postgres+redis
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgis/postgis:16-3.4
|
|
env:
|
|
POSTGRES_USER: linkder
|
|
POSTGRES_PASSWORD: linkder
|
|
POSTGRES_DB: linkder
|
|
ports: ['5442:5432']
|
|
options: >-
|
|
--health-cmd "pg_isready -U linkder -d linkder"
|
|
--health-interval 5s --health-timeout 5s --health-retries 10
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports: ['6389:6379']
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 5s --health-timeout 3s --health-retries 10
|
|
|
|
env:
|
|
DATABASE_URL: postgresql://linkder:linkder@localhost:5442/linkder
|
|
REDIS_URL: redis://localhost:6389
|
|
NEXT_PUBLIC_CITY_LAT: '41.3874'
|
|
NEXT_PUBLIC_CITY_LNG: '2.1686'
|
|
NEXT_PUBLIC_CITY_NAME: Barcelona
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
# The integration tests assert against exact seeded distances, so the
|
|
# database must be migrated and seeded before they run.
|
|
- run: cp .env.example .env
|
|
- run: pnpm db:migrate
|
|
- run: pnpm db:seed
|
|
|
|
- run: pnpm typecheck
|
|
- run: pnpm lint
|
|
- run: pnpm test
|
|
- run: pnpm build
|