Skip to content

Latest commit

 

History

History
90 lines (58 loc) · 1.68 KB

File metadata and controls

90 lines (58 loc) · 1.68 KB

Development

Getting started

Prerequisites

  • Node.js 22+
  • pnpm
  • Docker

1. Install dependencies

pnpm install

2. Configure environment

cp .env.example .env

Fill in your Google OAuth credentials (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET). Get these from Google Cloud Console — add http://localhost:3000/api/auth/callback/google as an authorized redirect URI.

3. Start the app

pnpm db:migrate
pnpm dev

This starts Postgres in Docker, the API server on :3000, and SvelteKit on :5173 (proxies /api to server).

Adding shadcn-svelte components

We use shadcn-svelte. To add a new component:

cd client
pnpm dlx shadcn-svelte@latest add <component-name>

Components are installed to src/lib/components/ui/<component-name>/.

Running scripts (development only)

From the repo root:

cd server
npx tsx src/scripts/sync-accounts.ts list <email>

Other scripts live under server/src/scripts/ and can be run the same way: npx tsx src/scripts/<script-name>.ts <args>.

Testing

Vitest

From the repo root:

cd server
pnpm vitest run

Run tests matching a filename:

pnpm vitest run billing

Run a specific test by name with -t "pattern":

pnpm vitest run -t "blocks mutation queries"

Stripe testing

  1. Install the Stripe CLI.
  2. Login: stripe login
  3. Forward webhooks to the local server:
stripe listen --forward-to localhost:3000/api/stripe/webhook
  1. Copy the webhook signing secret (whsec_...) into your .env as STRIPE_WEBHOOK_SECRET.