Start Here

Local Development

Local setup for the backend, dashboard, and iOS app.

This page describes the current local development flow across the backend, dashboard, and iOS app.

Prerequisites

  • Node.js 20+ for the backend and dashboard
  • Docker and Docker Compose for PostgreSQL
  • Xcode for the iOS app
  • A local checkout of this workspace with logga-backend, logga-frontend, and logga-app

Backend

The backend is the anchor service for the rest of the stack. Start it first.

1. Prepare environment variables

The backend README expects a local env file:

bash
cd logga-backend
cp .env.example .env

The documented default is PostgreSQL on localhost:5432.

2. Start PostgreSQL

bash
cd logga-backend
docker compose up -d db

3. Install dependencies and migrate

bash
cd logga-backend
npm install
npm run db:migrate

4. Seed the workspace

bash
cd logga-backend
npm run db:seed

The seed currently creates:

  • workspace: Test Workspace
  • production project: Test Project
  • test user: [email protected]
  • test password: logga1234
  • test API key: lg_sk_test_1234567890
  • starter channels: payments, auth, system
  • starter rules and sample events

5. Run the backend

bash
cd logga-backend
npm run dev

By default the API listens on http://localhost:3000.

Dashboard

The dashboard is a Next.js app in logga-frontend.

1. Install dependencies

bash
cd logga-frontend
pnpm install

2. Point the dashboard at the backend

The frontend API client defaults to http://localhost:3000, but it can be overridden with:

bash
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000

There is also an optional access gate for invite-only flows:

bash
DASHBOARD_ACCESS_PASSWORD=temporary-password

3. Start the frontend

bash
cd logga-frontend
pnpm dev

Common local URLs:

  • marketing or landing entry: http://localhost:3000 or the Next-assigned port
  • access gate: /access
  • login: /login
  • dashboard root: /app
  • docs site added by this work: /docs

iOS App

The native app uses Config.baseURL and falls back to https://api.logga.sh unless overridden.

You can point it to local backend infrastructure in one of two ways:

  • set the runtime environment variable LOGGA_API_BASE_URL
  • set the API_BASE_URL value in the app Info.plist

For local development:

text
http://localhost:3000

Open the Xcode project under:

text
logga-app/logga/logga.xcodeproj
  1. Start Postgres.
  2. Start the backend.
  3. Start the dashboard.
  4. Open the iOS app if the change touches native flows.

This keeps all clients pointed at the same local API surface.

Smoke Test

After the backend is seeded, this request should ingest an event:

bash
curl -X POST http://localhost:3000/v1/events \
  -H "Authorization: Bearer lg_sk_test_1234567890" \
  -H "Content-Type: application/json" \
  -d '{
    "channel": "payments",
    "event": "invoice_sent",
    "level": "success",
    "metadata": { "amount": 49 }
  }'

Troubleshooting

Backend starts but dashboard cannot authenticate

Check that NEXT_PUBLIC_API_BASE_URL points to the same backend port you actually started.

Frontend and backend both want port 3000

The backend defaults to 3000. If the dashboard is also trying to use 3000, change one of them and keep NEXT_PUBLIC_API_BASE_URL aligned.

iOS app still talks to production

If the app continues to hit https://api.logga.sh, verify that LOGGA_API_BASE_URL or API_BASE_URL is actually set for the active scheme.