National Commerce Docs

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-commerce

2. Install dependencies

pnpm install

pnpm 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-key

The 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 pull

supabase db pull copies the remote schema to your machine.

Run the app

Start every app in the monorepo:

pnpm dev

Or start only the web app:

cd apps/web && pnpm dev

The 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 typecheck

Lint one file

Biome lints fast when you target one file:

npx biome check --write apps/web/components/file.tsx

Never lint the whole repo at once

Global Biome commands such as pnpm lint time out. Always lint file by file.

Build the app

pnpm build

If the build runs out of memory, raise the limit:

NODE_OPTIONS="--max-old-space-size=8192" pnpm build

Generate database types

Regenerate the TypeScript types after you change the schema:

npx supabase gen types typescript --project-id axzbddunsdtgjpnycprb > packages/supabase/src/types/supabase.ts

Always import types from packages/supabase/src/types/supabase.ts. Never use the any type.

Where to go next

On this page