Recogito Server
Supabase-based backend with PostgreSQL database, authentication, and storage. Runs locally via Supabase CLI.
This guide walks you through setting up a complete local development environment for Recogito Studio. Unlike the self-hosting guide which covers production deployment, this setup is optimized for development and testing.
A local development environment consists of three main components:
Recogito Server
Supabase-based backend with PostgreSQL database, authentication, and storage. Runs locally via Supabase CLI.
Recogito Client
Astro/React frontend application for the user interface. Runs on localhost:4321.
Config Tool
Web-based configuration management tool for policies, roles, and branding. Runs on localhost:5173.
http://localhost:54321localhost:54322http://localhost:54323http://localhost:54324http://localhost:4322 (may vary if port is in use)http://localhost:5173 (optional)Before starting, ensure you have the following installed:
macOS:
brew install supabase/tap/supabaseLinux:
brew install supabase/tap/supabaseWindows:
scoop bucket add supabase https://github.com/supabase/scoop-bucket.gitscoop install supabaseVerify installation:
supabase --versionDownload and install Docker Desktop for your platform.
Verify Docker is running:
docker --versionClone the recogito-server repository
git clone https://github.com/recogito/recogito-server.gitcd recogito-serverStart Supabase locally
supabase startThis command will:
Note the output, especially:
API URL: http://localhost:54321DB URL: postgresql://postgres:postgres@localhost:54322/postgresStudio URL: http://localhost:54323anon key: Your anonymous API keyservice_role key: Your service role keyRun database migrations
supabase db resetThis will:
Install server dependencies
npm installThis installs the packages needed for setup scripts.
Create environment file
cp .env.example .envnano .envUpdate the following values:
SUPABASE_HOST=http://localhost:54321SUPABASE_SERVICE_KEY=<service_role_key from step 2>
# Test user passwords (all using same password for simplicity)ORG_ADMIN_PW=password123PROFESSOR_PW=password123STUDENT_PW=password123TUTOR_PW=password123READER_PW=password123INVITE_PW=password123
# Group IDs from default configORG_ADMIN_GROUP_ID='350abe76-937b-4a9b-9600-9b1f856db250'PROFESSOR_GROUP_ID='f918b2f8-f587-4ee1-9f2d-35b3aed0b1e6'STUDENT_GROUP_ID='f2e37e37-3b36-4833-b88d-f58e5c018ef5'TUTOR_GROUP_ID='f2e37e37-3b36-4833-b88d-f58e5c018ef5'READER_GROUP_ID='f2e37e37-3b36-4833-b88d-f58e5c018ef5'Populate database with roles and groups
export SUPABASE_HOST=http://localhost:54321export SUPABASE_SERVICE_KEY=<service_role_key from step 2>node create-default-groups.js -f config.jsonCreate test users and run tests
Recogito Server has a number of Jest tests that are in the jest/tests/projects.test.ts file. These tests verify some base functionality.
To simplify the process going forward, modify the run_tests.sh file to be executable:
chmod +x run_tests.shThen execute the tests from the root directory of the repository:
./run_tests.shThe test script will create a number of test users that you can use locally to access the client and test fuctionality.
This creates test accounts for development:
professor@example.com → Org Professor (can create projects)student@example.com → Org Readers (read-only)tutor@example.com → Org Readers (read-only)reader@example.com → Org Readers (read-only)invited@example.com → Org Readers (read-only)Verify Supabase Studio
Open http://localhost:54323 in your browser. You should see:
Clone the recogito-config repository
cd ..git clone https://github.com/recogito/recogito-config.gitcd recogito-configInstall dependencies
npm installCreate environment file
Create a .env file:
VITE_SERVICE_KEY=<service_role_key from Supabase start>Start the config tool
npm run devThe config tool will be available at http://localhost:5173
Generate configuration file
dafault-config.json (from the repo)config.json fileClone the recogito-client repository
cd ..git clone https://github.com/recogito/recogito-client.gitcd recogito-clientSwitch to Node adapter for local development
mv astro.config.mjs astro.config.netlify.mjsmv astro.config.node.mjs astro.config.mjsInstall dependencies
npm installCreate environment file
cp .env.example .envnano .envUpdate with your local Supabase values:
# Supabase connectionPUBLIC_SUPABASE=http://127.0.0.1:54321PUBLIC_SUPABASE_API_KEY=<anon_key from step 2>SUPABASE_SERVICE_KEY=<service_role_key from step 2>
# IIIF Configuration (optional - can use defaults for basic setup)PUBLIC_IIIF_CONFIGURATION="IIIF_CLOUD"
# Room secret for realtime featuresROOM_SECRET=local-dev-room-secret-change-in-production
# IIIF Server (can leave as examples for basic local dev)IIIF_URL=http://www.example.com/iiif/public/resourcesIIIF_KEY=your-iiif-server-api-keyIIIF_PROJECT_ID=iiif-project-uuid-for-this-app
# Mail - Using local Mailpit (available at http://127.0.0.1:54324)MAIL_HOST=127.0.0.1MAIL_PORT=1025MAIL_USERNAME=MAIL_PASSWORD=MAIL_FROM_ADDRESS=noreply@recogito.local
# Optional featuresPUBLIC_ENABLE_USER_INVITE=TRUEDeploy configuration file (optional)
The client repository includes a default src/config.json that works for basic setup. You can use it as-is, or:
Copy the config.json you generated with the config tool:
cp /path/to/downloaded/config.json src/config.jsonOr use the default from the server repo:
cp ../recogito-server/config.json src/config.jsonStart the development server
npm run devThe client will be available at http://localhost:4322 (or 4321 if that port is free).
Access the application
professor@example.compassword123professor@example.compassword123/en/projectspostgresql://postgres:postgres@localhost:54322/postgrescd recogito-serversupabase db diff -f <migration_name>supabase db resetconfig.jsonrecogito-client/src/config.jsonFor server-side database tests:
cd recogito-server/jestnpm testIssue: Sign-in page loads but shows only branding/header/footer, no login form. Browser console shows errors like “Failed to load module script” or “DEFINES is not defined”
Cause: Using Netlify adapter instead of Node adapter
Solution:
cd recogito-clientmv astro.config.mjs astro.config.netlify.mjsmv astro.config.node.mjs astro.config.mjsrm -rf node_modules/.vite .astronpm run devIssue: Error “Cannot read properties of undefined (reading ‘id’)” when running create-test-users.js
Cause: Database doesn’t have roles and groups yet
Solution:
Run create-default-groups.js BEFORE create-test-users.js:
cd recogito-serverexport SUPABASE_HOST=http://localhost:54321export SUPABASE_SERVICE_KEY=<your-service-key>node create-default-groups.js -f config.jsonnode create-test-users.js -f config.jsonIssue: Login fails with correct test user email
Cause: Test users exist from previous session with different passwords
Solution: Reset the database completely:
cd recogito-serversupabase db resetnode create-default-groups.js -f config.jsonnode create-test-users.js -f config.jsonnode assign-test-user-groups.js -f config.jsonOr update passwords for existing users via Supabase Studio (http://localhost:54323) → Authentication → Users.
Issue: Docker containers fail to start
Solutions:
supabase stop then supabase start againIssue: API errors or authentication failures
Solutions:
PUBLIC_SUPABASE=http://127.0.0.1:54321 and PUBLIC_SUPABASE_API_KEY in .envsupabase statussupabase start outputIssue: No tables in Supabase Studio
Solutions:
supabase db reset from the recogito-server directoryIssue: Browser console shows WebSocket connection to ‘ws://127.0.0.1:54321/realtime/v1/websocket’ failed
Impact: Non-blocking - application works normally
Solution: This warning can be ignored for basic local development. It relates to realtime collaboration features and doesn’t affect core functionality like login, project creation, or annotation.
Client:
# Press Ctrl+C in the terminal running npm run devConfig Tool (if running):
# Press Ctrl+C in the terminal running npm run devSupabase:
cd recogito-serversupabase stopSupabase:
cd recogito-serversupabase startClient:
cd recogito-clientnpm run devcd recogito-serversupabase db resetexport SUPABASE_HOST=http://localhost:54321export SUPABASE_SERVICE_KEY=<your-service-key>node create-default-groups.js -f config.jsonnode create-test-users.js -f config.jsonnode assign-test-user-groups.js -f config.jsonUse Supabase Studio (http://localhost:54323):
Supabase logs:
cd recogito-serversupabase logsClient logs:
Check the terminal running npm start or browser console
cd recogito-serversupabase db dump -f backup.sqlcd recogito-serversupabase db resetpsql postgresql://postgres:postgres@localhost:54322/postgres < backup.sql