Skip to content

Installation

Before you begin, make sure you have the following installed:

ToolVersionPurpose
Rust1.75+Backend compilation
Node.js20+Frontend dev server
Supabase CLI1.xLocal Supabase (PostgreSQL)
Docker24+Ollama and optional services
OllamalatestLocal models and embeddings
Terminal window
git clone https://github.com/CITIUS-iRiA-eRisk/demo-inside-the-lab.git
cd demo-inside-the-lab

The local Supabase instance provides PostgreSQL (with pgvector) and the Auth service.

Terminal window
supabase start

This command starts the database on port 54322 and the Auth API on port 54321. On first run, it automatically applies all migrations from supabase/migrations/.

After startup, note the output values — you will need:

  • API URL (typically http://localhost:54321)
  • anon key
  • JWT secret

Create a .env file in the backend/ directory:

backend/.env
DATABASE_URL=postgres://postgres:postgres@localhost:54322/postgres
SUPABASE_JWT_SECRET=<your-jwt-secret-from-supabase-start>
BASE_PATH=/chatty
OLLAMA_HOST=http://localhost:11434
# Add any API keys you have (all optional)
OPENAI_KEY=sk-...
MISTRAL_KEY=...
GEMINI_KEY=...

Create a .env file in the frontend/ directory:

frontend/.env
PUBLIC_BASE_PATH=/chatty
PUBLIC_SUPABASE_URL=http://localhost:54321
PUBLIC_SUPABASE_ANON_KEY=<your-anon-key-from-supabase-start>

See the Configuration reference for all available variables.

If you want semantic context search, pull the embedding model:

Terminal window
ollama pull nomic-embed-text

You can also pull chat models to use through Ollama:

Terminal window
ollama pull llama3
ollama pull mistral
Terminal window
cd backend
cargo run

The backend starts on http://0.0.0.0:5000 by default. It automatically discovers any running Ollama models and registers configured cloud providers.

You should see output like:

INFO Starting Chatty backend on 0.0.0.0:5000
INFO Base path: /chatty
INFO Connected to database
INFO Registered Ollama models
INFO Total models registered: 3
INFO Listening on 0.0.0.0:5000

In a separate terminal:

Terminal window
cd frontend
npm install
npm run dev

The frontend dev server starts on http://localhost:5173 by default (Vite).

Navigate to http://localhost:5173/chatty in your browser. You will be redirected to the Google OAuth login page.

After the initial setup, your typical workflow is:

  1. supabase start (if not already running)
  2. ollama serve (if not already running)
  3. cd backend && cargo run
  4. cd frontend && npm run dev

The frontend hot-reloads on changes. The backend requires a restart after Rust code changes (consider cargo-watch for auto-restart).