Skip to main content

Quick Start Guide

Get your Eli Health development environment up and running in just a few minutes.

Prerequisites

Prerequisites: Make sure you have Node.js 18+, Python 3.9+, and Docker installed on your machine.

1. Clone the Repositories

Set up your workspace

mkdir eli-health-workspace
cd eli-health-workspace

Clone all repositories

# Main application repositories
git clone git@github.com:eli-health/eli-app.git
git clone git@github.com:eli-health/eli-backend-api.git
git clone git@github.com:eli-health/eli_hae_api.git
git clone git@github.com:eli-health/eli-kpi.git
git clone git@github.com:eli-health/eli-devops.git

Verify the structure

ls -la
# Should show: eli-app, eli-backend-api, eli_hae_api, eli-kpi, eli-devops

2. Environment Setup

Backend API

cd eli-backend-api/packages/backend

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.development
# Edit .env.development with your configuration

# Start the development server
npm run start:dev

The backend API will be available at http://localhost:3000

Mobile App

cd eli-app/packages/mobile-app

# Install dependencies
npm install

# iOS setup (macOS only)
cd ios && pod install && cd ..

# Start Metro bundler
npm start

# In a new terminal, run on iOS
npm run ios

# Or run on Android
npm run android

HAE API

cd eli_hae_api

# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Start the API server
python -m src.main

The HAE API will be available at http://localhost:8000

KPI Analytics

cd eli-kpi

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run analytics scripts
python scripts/daily_report.py

3. Database Setup

Start PostgreSQL

Using Docker:

docker run --name eli-postgres \
-e POSTGRES_DB=eli_health_dev \
-e POSTGRES_USER=eli \
-e POSTGRES_PASSWORD=dev_password \
-p 5432:5432 \
-d postgres:15

Run Database Migrations

cd eli-backend-api/packages/backend
npm run migration:run

Seed Test Data

npm run seed:dev

4. Infrastructure (Optional)

For full infrastructure setup with Terraform:

Terraform Infrastructure Setup

Configure Google Cloud

# Install Google Cloud CLI
# Authenticate
gcloud auth login
gcloud config set project eli-health-dev

Deploy Infrastructure

cd eli-devops/tf

# Initialize Terraform
TMPDIR=~/terraform_tmp terraform init -backend-config=development.gcs.tfbackend

# Plan deployment
TMPDIR=~/terraform_tmp terraform plan -var-file=development.tfvars

# Apply (be careful!)
TMPDIR=~/terraform_tmp terraform apply -var-file=development.tfvars -auto-approve

5. Verify Everything Works

Test API Endpoints

# Health check
curl http://localhost:3000/health

# User registration
curl -X POST http://localhost:3000/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"testpass123"}'

Test Mobile App

  • Open the mobile app on iOS/Android simulator
  • Try registering a new user
  • Navigate through the main screens
  • Take a test measurement (if camera available)

Test HAE API

# Image analysis endpoint
curl -X POST http://localhost:8000/analyze \
-F "image=@test_image.jpg" \
-F "measurement_type=cortisol"

Common Development Tasks

🔧 API Development

# Add new API endpoint
cd eli-backend-api/packages/backend
npm run generate:module -- measurements

# Run tests
npm test

# Debug mode
npm run start:debug

📱 Mobile Development

# Clean build
cd eli-app/packages/mobile-app
npm run clean

# Update dependencies
npm run update-deps

# Release build
npm run build:release

🧬 ML Development

# Train new model
cd eli_hae_api
python scripts/train_model.py

# Test inference
python scripts/test_inference.py

# Export model
python scripts/export_model.py

📊 Analytics

# Generate reports
cd eli-kpi
python scripts/weekly_report.py

# Update dashboards
python scripts/update_dashboards.py

# Data validation
python scripts/validate_data.py

Troubleshooting

Port Already in Use

# Find process using port 3000
lsof -i :3000

# Kill the process
kill -9 <PID>

Database Connection Failed

  • Check if PostgreSQL is running: docker ps
  • Verify connection string in .env.development
  • Check if database exists: psql -h localhost -U eli -d eli_health_dev

Mobile App Build Failed

# Clean Metro cache
npx react-native start --reset-cache

# Clean iOS build (macOS)
cd ios && xcodebuild clean && cd ..

# Clean Android build
cd android && ./gradlew clean && cd ..

Python Dependencies Issues

# Recreate virtual environment
rm -rf venv
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

Next Steps

Development Resources

  • Slack Channel: #eli-health-dev
  • API Documentation: http://localhost:3000/docs (when running)
  • Code Style Guide: Follow ESLint/Prettier configurations
  • Git Workflow: Feature branches with PR reviews required
Pro Tip

Use the VS Code workspace configuration in .vscode/eli-health.code-workspace for the best development experience!