From b2179ecf75d9f5953b2923f6493f8565a0c34fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Sun, 12 Jul 2026 02:16:42 +0300 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20add=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run, build, and deploy notes — the /api reverse-proxy contract and the VITE_API_URL escape hatch — plus a map of the source layout. --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc92fa8 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# hezarfen_frontend + +SolidJS SPA for [hezarfen_backend](../../Rust/hezarfen_backend). Bun for tooling, +Vite for dev/build, `@solidjs/router` for lazy-loaded routes — no other runtime +dependencies. + +## Run + +```sh +bun install +bun run dev # http://localhost:5173, proxies /api -> http://127.0.0.1:8080 +``` + +Start the backend first (`cargo run` in the backend repo). The dev server +proxies `/api/*` to it, so the session cookie stays same-origin and CORS never +enters the picture. + +## Build + +```sh +bun run check # typecheck +bun run build # dist/ +``` + +Serve `dist/` behind any reverse proxy that maps `/api/*` to the backend +(strip the `/api` prefix). To point the SPA at an absolute API origin instead, +set `VITE_API_URL` at build time. + +## Shape + +- `src/lib/api.ts` — typed client; every endpoint, one `ApiError` shape. +- `src/lib/auth.tsx` — session context; `/auth/me` fetched once, mutated in place. +- `src/lib/action.ts` — pending/error wrapper for mutations. +- `src/pages/*` — one file per route, lazy-loaded. + +Mutations update resources from the server's response (`mutate`), never by +refetching — the UI reacts in the same frame the request resolves.