Installation Guide
This guide covers how to install and set up Lakra for your organization or local development.
Note
Most end users won’t need this guide - your administrator will set up Lakra for you. This guide is for administrators and developers setting up new instances.
Prerequisites
Before installing Lakra, ensure you have:
Node.js 18+: Download from nodejs.org
Package Manager: npm, yarn, or bun
Supabase Account: Sign up at supabase.com (free tier available)
Git: For cloning the repository
Installation Steps
1. Clone the Repository
git clone <repository-url>
cd lakra
2. Install Dependencies
Using npm:
npm install
Using yarn:
yarn install
Using bun:
bun install
3. Set Up Supabase
Create a Supabase Project
Go to supabase.com
Sign in or create an account
Click “New Project”
Fill in project details:
Name: Choose a name (e.g., “lakra-production”)
Database Password: Create a strong password
Region: Select the closest region to your users
Click “Create new project”
Get Your Project Credentials
Go to Project Settings → API
Copy the following:
Project URL (shown under “Project URL”)
Anon/Public Key (shown under “Project API keys”)
4. Configure Environment Variables
Create a .env file in the project root:
# Create .env file
touch .env
Add the following content (replace with your actual values):
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
Example:
VITE_SUPABASE_URL=https://abcdefghijklmnop.supabase.co
VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Warning
Never commit your .env file to version control. It’s already included in .gitignore.
5. Set Up the Database
Run SQL Migrations
In your Supabase project dashboard:
Navigate to SQL Editor
Create the following tables and configurations:
Users Table:
-- See technical manual for complete schema
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
email TEXT UNIQUE NOT NULL,
username TEXT UNIQUE,
role TEXT NOT NULL CHECK (role IN ('admin', 'annotator', 'evaluator')),
created_at TIMESTAMPTZ DEFAULT NOW()
-- Add other columns as per schema
);
Note
For the complete database schema and all tables, see the Database Schema in the Technical Manual.
Configure Row Level Security (RLS)
Enable RLS on all tables:
ALTER TABLE users ENABLE ROW LEVEL SECURITY;
ALTER TABLE sentences ENABLE ROW LEVEL SECURITY;
ALTER TABLE annotations ENABLE ROW LEVEL SECURITY;
-- Continue for all tables
Create security policies:
-- Example: Users can read their own profile
CREATE POLICY "Users can view own profile"
ON users FOR SELECT
USING (auth.uid() = id);
Tip
Refer to the Development Guide for complete RLS policies.
Configure Authentication
Go to Authentication → Settings
Configure allowed authentication methods:
Enable Email authentication
Set Site URL to your application URL
Configure Redirect URLs if needed
6. Configure Storage (for Voice Recordings)
Go to Storage in Supabase dashboard
Create a new bucket:
Name:
voice-recordingsPublic: unchecked (private bucket)
Set up storage policies for authenticated uploads
7. Start the Development Server
npm run dev
The application will start at http://localhost:5173
8. Create Your First Admin User
Since you need an admin account to create other users:
Go to Authentication → Users in Supabase
Click “Add user”
Enter email and password
After creation, update the user in the
userstable:
UPDATE users
SET role = 'admin'
WHERE email = 'your-admin@example.com';
9. Access the Application
Open your browser to
http://localhost:5173Sign in with your admin credentials
Access the admin panel to:
Create additional users
Add sentences for annotation
Configure system settings
Verification
After installation, verify everything works:
Application loads in browser
Can sign in with admin account
Admin dashboard displays correctly
Can create test users
Can add test sentences
Authentication persists across page refreshes
Production Deployment
For production deployment, see the Deployment Guide in the Technical Manual.
Quick Production Checklist
Build production bundle:
npm run buildDeploy to hosting service (Vercel, Netlify, etc.)
Configure production environment variables
Set up custom domain
Configure HTTPS
Set up proper RLS policies in Supabase
Configure authentication redirect URLs
Test all features in production
Troubleshooting
Common Issues
“Failed to fetch” errors:
Check if Supabase URL and anon key are correct
Verify Supabase project is active
Check CORS settings in Supabase
Authentication not working:
Verify email auth is enabled in Supabase
Check Site URL and Redirect URLs configuration
Clear browser cache and cookies
Database connection errors:
Verify row-level security policies are set
Check that tables exist in Supabase
Ensure user has proper permissions
Getting Help
Check Supabase dashboard logs
Review browser console for errors
See the FAQ for common questions
Consult the Development Guide
Next Steps
Create user accounts for your team
Import sentences via CSV (see Admin Guide)
Configure onboarding tests
Start annotating and evaluating!