Skip to main content

Development Setup

Get your development environment ready for working on Veritect AI.

Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+
  • PostgreSQL 14+
  • Elasticsearch 8.x
  • Redis 6+
  • Git

Repository Setup

1. Clone Repositories

# Frontend
git clone git@github.com:veritect-ai/frontend.git
cd frontend
npm install

# Backend API
git clone git@github.com:veritect-ai/api.git
cd api
npm install

# ML Services
git clone git@github.com:veritect-ai/ml-services.git
cd ml-services
pip install -r requirements.txt

2. Environment Configuration

Create .env files in each repository:

# Frontend (.env.local)
REACT_APP_API_URL=http://localhost:4000
REACT_APP_AUTH_DOMAIN=dev.veritect.ai

# Backend (.env)
DATABASE_URL=postgresql://user:pass@localhost/veritect_dev
REDIS_URL=redis://localhost:6379
ELASTICSEARCH_URL=http://localhost:9200
JWT_SECRET=your-dev-secret

3. Database Setup

# Create database
createdb veritect_dev

# Run migrations
cd api
npm run db:migrate

# Seed development data
npm run db:seed

Running Services

# From project root
docker-compose up -d

# Services will be available at:
# Frontend: http://localhost:3000
# API: http://localhost:4000
# Elasticsearch: http://localhost:9200
# Redis: http://localhost:6379

Manual Setup

# Terminal 1 - Frontend
cd frontend
npm start

# Terminal 2 - Backend
cd api
npm run dev

# Terminal 3 - ML Services
cd ml-services
python app.py

IDE Setup

VS Code

  • Install recommended extensions
  • Use workspace settings
  • Configure ESLint and Prettier

IntelliJ IDEA

  • Import project settings
  • Configure code style
  • Set up database connections

Development Workflow

  1. Branch Naming

    • feature/JIRA-123-description
    • bugfix/JIRA-456-description
    • hotfix/critical-issue
  2. Commit Messages

    type(scope): subject

    Body (optional)

    Closes: JIRA-123
  3. Code Review

    • Create PR against develop
    • Require 2 approvals
    • Pass all CI checks

Testing

# Frontend tests
cd frontend
npm test
npm run test:e2e

# Backend tests
cd api
npm test
npm run test:integration

# ML Services tests
cd ml-services
pytest

Troubleshooting

Common Issues

  1. Database Connection Failed

    • Check PostgreSQL is running
    • Verify credentials in .env
    • Check database exists
  2. Elasticsearch Errors

    • Ensure ES is running
    • Check cluster health
    • Verify index mappings
  3. Build Failures

    • Clear node_modules
    • Check Node version
    • Review error logs

Support

  • Dev Channel: #dev-help on Slack
  • Wiki: You're here!
  • Senior Devs: Schedule pairing session