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, andlogga-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:
cd logga-backend
cp .env.example .envThe documented default is PostgreSQL on localhost:5432.
2. Start PostgreSQL
cd logga-backend
docker compose up -d db3. Install dependencies and migrate
cd logga-backend
npm install
npm run db:migrate4. Seed the workspace
cd logga-backend
npm run db:seedThe 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
cd logga-backend
npm run devBy default the API listens on http://localhost:3000.
Dashboard
The dashboard is a Next.js app in logga-frontend.
1. Install dependencies
cd logga-frontend
pnpm install2. Point the dashboard at the backend
The frontend API client defaults to http://localhost:3000, but it can be overridden with:
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000There is also an optional access gate for invite-only flows:
DASHBOARD_ACCESS_PASSWORD=temporary-password3. Start the frontend
cd logga-frontend
pnpm devCommon local URLs:
- marketing or landing entry:
http://localhost:3000or 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_URLvalue in the appInfo.plist
For local development:
http://localhost:3000Open the Xcode project under:
logga-app/logga/logga.xcodeprojRecommended Startup Order
- Start Postgres.
- Start the backend.
- Start the dashboard.
- 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:
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.