Developer Setup

This guide provides a step-by-step path to setting up the full Intelligence for Good (i4g) stack: Backend (Core), Frontend (UI), and Infrastructure.

Prerequisites

  • Git

  • Python 3.11+ (Conda recommended)

  • Node.js 20+ & PNPM 9

  • Docker (Optional, for containerized runs)

  • Google Cloud SDK (Optional, for infra deployment)

1. Repository Setup

The project is organized as a multi-root workspace. We recommend cloning all repositories into a single parent directory (e.g., ~/work/i4g/).

mkdir i4g && cd i4g
git clone https://github.com/intelligenceforgood/core.git
git clone https://github.com/intelligenceforgood/ui.git
git clone https://github.com/intelligenceforgood/infra.git
git clone https://github.com/intelligenceforgood/docs.git
git clone https://github.com/intelligenceforgood/planning.git

2. Backend Setup (Core)

The core repository contains the Core API backend and worker jobs.

  1. Navigate to Core: cd core

  2. Create Environment:

  3. Install Dependencies:

  4. Seed Local Data:

  5. Run the API:

    • API will be available at http://127.0.0.1:8000.

    • Docs at http://127.0.0.1:8000/docs.

See core/README.mdarrow-up-right for detailed instructions.

3. Frontend Setup (UI)

The ui repository contains the Next.js analyst console.

  1. Navigate to UI: cd ../ui

  2. Install Dependencies:

  3. Configure Environment:

  4. Run Development Server:

    • UI will be available at http://localhost:3000.

See ui/README.mdarrow-up-right for detailed instructions.

4. Infrastructure (Optional)

If you need to deploy to Google Cloud or manage cloud resources:

  1. Navigate to Infra: cd ../infra

  2. Authenticate:

  3. Initialize Terraform:

See infra/README.mdarrow-up-right for detailed instructions.

Troubleshooting

  • CORS Errors: Ensure API_URL in ui/apps/web/.env.local matches the running Core API URL.

  • Missing Data: Rerun the i4g bootstrap local reset command in core.

Last updated