Skip to content

Local Development Setup

Prerequisites

  • macOS, Linux, or Windows with WSL2
  • Docker Desktop
  • Python 3.12+
  • Node.js 20+
  • AWS CLI
  • Terraform 1.7+
  • 1Password access (credentials in the shared vault)

Steps

1. Clone

git clone git@github.com:construo-io/platform.git
cd platform

2. Install dependencies

cd apps/api
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
cd apps/web
npm install

3. Start local services

docker compose up -d

Verify:

docker ps
# Expect: platform-postgres, platform-redis

4. Migrate and seed

cd apps/api
alembic upgrade head
python -m src.core.seed_dev

Seeds two test tenants (acme, beta) with fixture data.

5. Environment variables

cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env

Values are in 1Password under Construo — Shared → Local Dev Credentials.

6. Run

# Terminal 1
cd apps/api && uvicorn src.main:app --reload

# Terminal 2
cd apps/web && npm run dev

7. Verify

Add to /etc/hosts:

127.0.0.1 acme.local.test beta.local.test
  • http://acme.local.test:5173 — log in as alice@acme.test
  • http://beta.local.test:5173 — log in as bob@beta.test

Confirm the data is isolated between tenants.

Troubleshooting

Postgres port conflict

Port 5432 is in use by another Postgres instance. Stop it or change the port in docker-compose.yml.

Alembic migration fails

Check Docker is running. Confirm DATABASE_URL in .env matches docker-compose.yml.

Frontend CORS error

BACKEND_CORS_ORIGINS in apps/api/.env must include http://acme.local.test:5173.

Tenant not found

/etc/hosts is not set. The middleware reads the subdomain from the Host header — localhost won't resolve to a tenant.