refactor
This commit is contained in:
parent
d0ea6e9eec
commit
2967f1a5af
31 changed files with 469 additions and 165 deletions
|
|
@ -26,7 +26,7 @@ make tools # air, golangci-lint, sqlc
|
|||
## Running
|
||||
|
||||
```bash
|
||||
make dev-all # API on :8080, admin UI on :5173 with a proxy
|
||||
make dev-all # API on :8080, admin UI on :5173 with a proxy (builds the SDK first)
|
||||
```
|
||||
|
||||
Open <http://localhost:5173>. The Vite dev server proxies `/api`, `/rt` and `/auth`
|
||||
|
|
@ -34,11 +34,18 @@ to the Go process, so the session cookie works exactly as it will in production.
|
|||
Same-origin matters: a cross-origin setup would not authenticate at all, and the
|
||||
problem would look like a bug rather than a topology difference.
|
||||
|
||||
The admin UI is itself a consumer of the runtime: the header theme selector and the
|
||||
light/dark toggle are the shipped controls, loaded from `/rt/v1/components.js`, which
|
||||
the **API** serves from `sdk/dist` (Vite proxies `/rt` to it). `make dev-all` builds
|
||||
the SDK up front for exactly this reason — an unbuilt `sdk/dist` means those controls
|
||||
never define and the switcher silently falls back.
|
||||
|
||||
Other entry points:
|
||||
|
||||
```bash
|
||||
make dev-api # the API alone, with hot reload
|
||||
make dev-web # the admin UI alone
|
||||
make dev # the API with hot reload (air); serves web/dist and sdk/dist, so `make build` first
|
||||
make dev-api # the API alone, no hot reload; serves the runtime SDK, Vite serves the UI
|
||||
make dev-web # the admin UI alone (its /api and /rt proxy to :8080)
|
||||
make run # build everything, run the real binary
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue