Skip to main content

Prerequisites

Before you begin, install the following tools:

Node.js 20+

Sintesis targets the Node.js LTS release. Use nvm or fnm to manage versions.

pnpm

The project uses pnpm as its package manager. Install with npm install -g pnpm.

Docker Desktop

The local Supabase stack runs inside Docker containers. Docker Desktop must be running before you start Supabase.

Supabase CLI

Manages local migrations and the local Supabase stack. Install with brew install supabase/tap/supabase or npx supabase.
The Supabase CLI is also available as a dev dependency (supabase@^2.76.8) in this project. All pnpm supabase:* scripts invoke it directly through the local binary, so a global install is optional.

Step-by-step setup

1

Clone the repository

git clone https://github.com/ignacioLiotti/gec.git
cd gec
2

Install dependencies

pnpm install
3

Copy environment variables

cp env.example .env.local
The env.example file already contains the correct NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY values for the local stack. You do not need to change them for basic development.See Environment variables for a full description of every variable.
4

Start the local Supabase stack

Make sure Docker Desktop is running, then:
pnpm supabase:start
This starts Postgres, the Auth server, Storage, Realtime, and the Supabase Studio UI. On first run it also applies all migrations from supabase/migrations/ in sequence and seeds the database with supabase/seed.sql.
5

Verify the stack is running

pnpm supabase:status
Expected output:
supabase local development setup is running.

     API URL: http://localhost:54321
      DB URL: postgresql://postgres:postgres@localhost:54322/postgres
  Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
  JWT secret: super-secret-jwt-token-with-at-least-32-characters-long
    anon key: eyJhbG...
service_role key: eyJhbG...
6

Start the Next.js development server

pnpm dev
Open http://localhost:3000 to see the application. The server uses Turbopack and hot-reloads on file changes.

Default local ports

ServicePortURL
Next.js app3000http://localhost:3000
Supabase API (REST)54321http://localhost:54321
Postgres database54322postgresql://postgres:postgres@localhost:54322/postgres
Supabase Studio54323http://localhost:54323
Inbucket (email testing)54324http://localhost:54324

Managing the local stack

# Stop the Supabase stack (preserves data)
pnpm supabase:stop

# Reset the database (drops everything, re-runs migrations + seed)
pnpm db:reset

# Push pending migrations to remote Supabase
pnpm db:push:remote

Creating a local admin user

After the stack is running you need a user account to sign in to the app.
1

Create a user in Supabase Studio

Open http://localhost:54323 and go to Authentication → Users → Add user. Enter an email and password.Alternatively, sign up through the app at http://localhost:3000/auth/sign-up.
2

Assign the user to the default tenant

Open the Supabase Studio SQL editor and run:
insert into public.memberships (tenant_id, user_id, role)
values (
  '00000000-0000-0000-0000-000000000001',
  (select id from auth.users where email = '[email protected]'),
  'owner'
)
on conflict (tenant_id, user_id) do nothing;
Replace [email protected] with the email you registered.
3

Grant superadmin access (optional)

To grant a user superadmin access — which bypasses all RLS checks and gives ownership over every tenant — run:
update public.profiles
set is_superadmin = true
where user_id = (select id from auth.users where email = '[email protected]');
Superadmin users bypass all Row Level Security policies. Only grant this to trusted developers on local environments.

Running tests

Unit and integration tests

Sintesis uses Vitest for unit and integration tests.
# Run all tests once
pnpm test

# Watch mode — re-runs tests on file changes
pnpm test:watch

End-to-end tests

End-to-end tests use Playwright.
# Run all e2e tests headlessly
pnpm test:e2e

# Open the Playwright UI for interactive debugging
pnpm test:e2e:ui
Playwright tests expect the Next.js dev server and local Supabase stack to already be running on their default ports before you execute pnpm test:e2e.

Troubleshooting

pnpm supabase:start will fail with an error like Cannot connect to the Docker daemon. Open Docker Desktop and wait for it to finish starting before retrying.
If port 54321, 54322, or 3000 is already occupied, stop whatever is using it or customise the ports in supabase/config.toml (for Supabase) or set PORT in your environment (for Next.js).To find what is using a port:
# macOS / Linux
lsof -i :54321

# Windows
netstat -ano | findstr :54321
If a migration throws an error, the stack will stop. Check the output for the failing migration file name. You can inspect the migration SQL in supabase/migrations/ and apply a fix, then run pnpm db:reset to replay from scratch.
By default the local Supabase Auth instance does not require email confirmation. If you see a confirmation prompt, go to Supabase Studio → Authentication → Users, find the user, and click Send magic link or manually set the email_confirmed_at column:
update auth.users
set email_confirmed_at = now()
where email = '[email protected]';
If you sign in but see no data, your user likely has no membership row for any tenant. Run the SQL from Creating a local admin user to add them to the default tenant.
The first run pulls several Docker images (Postgres, Kong, GoTrue, etc.). This can take several minutes on a slow connection. Subsequent starts are much faster because images are cached locally.
Sentry source map upload is only active on Vercel production builds (VERCEL=1 and VERCEL_ENV=production). Local builds skip the Sentry webpack plugin entirely. If you see Sentry-related errors locally, ensure SENTRY_DSN is either empty or unset in .env.local.

Build docs developers (and LLMs) love