A template monorepo for a stack with
Ensure you have Node.js v20.9 or newer installed and Corepack enabled + Docker installed.
-
Install dependencies.
pnpm install
-
Start local Supabase stack.
pnpm supabase start
-
Navigate to the buckets page in the local Supabase Studio (
http://127.0.0.1:54323/project/default/storage/buckets) and create a new bucket namedpayloadwith default settings. -
Copy
.env.local-exampleas.env.localand fill inS3_ACCESS_KEY_IDS3_SECRET_ACCESS_KEYSUPABASE_JWT_SECRETNEXT_PUBLIC_SUPABASE_ANON_KEY
based on values printed by
pnpm supabase status, andNEXT_PUBLIC_GOOGLE_CLIENT_ID
with your Google OAuth 2.0 client ID (for Sign in with Google).
-
Start Next.js dev server.
pnpm nx dev nextjs-app
-
Navigate to
http://localhost:3000/adminwith your web browser and follow the instructions on screen to create a local test admin user.
| Script | Description | Simple equivalent |
|---|---|---|
pnpm typecheck |
Type-check with TypeScript | tsc --noEmit |
pnpm lint |
Lint with ESLint | eslint . |
pnpm fix |
Fix auto-fixable problems with ESLint | eslint --fix . |
pnpm prettier |
Check formatting with Prettier | prettier . |
pnpm format |
Format with Prettier | prettier --write . |
pnpm lp |
Lint and check formatting | pnpm lint; pnpm prettier |
pnpm tlp |
Type-check, lint and run Prettier (check formatting) | pnpm typecheck; pnpm lint; pnpm prettier |
pnpm ff |
Fix and format | pnpm fix; pnpm format |
pnpm tff |
Type-check, fix and format | pnpm typecheck; pnpm fix; pnpm format |
-
Tasks are run through Nx which enables
- parallelization
- advanced caching
- only running the tasks on affected code
which makes running the scripts much faster
-
The "combo" / "chained" scripts (
lp,tlp,ff,tff) forward arguments to each subtask- see
scripts/{typecheck-,}{lint-and-prettier,fix-and-format}.bash
- see
-
Type-check, fix and format projects affected by uncommitted and untracked changes
pnpm tff -
Type-check, fix and format all projects
pnpm tff:all -
Lint and check formatting for projects affected by committed, uncommitted and untracked changes compared to
origin/mainpnpm lp --base=origin/main -
Type-check projects affected by committed changes when comparing
origin/maintoHEADpnpm typecheck --base=origin/main --head=HEAD
For more information about available arguments see nx affected documentation.