This tutorial walks you through setting up CHRIS for local development.
Prerequisites
Before you begin, ensure you have:
- Node.js 18 or higher (install with nvm)
- npm 9 or higher (comes with Node.js)
- Git for version control
- A Supabase account and project
Step 1: Clone the Repository
git clone https://github.com/your-org/godisnji-odmor-tracker.git
cd godisnji-odmor-tracker
Step 2: Install Dependencies
npm install
This installs all required packages including React, TypeScript, shadcn/ui, and Supabase client.
Step 3: Configure Environment Variables
Create a .env file in the project root:
cp .env.example .env
Edit .env with your Supabase credentials:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
!!! tip "Finding Your Supabase Credentials" 1. Go to your Supabase Dashboard 2. Select your project 3. Navigate to Settings > API 4. Copy the Project URL and anon public key
Step 4: Set Up the Database
If starting fresh, apply the database migrations:
npx supabase db push --linked
This creates all required tables: profiles, teams, leave_requests, translations, etc.
Step 5: Start Development Server
npm run dev
The application will start at http://localhost:8080 (or the next available port).
!!! success "You're Ready!" Open your browser and navigate to the URL shown in the terminal.
What's Next?
Now that you have CHRIS running locally:
- Submit your first leave request as an employee
- Set up the admin configuration if you're an administrator
- Explore the How-To Guides for specific tasks
Troubleshooting
Port Already in Use
If port 8080 is occupied, Vite automatically uses the next available port:
Port 8080 is in use, trying another one...
VITE ready in 184 ms
Local: http://localhost:8081/
Supabase Connection Issues
If you see authentication errors:
- Verify your
.envfile has correct credentials - Check that your Supabase project is active
- Ensure RLS (Row Level Security) policies are configured
Missing Translations
If text appears as translation keys (e.g., common.save):
- Ensure the
translationstable is populated - Run any pending migrations:
npx supabase db push --linked