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 locally via Vite.
Config Tool
Optional web-based configuration management tool for policies, roles, and branding. Runs locally via Vite.
Before starting, ensure you have the following installed:
There may be some additional requirements depending on how you intend to use your local setup.
recogito-server)Clone the recogito-server repository
git clone https://github.com/recogito/recogito-server.gitcd recogito-serverStart Supabase locally
Ensure Docker Desktop is running. Then:
supabase startThis command will:
Note the output, especially:
API URL: Local Supabase API accessDatabase URL: Postgres databaseStudio URL: Supabase Studio, which allows local DB/auth/storage management through a GUIPublishable key or anon key: Your anonymous API keySecret key or service_role key: Your service role keyRun database migrations
supabase db resetThis will:
(Optional) Generate a custom configuration with the config tool
To use the config tool, clone the repository from GitHub and install and run with NPM:
cd ..git clone https://github.com/recogito/recogito-config.gitcd recogito-confignpm installCopy the environment variables example file and populate with your own Supabase values:
cp .env.example .envnano .envVITE_SUPABASE_API_URL=<API URL from supabase start>VITE_SUPABASE_SERVICE_KEY=<secret key from supabase start>Then start the config tool:
npm startThis will serve the config tool from localhost:5174.
For more details on the available options, see the Configuration Tool Reference →.
Install dependencies and configure environment
From the root of the recogito-server repo, run:
npm installThis installs the packages needed for setup scripts. Then, prepare environment variables:
cp .env.example .envnano .envUpdate the following values:
SUPABASE_HOST=API URL from step 2SUPABASE_SERVICE_KEY=secret key from step 2
# Test user passwords (all can use the same password for simplicity)ORG_ADMIN_PW=passwordPROFESSOR_PW=passwordSTUDENT_PW=passwordTUTOR_PW=passwordREADER_PW=passwordINVITE_PW=passwordYou can leave the group IDs alone if you skipped step 4, or based your configuration on the default-config.json. If you created custom groups, these values must be populated by UUIDs of Organization Groups.
Populate database with roles and groups
Run the following commands to populate the databse with default groups, roles, users, etc.
node create-default-groups.js -f config.jsonnode create-test-users.js -f config.jsonrecogito-client)Install the application
Clone the recogito-client repository:
cd ..git clone https://github.com/recogito/recogito-client.gitcd recogito-clientAnd install with NPM:
npm installCreate environment file
cp .env.example .envnano .envUpdate with your local values:
############################################################################### # Public variables # (Variables beginning with PUBLIC_ are exposed to both server and client) ###############################################################################
# Supabase connection PUBLIC_SUPABASE="https://your-project.supabase.co" PUBLIC_SUPABASE_API_KEY="your-anonymous-key"
# IIIF (image server) configuration PUBLIC_IIIF_CONFIGURATION="IIIF_CLOUD" # or "SUPABASE_CANTALOUPE" # PUBLIC_IIIF_CANTALOUPE_PATH="/iiif" # uncomment if using SUPABASE_CANTALOUPE
# Optional – Enable email/password invites from the UI # When TRUE, Org Admins can invite email/password users from the User Management UI PUBLIC_ENABLE_USER_INVITE=TRUE
# Optional - Usersnap feedback form # PUBLIC_USERSNAP_GLOBAL_API_KEY="usersnap-global-api-key" # PUBLIC_USERSNAP_PROJECT_API_KEY="usersnap-project-api-key"
# Optional – External help/FAQ page # PUBLIC_HELP_REDIRECT="https://help.example.com"
############################################################################### # Server-only secrets # (Never exposed to browser) ###############################################################################
# Secret 'salt' to compute the realtime room identifiers ROOM_SECRET="your-room-secret"
# Secret service key for server-side Supabase clients SUPABASE_SERVICE_KEY="your-supabase-service-key"
# Optional: Server-only Supabase URL. # Use this if your Astro server runs in an environment where it must reach # Supabase using a different URL (e.g. internal/private network, Docker, VPC). # If not set, PUBLIC_SUPABASE is used for both server and client. # SUPABASE_SERVERCLIENT_URL="http://supabase:8000"
############################################################################### # Trigger.dev (Background jobs, import/export, NER plugin) ############################################################################### TRIGGER_SECRET_KEY=<your secret key> TRIGGER_SERVER_URL=http://localhost:3040/ # TASK_PAYLOAD_OFFLOAD_THRESHOLD=5242880
############################################################################### # IIIF Cloud (image server) configuration ############################################################################### IIIF_URL="http://www.example.com/iiif/public/resources" IIIF_KEY=<your iiif cloud api key> IIIF_PROJECT_ID=<iiif cloud project uuid for this app>
############################################################################### # Email - Used for transactional emails: invites, notifications, etc. ############################################################################### MAIL_HOST=<your email host> MAIL_PORT=<your email port> MAIL_USERNAME=<your email username> MAIL_PASSWORD=<your email password> MAIL_FROM_ADDRESS=<the from address for emails> # Base64-encoded 256-bit key (e.g. generated with: openssl rand -base64 32) INVITE_CRYPTO_KEY=<base64 encoded 256-bit cryptographic key>Deploy 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 startThe client will be available at http://localhost:4321 (or another port if that port is in use).
Access the application
admin@example.compassword (or whatever you set in Phase 1 step 5 for ORG_ADMIN_PW)If you would like to build and run the application as a standalone service, using Node, run:
npm run build-nodeThen you may start the service using:
node ./dist/server/entry.mjsThis will use the Node adapter for Astro (astro.config.node.mjs). Building with npm run build
instead will use the Netlify adapter (via astro.config.mjs), meaning the build output may only be usable on Netlify.
cd 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.jsonUse Supabase Studio (typically http://localhost:54323):
Then, log in as an Org Admin, and navigate to the profile menu (top right) → Users. From there you can assign the new user to a group.
cd recogito-serversupabase db diff -f <migration_name>supabase migration up