You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ce/local-development/backend.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Backend (orchestrator) local setup
2
+
title: Orchestrator local setup
3
3
---
4
4
5
5
The backend serves orchestration APIs, GitHub app endpoints, and internal APIs the UI relies on.
@@ -51,7 +51,7 @@ The backend serves orchestration APIs, GitHub app endpoints, and internal APIs t
51
51
52
52
## GitHub app integration
53
53
54
-
- For a quick install link, set `ORCHESTRATOR_GITHUB_APP_URL` in `ui/.env.local` to your app’s install URL (`https://github.com/apps/<app>/installations/new`).
54
+
- For a quick install link, set `ORCHESTRATOR_GITHUB_APP_URL` in `ui/.env.local` to your app's install URL (`https://github.com/apps/<app>/installations/new`).
55
55
- To create a new app via the backend, open `http://localhost:3000/github/setup` (requires `HOSTNAME` set to a reachable URL for callbacks).
After creating the app, use its install URL (e.g., `https://github.com/apps/<app-name>/installations/new`) as `ORCHESTRATOR_GITHUB_APP_URL` in `ui/.env.local`. This drives the "Connect with GitHub" button.
23
+
24
+
## Creating an app via the backend wizard
25
+
26
+
- Open `http://localhost:3000/github/setup` (or the backend's public URL) to generate a manifest and create the app in GitHub. Needed envs on backend: `HOSTNAME` set to a reachable URL, and optional `GITHUB_ORG` if you want to scope to an org.
27
+
- Once created, copy the install URL into `ORCHESTRATOR_GITHUB_APP_URL` and restart the UI.
28
+
29
+
## Troubleshooting
30
+
31
+
-**404 on connect**: `ORCHESTRATOR_GITHUB_APP_URL` not set or points to a non-existent path.
32
+
-**Callbacks fail**: UI not exposed publicly; tunnel the UI port and update callback/webhook URLs to that domain.
33
+
-**Backend rejects /api/github/link**: ensure `DIGGER_ENABLE_API_ENDPOINTS=true` and `DIGGER_INTERNAL_SECRET` matches the UI `ORCHESTRATOR_BACKEND_SECRET`.
Copy file name to clipboardExpand all lines: docs/ce/local-development/overview.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ This section explains how to run the three core services locally:
6
6
7
7
-**Backend** (`backend/`, port 3000 by default) – orchestrator + REST APIs for repos/orgs/jobs.
8
8
-**Statesman** (`taco/cmd/statesman`, port 8080) – state storage API and Terraform Cloud-compatible endpoints.
9
-
-**UI** (`ui/`, port 3030) – TanStack Start frontend that talks to both services and WorkOS.
9
+
-**UI** (`ui/`, port 3030) – TanStack Start frontend that talks to both services and WorkOS. When tunneling (e.g., ngrok), expose the UI host; WorkOS and GitHub callbacks should point to the UI domain.
10
10
11
11
## Prerequisites
12
12
@@ -23,17 +23,17 @@ This section explains how to run the three core services locally:
23
23
24
24
## High-level workflow
25
25
26
-
1)**Start backend** with internal + API endpoints enabled (so UI can call `/api/*` and `/github/*`).
27
-
2)**Start statesman** with internal endpoints enabled; use memory storage for quick start.
28
-
3)**Configure UI**`.env.local` with URLs + secrets + WorkOS creds; run `pnpm dev --host --port 3030`.
29
-
4)**Sync org/user** into backend and statesman (WorkOS org id and user id/email) via the provided curl snippets in each page.
30
-
5) (Optional) **GitHub App**: set `ORCHESTRATOR_GITHUB_APP_URL` to your install URL or `http://localhost:3000/github/setup` to create one via the backend.
26
+
1)**Start backend** with internal + API endpoints enabled (so UI can call `/api/*` and `/github/*`).
27
+
2)**Start statesman** with internal endpoints enabled; use memory storage for quick start.
28
+
3)**Configure UI**`.env.local` with URLs + secrets + WorkOS creds; run `pnpm dev --host --port 3030`.
29
+
4)**Sync org/user** into backend and statesman (WorkOS org id and user id/email) via the provided curl snippets in each page.
30
+
5) (Optional) **GitHub App**: set `ORCHESTRATOR_GITHUB_APP_URL` to your install URL or `http://localhost:3000/github/setup` to create one via the backend. Use the UI domain for app callback/webhook URLs (see GitHub App settings page).
31
31
32
32
## Troubleshooting cheatsheet
33
33
34
-
-**Backend /api/* returns 404**: `DIGGER_ENABLE_API_ENDPOINTS` not `true` or org not upserted.
If you don't have Atlas installed: `make atlas-install`
22
+
7
23
## Quick start
8
24
9
25
1. Set env vars:
@@ -24,6 +40,15 @@ Statesman serves state storage + Terraform Cloud-compatible APIs. The UI uses it
24
40
25
41
Statesman resolves orgs by `external_org_id` (your WorkOS org id). If it cannot resolve, `/internal/api/units` will 500.
26
42
43
+
A helper script is available at `taco/cmd/statesman/sync-org.sh` - edit the values before running:
44
+
45
+
```bash
46
+
chmod +x taco/cmd/statesman/sync-org.sh
47
+
./taco/cmd/statesman/sync-org.sh
48
+
```
49
+
50
+
Or run manually:
51
+
27
52
```bash
28
53
SECRET=$OPENTACO_ENABLE_INTERNAL_ENDPOINTS
29
54
ORG_ID=org_xxx # WorkOS org id
@@ -49,6 +74,8 @@ curl -s -X POST http://localhost:8080/internal/api/users \
49
74
50
75
## Troubleshooting
51
76
77
+
-**"no such table: organizations"**: Run migrations first (see First-time setup above).
78
+
-**Atlas checksum mismatch**: Run `atlas migrate hash --dir file://migrations/sqlite` then retry apply.
52
79
-**403**: webhook secret mismatch (`OPENTACO_ENABLE_INTERNAL_ENDPOINTS` vs UI `STATESMAN_BACKEND_WEBHOOK_SECRET`).
53
-
-**404/500 resolving org**: org not synced; rerun the `orgs/sync` call above.
80
+
-**404/500 resolving org**: org not synced; rerun the sync script or `orgs/sync` call above.
54
81
-**SQLite quirks**: defaults to SQLite in-process; no config needed for local. For Postgres/MySQL, set `TACO_QUERY_BACKEND` and related envs (see `docs/ce/state-management/query-backend`).
Copy file name to clipboardExpand all lines: docs/ce/local-development/ui.mdx
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,21 @@
2
2
title: UI local setup
3
3
---
4
4
5
-
The UI is a TanStack Start app that authenticates via WorkOS and calls both backend and statesman.
5
+
The UI is a TanStack Start app that authenticates via WorkOS and calls both backend and statesman. It also acts as the public gateway when tunneling (e.g., ngrok): expose the UI port, and point external callbacks to the UI domain.
6
6
7
7
## Quick start
8
8
9
9
1. Copy `.env.example` to `.env.local` in `ui/` and fill the essentials:
10
10
```bash
11
11
# URLs
12
-
PUBLIC_URL=http://localhost:3030
13
-
ALLOWED_HOSTS=localhost,127.0.0.1
12
+
PUBLIC_URL=http://localhost:3030# replace host with your public tunnel when exposing UI
13
+
ALLOWED_HOSTS=localhost,127.0.0.1# include your public tunnel host here
WORKOS_REDIRECT_URI=http://localhost:3030/api/auth/callback# replace host with your public tunnel; must match WorkOS config
20
20
WORKOS_WEBHOOK_SECRET=<if using webhooks locally via tunnel>
21
21
22
22
# Backend
@@ -40,7 +40,7 @@ The UI is a TanStack Start app that authenticates via WorkOS and calls both back
40
40
pnpm install # or npm install
41
41
pnpm dev --host --port 3030
42
42
```
43
-
Open `http://localhost:3030` and sign in with a WorkOS user that belongs to at least one org.
43
+
Open `http://localhost:3030`(or your tunnel URL) and sign in with a WorkOS user that belongs to at least one org. Ensure the WorkOS redirect URI matches the public URL you configured.
44
44
3. Ensure backend + statesman were started and the same secrets are in place (see [Backend](./backend) and [Statesman](./statesman)).
45
45
4. Sync the WorkOS org/user to both services using the curl snippets on those pages (required for repos/units to load).
46
46
@@ -49,3 +49,4 @@ The UI is a TanStack Start app that authenticates via WorkOS and calls both back
49
49
-**NotFound/Forbidden listing units**: statesman org/user not synced or webhook secret mismatch.
50
50
-**404 on repos or GitHub connect**: backend missing org/user, `DIGGER_ENABLE_API_ENDPOINTS` not set, or `ORCHESTRATOR_GITHUB_APP_URL` points to a non-existent path.
51
51
-**WorkOS login succeeds but dashboard redirects to / or errors**: the signed-in user has no WorkOS org membership; add to an org and resync to services.
52
+
-**WorkOS redirect blocked**: public URL not whitelisted; add your tunnel host to `ALLOWED_HOSTS` and to the WorkOS redirect URI list.
0 commit comments