| 1 | # Stepping App: Setup |
| 2 | |
| 3 | Monorepo for the Stepping (Chicago stepping) community app. Web app first, |
| 4 | native apps later. This guide is the path from a fresh clone to a running dev |
| 5 | server, then to a deploy. |
| 6 | |
| 7 | ## Prerequisites |
| 8 | |
| 9 | - Node 20.11+ (Node 22 fine) |
| 10 | - pnpm 9 (`corepack prepare pnpm@9.15.9 --activate`) |
| 11 | |
| 12 | ## 1. Install |
| 13 | |
| 14 | ```bash |
| 15 | pnpm install |
| 16 | ``` |
| 17 | |
| 18 | ## 2. Supabase project (provides Postgres, Auth, Storage) |
| 19 | |
| 20 | 1. Create a project at supabase.com. |
| 21 | 2. Database -> Extensions: enable **postgis**. |
| 22 | 3. Copy `.env.example` to `.env` (repo root) and `apps/web/.env.local`, then fill: |
| 23 | - `DATABASE_URL` from Project Settings -> Database -> Connection string (URI, use the pooler on port 6543). |
| 24 | - `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY` from Project Settings -> API. |
| 25 | |
| 26 | ## 3. Database schema + seed |
| 27 | |
| 28 | ```bash |
| 29 | pnpm db:generate # build SQL migrations from packages/db/src/schema.ts |
| 30 | pnpm db:migrate # apply them (or: pnpm db:push for a quick first sync) |
| 31 | pnpm db:seed # load the dev user + launch cities (Chicago flagship + 5) |
| 32 | ``` |
| 33 | |
| 34 | ## 4. Auth |
| 35 | |
| 36 | In Supabase Auth, enable: Email (magic link), Google, and Apple. Apple is on |
| 37 | from day one so the future iOS build has no auth blocker. |
| 38 | |
| 39 | ## 5. Run |
| 40 | |
| 41 | ```bash |
| 42 | pnpm dev |
| 43 | ``` |
| 44 | |
| 45 | Web app on http://localhost:3000. tRPC is mounted at `/api/trpc`. |
| 46 | |
| 47 | ## 6. Deploy (web) |
| 48 | |
| 49 | Deploy `apps/web` to Vercel. Set the same env vars in the Vercel project. CT 215 |
| 50 | in the homelab is the staging target. Production runs entirely on cloud (Vercel + |
| 51 | Supabase) so a homelab reboot never takes the site down. |
| 52 | |
| 53 | ## Repo layout |
| 54 | |
| 55 | ``` |
| 56 | apps/web Next.js 16 app (App Router, Tailwind v4) |
| 57 | packages/db Drizzle schema + client + seed (Postgres/Supabase) |
| 58 | packages/api tRPC routers + Zod inputs + service seams |
| 59 | packages/types Shared string-union types (mirror the DB enums) |
| 60 | packages/config App constants (launch cities, dev user) |
| 61 | packages/ui Shared UI helpers (shadcn/ui lands here) |
| 62 | ``` |
| 63 | |
| 64 | ## What is built vs pending |
| 65 | |
| 66 | Done in this scaffold (plan checklist items 1, 3, 7, 15): |
| 67 | |
| 68 | - Monorepo + Next.js web app, builds clean. |
| 69 | - Full Drizzle schema: Ownership + Moderatable mixins, all entities, dormant |
| 70 | role / trust / monetization columns. |
| 71 | - tRPC layer: city, event, video, comment, flag, promoter, dj, steppingGroup, |
| 72 | class, and a minimal admin moderation router. Open posting with |
| 73 | ownership stamping and optimistic publish. |
| 74 | - `MediaService` and `ModerationService` seams (no-op today; Mux is a Phase 2 |
| 75 | adapter, not a refactor). |
| 76 | - Reference seed (launch cities: Chicago flagship + Atlanta, Detroit, Houston, |
| 77 | Charlotte, DC). |
| 78 | |
| 79 | Pending (need your accounts or are later checklist items): |
| 80 | |
| 81 | - Provision Supabase and fill env (step 2). |
| 82 | - RLS policies (allow-all, role-shaped) on the tables. |
| 83 | - Auth screens and session wiring into the tRPC context. |
| 84 | - City picker, events surface, post forms, directories, comments UI. |
| 85 | - PWA manifest + service worker, Vercel deploy. |
| 86 | |
| 87 | See `STEPPING_APP_IMPLEMENTATION_PLAN.md` for the full plan and roadmap. |