Skip to content

Development Setup

Greeniac edited this page Nov 22, 2025 · 1 revision

Development Setup

This guide will help you set up your development environment for FairMind.

Prerequisites

  • Node.js: v18+ (we use bun but Node.js works too)
  • Python: 3.10+ (for backend)
  • Git: Latest version
  • Database: PostgreSQL (or use Docker)

Quick Start

1. Clone the Repository

git clone https://github.com/adhit-r/fairmind.git
cd fairmind

2. Frontend Setup

cd apps/frontend-new
bun install  # or npm install
bun dev      # or npm run dev

Frontend will be available at http://localhost:1111

3. Backend Setup

cd apps/backend
uv venv  # Create virtual environment
source venv/bin/activate  # or venv\Scripts\activate on Windows
uv pip install -r requirements.txt
python main.py

Backend will be available at http://localhost:8000

Project Structure

fairmind/
├── apps/
│   ├── frontend-new/    # Next.js frontend
│   ├── backend/         # FastAPI backend
│   └── ml/              # ML models and scripts
├── docs/                # Documentation
└── archive/             # Archived files

Development Tools

Frontend

  • Framework: Next.js 14+
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Package Manager: Bun (or npm)

Backend

  • Framework: FastAPI
  • Language: Python 3.10+
  • Package Manager: uv (or pip)

Running Tests

Frontend Tests

cd apps/frontend-new
bun test

Backend Tests

cd apps/backend
pytest

E2E Tests

cd apps/frontend-new
bun test:e2e

Environment Variables

Create .env files in respective directories:

Frontend (.env.local)

NEXT_PUBLIC_API_URL=http://localhost:8000

Backend (.env)

DATABASE_URL=postgresql://user:password@localhost/fairmind
SECRET_KEY=your-secret-key

Common Issues

Port Already in Use

  • Change port in next.config.js or main.py
  • Or kill the process using the port

Database Connection

  • Make sure PostgreSQL is running
  • Check DATABASE_URL in .env
  • Run migrations if needed

Dependencies

  • Delete node_modules and reinstall
  • Clear cache: bun pm cache rm or npm cache clean

Getting Help

  • Check existing issues
  • Ask in GitHub Discussions
  • Review documentation in docs/ folder

Next Steps