Skip to content

The only tool you need to know what is happening and how to fix it.

docs: correct backend entry point (#301)

FrameAutomatac3243c0152c2
diff --git a/CLAUDE.md b/CLAUDE.md
index 42f783ee..9706b370 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -27,12 +27,14 @@ Traceway is an error tracking and monitoring platform consisting of:
| Frontend | `cd frontend && npm run dev` | Dev server (port 5173) |
| Frontend | `npm run build` | Production build |
| Frontend | `npm run check` | TypeScript checking |
-| Backend | `cd backend && go run .` | API server (port 8082) |
+| Backend | `cd backend && go run ./cmd/traceway` | API server (port 8082) |
| CLI | `cd cli && just build` | Builds `bin/traceway` |
| CLI | `cd cli && just test` | Runs unit tests |
| CLI | `cd cli && just check` | Lint + test + vulncheck (pre-commit gate) |
| CLI | `cd cli && just smoke-test` | Live E2E (needs `TRACEWAY_SMOKE_*` env vars) |
+Set `JWT_SECRET` (min 32 characters) before running the backend — it is the one variable with no default. `SQLITE_PATH` sets the database location, defaulting to `./traceway.db` in the working directory.
+
### Tech Stack
- **Frontend**: SvelteKit 2.49, Svelte 5.45, Tailwind CSS v4, shadcn-svelte, Vite 7
- **Backend**: Go 1.25, Gin 1.11, ClickHouse, PostgreSQL
@@ -544,7 +546,11 @@ Uses shadcn-svelte registry with bits-ui primitives. Key components:
### Project Structure
```
backend/
-├── main.go # Entry point, DB init, server start
+├── traceway.go # package tracewaybackend - embeddable API (Run, WithPort, ...)
+├── cmd/
+│ ├── run.go # Run() implementation: DB init, routes, server start
+│ ├── traceway/main.go # Binary entry point (package main)
+│ └── traceway-runner/ # Synthetics remote runner binary
├── app/
│ ├── controllers/
│ │ ├── routes.go # Route registration
diff --git a/scripts/build-oxc-shim.sh b/scripts/build-oxc-shim.sh
index 95dea7e4..0d3af3f3 100755
--- a/scripts/build-oxc-shim.sh
+++ b/scripts/build-oxc-shim.sh
@@ -14,5 +14,5 @@ cargo build --release
echo "Built liboxc_shim.a"
echo "Build the backend with the oxc parser enabled:"
-echo " cd backend && go build -tags oxc ."
+echo " cd backend && go build -tags oxc ./cmd/traceway"
echo "Select it at runtime with SYMBOLICATOR_PARSER=oxc"