Local Development
Complete guide for setting up and running the application locally with Docker-based Supabase.
A complete guide for setting up and running the application locally with Docker-based Supabase.
Prerequisites Installation (New Computer)
1. Install Git
Windows:
- Download from https://git-scm.com/download/win
- Run installer, use default options
- Restart terminal
Mac:
xcode-select --install
Verify:
git --version
2. Install Node.js (v20.10.0+)
Recommended: Use nvm (Node Version Manager)
Windows:
- Download nvm-windows from https://github.com/coreybutler/nvm-windows/releases
- Run
nvm-setup.exe - Restart terminal
- Install Node:
nvm install 20 nvm use 20
Mac/Linux:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash # Restart terminal, then: nvm install 20 nvm use 20
Verify:
node --version # Should be >= 20.10.0
3. Install pnpm (v10.19.0+)
After Node.js is installed:
corepack enable corepack prepare pnpm@10.19.0 --activate
Or install directly:
npm install -g pnpm@10.19.0
Verify:
pnpm --version # Should be >= 10.19.0
4. Install Docker Desktop
Windows:
- Download from https://www.docker.com/products/docker-desktop/
- Run installer
- Restart computer
- Launch Docker Desktop
- Wait for it to fully start (whale icon in system tray stops animating)
Mac:
- Download from https://www.docker.com/products/docker-desktop/
- Drag to Applications
- Launch Docker Desktop
- Wait for it to fully start
Verify:
docker --version docker ps # Should work without errors
Note (Windows): You may need to enable WSL 2. Docker Desktop will prompt you if needed.
5. Install VS Code
VS Code works on Windows, Mac, and Linux.
- Download from https://code.visualstudio.com/
- Run installer
- Install recommended extensions when prompted after opening the project
6. Install Claude Code (AI Assistant)
Claude Code is an AI-powered CLI tool that helps with development.
Install via npm:
npm install -g @anthropic-ai/claude-code
Verify:
claude --version
First run setup:
claude
This will prompt you to authenticate with your Anthropic account.
Usage:
# Start Claude in your project directory cd eminentid-monorepo claude # Or open directly in VS Code terminal
Note: Requires an Anthropic account. Sign up at https://console.anthropic.com/
Verify All Prerequisites
Run these commands to confirm everything is installed:
git --version # Should return version info node --version # Should be >= 20.10.0 pnpm --version # Should be >= 10.19.0 docker --version # Should return version info docker ps # Should work without errors (Docker running) claude --version # Should return version info (optional but recommended)
All commands should succeed before proceeding.
Step 1: Clone the Repository
git clone https://github.com/SioInc/eminentid-monorepo.git cd eminentid-monorepo
Step 2: Install Dependencies
pnpm install
This installs all dependencies across the monorepo.
Step 3: Set Up Environment Variables
Generate environment files using the built-in generator:
pnpm env:generate
Or manually copy the example file:
cp apps/web/.env.example apps/web/.env.local
Required Local Variables
Update apps/web/.env.local with these values for local development:
# Supabase Local (Docker) NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321 NEXT_PUBLIC_SUPABASE_PUBLIC_KEY=<your-local-anon-key> SUPABASE_SECRET_KEY=<your-local-service-role-key> # Application NEXT_PUBLIC_SITE_URL=http://localhost:3000
Note: The local Supabase keys are printed when you start Supabase (Step 4).
Step 4: Start Supabase (Docker)
Make sure Docker Desktop is running, then:
pnpm supabase:web:start
This will:
- Pull required Docker images (first run only)
- Start PostgreSQL database
- Start Supabase services (Auth, Storage, etc.)
- Apply all migrations from
apps/web/supabase/migrations/ - Run seed data if
apps/web/supabase/seed.sqlexists
First Run Output
On first run, you'll see output like:
Started supabase local development setup.
API URL: http://localhost:54321
GraphQL URL: http://localhost:54321/graphql/v1
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
anon key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
service_role key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Copy the anon key and service_role key into your .env.local file:
anon key→NEXT_PUBLIC_SUPABASE_PUBLIC_KEYservice_role key→SUPABASE_SECRET_KEY
Step 5: Start the Development Server
pnpm dev
This starts all apps in the monorepo in development mode.
Step 6: Access the Application
| Service | URL |
|---|---|
| Application | http://localhost:3000 |
| Supabase Studio | http://localhost:54323 |
| Email Testing (Inbucket) | http://localhost:54324 |
| Supabase API | http://localhost:54321 |
Step 7: Create Your First User
- Navigate to http://localhost:3000/auth/sign-up
- Enter an email and password
- Check http://localhost:54324 (Inbucket) for the confirmation email
- Click the confirmation link
- You're logged in!
Common Commands Reference
Development
| Command | Description |
|---|---|
pnpm dev | Start all apps in dev mode |
pnpm build | Build all apps |
pnpm typecheck | Run TypeScript type checking |
pnpm lint:fix | Lint and auto-fix issues |
pnpm format:fix | Format code with Prettier |
Supabase
| Command | Description |
|---|---|
pnpm supabase:web:start | Start local Supabase |
pnpm supabase:web:stop | Stop local Supabase |
pnpm supabase:web:reset | Reset DB and reapply migrations |
pnpm supabase:web:typegen | Generate TypeScript types from DB schema |
Database Migrations
| Command | Description |
|---|---|
pnpm --filter web supabase migrations new <name> | Create a new migration |
pnpm --filter web supabase migrations up | Apply pending migrations |
Other
| Command | Description |
|---|---|
pnpm env:generate | Generate environment files |
pnpm env:validate | Validate environment variables |
pnpm stripe:listen | Start Stripe webhook listener |
Troubleshooting
Docker Not Running
Error: Cannot connect to the Docker daemon
Fix: Start Docker Desktop and wait for it to fully initialize.
Port Already in Use
Error: Port 3000 is already in use
Fix (Windows):
netstat -ano | findstr :3000 taskkill /PID <PID> /F
Fix (Mac/Linux):
lsof -i :3000 kill -9 <PID>
Supabase Won't Start
# Stop everything pnpm supabase:web:stop # Clean Docker (removes unused containers/images) docker system prune -a # Start fresh pnpm supabase:web:start
Database Connection Error
# Ensure Docker is running docker ps # Reset Supabase completely pnpm supabase:web:reset
Migrations Out of Sync
If your local DB is out of sync with migrations:
# This wipes the DB and reapplies all migrations pnpm supabase:web:reset
Missing Environment Variables
Error: Please provide the variable NEXT_PUBLIC_SUPABASE_URL
Fix: Run pnpm env:generate or manually create apps/web/.env.local with required variables.
Types Out of Date
After changing the database schema:
pnpm supabase:web:typegen
Workflow: Making Database Changes
Create a migration:
pnpm --filter web supabase migrations new my_change
Edit the SQL file in
apps/web/supabase/migrations/Apply the migration:
pnpm --filter web supabase migrations up
Regenerate types:
pnpm supabase:web:typegen
Test locally, then push to
developmentbranch
Environment Overview
| Environment | Database | URL |
|---|---|---|
| Local | Docker Supabase | localhost:3000 |
| Staging | Free-tier Supabase | eminentid-monorepo-git-development-*.vercel.app |
| Production | Pro Supabase | eminentid.vercel.app |
See the Preview Environments guide for staging/production workflow.
Quick Start Checklist
- Node.js 20.10.0+ installed
- pnpm 10.19.0+ installed
- Docker Desktop installed and running
- Repository cloned
pnpm installcompleted.env.localconfigured with local Supabase keyspnpm supabase:web:startsuccessfulpnpm devrunning- http://localhost:3000 loads
- http://localhost:54323 (Supabase Studio) accessible