Getting Started
Set up the National Commerce web app locally and run it.
This page helps developers run the web app on their own machine. It covers the tools you need, the setup steps, and the daily commands.
Who this page is for
This page targets developers. Business analysts and clients can skip to the feature guides.
What you need first
Install these tools before you start:
- Node.js 18 or newer — runs the app.
- pnpm 8 or newer — installs packages and runs scripts.
- Supabase CLI — manages the database and generates types.
- Git — clones the code.
Set up the project
1. Clone the repository
git clone https://github.com/supportkings/national-commerce.git
cd national-commerce2. Install dependencies
pnpm installpnpm installs every workspace at once. The repo uses Turborepo to link the apps and packages together.
3. Add environment variables
Create apps/web/.env.local and set your Supabase keys:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-keyThe app reads these keys to reach the database and sign users in.
4. Connect Supabase
Link your local checkout to the Supabase project:
supabase login
supabase link --project-ref axzbddunsdtgjpnycprb
supabase db pullsupabase db pull copies the remote schema to your machine.
Run the app
Start every app in the monorepo:
pnpm devOr start only the web app:
cd apps/web && pnpm devThe web app runs on Next.js with Turbopack. Open the printed local URL to view it.
Daily commands
Use these commands as you work.
Check types
cd apps/web && pnpm typecheckLint one file
Biome lints fast when you target one file:
npx biome check --write apps/web/components/file.tsxNever lint the whole repo at once
Global Biome commands such as pnpm lint time out. Always lint file by
file.
Build the app
pnpm buildIf the build runs out of memory, raise the limit:
NODE_OPTIONS="--max-old-space-size=8192" pnpm buildGenerate database types
Regenerate the TypeScript types after you change the schema:
npx supabase gen types typescript --project-id axzbddunsdtgjpnycprb > packages/supabase/src/types/supabase.tsAlways import types from packages/supabase/src/types/supabase.ts. Never use
the any type.
Where to go next
- Read Architecture to learn how the code fits together.
- Read the feature guides to learn what each screen does.