Running Supamode Locally
Start Supamode's development servers and Supabase, seed demo data, and configure your own database tables.
This guide covers starting Supamode locally, seeding demo data to explore the interface, and connecting your own Supabase project.
Quick Start
Start both servers in parallel (requires two terminal windows):
Terminal 1: Start Supabase
pnpm run supabase:web:startTerminal 2: Start development servers
pnpm devOpen http://localhost:5173 and sign in with:
- Email:
root@supamode.com - Password:
testingpassword
Demo Data Required
The demo credentials only work after seeding the database. See Step 3 below.
Step-by-Step Setup
1. Start the Development Servers
Run the dev command to start both the frontend and backend:
pnpm devThis starts:
| Service | URL | Technology |
|---|---|---|
| Frontend | http://localhost:5173 | Vite + React Router 7 |
| API | http://localhost:3000 | Hono.js |
Vite proxies all /api/* requests to the Hono backend automatically, so the frontend can make API calls without CORS configuration.
2. Start Supabase
Ensure Docker is running, then start the Supabase containers:
pnpm run supabase:web:startSupamode uses non-standard ports to avoid conflicts with your main application's Supabase instance:
| Service | URL | Purpose |
|---|---|---|
| Supabase API | http://localhost:54331 | REST and Realtime APIs |
| PostgreSQL | localhost:54332 | Direct database access |
| Supabase Studio | http://localhost:54333 | Database admin UI |
| InBucket | http://localhost:54334 | Email testing |
3. Seed Demo Data
To explore Supamode with sample data, run the demo schema installation. Open Supabase Studio at http://localhost:54333, go to the SQL Editor, and run:
call supamode.install_demo_schema();This creates:
- Sample tables (
posts,categories,tags, etc.) - Four user accounts with different permission levels
- Pre-configured roles and permissions
- Sample data to browse and edit
4. Sign In
After seeding, sign in at http://localhost:5173 with one of these accounts:
| Role | Password | Permissions | |
|---|---|---|---|
| Root | root@supamode.com | testingpassword | Full access to everything |
| Admin | admin@supamode.com | testingpassword | System administration |
| Member | member@supamode.com | testingpassword | Data read/write |
| Read-only | readonly@supamode.com | testingpassword | View only |
Try signing in with different roles to see how the RBAC system restricts access. The read-only user, for example, cannot edit records or access settings.
Using Your Own Data
Once you've explored the demo, connect Supamode to your own Supabase project.
Option A: Local Development (Supabase Emulator)
If your project also uses the Supabase emulator locally, point Supamode to your project's ports.
In apps/app/.env:
VITE_SUPABASE_URL=http://localhost:54321In apps/api/.env:
SUPABASE_URL=http://localhost:54321SUPABASE_DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgresThen add your migrations to apps/app/supabase/seeds/ so they run when Supamode's database resets.
Option B: Remote Supabase Project
To connect to a hosted Supabase project:
In apps/app/.env:
VITE_SUPABASE_URL=https://YOUR_PROJECT.supabase.coVITE_SUPABASE_ANON_KEY=your-anon-keyIn apps/api/.env:
SUPABASE_URL=https://YOUR_PROJECT.supabase.coSUPABASE_ANON_KEY=your-anon-keySERVICE_ROLE_KEY=your-service-role-keySUPABASE_DATABASE_URL=postgresql://postgres:PASSWORD@db.YOUR_PROJECT.supabase.co:5432/postgresSync Your Tables
After connecting to your database, sync your tables into Supamode's metadata system:
-- Sync all tables in a schemaselect supamode.sync_managed_tables('public');-- Or sync specific tablesselect supamode.sync_managed_tables('public', 'users');select supamode.sync_managed_tables('public', 'orders');select supamode.sync_managed_tables('public', 'products');-- Sync tables from custom schemasselect supamode.sync_managed_tables('billing', 'invoices');select supamode.sync_managed_tables('billing', 'subscriptions');Permissions Required
The demo seed only grants permissions to the public schema. For custom schemas, configure permissions before your team can access them.
Reset the Database
After adding your migrations and sync commands, reset to apply them:
pnpm run supabase:web:resetThis drops and recreates the database, runs all migrations, and executes seed files in order.
Development Commands
Common commands for local development:
| Command | Purpose |
|---|---|
pnpm dev | Start frontend and API servers |
pnpm supabase:web:start | Start Supabase containers |
pnpm supabase:web:stop | Stop Supabase containers |
pnpm supabase:web:reset | Reset database and run seeds |
pnpm supabase:web:typegen | Generate TypeScript types from schema |
pnpm lint:fix | Fix linting issues |
pnpm typecheck | Run TypeScript compiler checks |
pnpm test:unit | Run unit tests |
Troubleshooting
"Invalid login credentials"
The demo accounts only exist after running the seed. Ensure you ran:
call supamode.install_demo_schema();Port Already in Use
If port 5173 or 3000 is busy, check for running processes:
lsof -i :5173lsof -i :3000Kill the process or change Supamode's ports in the Vite and Hono configs.
Supabase Won't Start
Docker must be running. On macOS/Windows, ensure Docker Desktop is open. On Linux:
sudo systemctl start dockerIf containers are stuck, try a fresh start:
pnpm supabase:web:stopdocker system prune -fpnpm supabase:web:startChanges Not Reflecting
Vite uses hot module replacement, but some changes (especially to API routes) require a restart:
# Stop servers with Ctrl+C, then restartpnpm devFor database schema changes, reset the database:
pnpm supabase:web:resetNext Steps
- Configure tables to customize display names and formats
- Set up RBAC to define roles and permissions
- Explore the Data Explorer to learn navigation and filtering
- Deploy to production when ready