Installation
Prerequisites
Section titled “Prerequisites”Before you begin, make sure you have the following installed:
| Tool | Version | Purpose |
|---|---|---|
| Rust | 1.75+ | Backend compilation |
| Node.js | 20+ | Frontend dev server |
| Supabase CLI | 1.x | Local Supabase (PostgreSQL) |
| Docker | 24+ | Ollama and optional services |
| Ollama | latest | Local models and embeddings |
1. Clone the repository
Section titled “1. Clone the repository”git clone https://github.com/CITIUS-iRiA-eRisk/demo-inside-the-lab.gitcd demo-inside-the-lab2. Start Supabase
Section titled “2. Start Supabase”The local Supabase instance provides PostgreSQL (with pgvector) and the Auth service.
supabase startThis 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
3. Configure environment variables
Section titled “3. Configure environment variables”Create a .env file in the backend/ directory:
DATABASE_URL=postgres://postgres:postgres@localhost:54322/postgresSUPABASE_JWT_SECRET=<your-jwt-secret-from-supabase-start>BASE_PATH=/chattyOLLAMA_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:
PUBLIC_BASE_PATH=/chattyPUBLIC_SUPABASE_URL=http://localhost:54321PUBLIC_SUPABASE_ANON_KEY=<your-anon-key-from-supabase-start>See the Configuration reference for all available variables.
4. Pull an Ollama embedding model
Section titled “4. Pull an Ollama embedding model”If you want semantic context search, pull the embedding model:
ollama pull nomic-embed-textYou can also pull chat models to use through Ollama:
ollama pull llama3ollama pull mistral5. Start the backend
Section titled “5. Start the backend”cd backendcargo runThe 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:5000INFO Base path: /chattyINFO Connected to databaseINFO Registered Ollama modelsINFO Total models registered: 3INFO Listening on 0.0.0.0:50006. Start the frontend
Section titled “6. Start the frontend”In a separate terminal:
cd frontendnpm installnpm run devThe frontend dev server starts on http://localhost:5173 by default (Vite).
7. Open the application
Section titled “7. Open the application”Navigate to http://localhost:5173/chatty in your browser. You will be redirected to the Google OAuth login page.
Development workflow
Section titled “Development workflow”After the initial setup, your typical workflow is:
supabase start(if not already running)ollama serve(if not already running)cd backend && cargo runcd 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).