# @blade-and-brawn/portal Admin portal for Blade & Brawn — manage the level calculator's standards configs/datasets, review apparel orders/products, and inspect activity events. Talks to `apps/api` via a typed [`@elysia/eden`](https://elysiajs.com/eden/overview.html) client. ## Stack - SvelteKit 5 + Vite, deployed with `svelte-adapter-bun` - Tailwind 4 + daisyUI - `jose` for verifying the auth JWT cookie server-side ## Environment variables | Variable | Purpose | | --- | --- | | `PUBLIC_API_URL` | Base URL of `apps/api`, used by the Eden client (`src/lib/api.ts`) | | `AUTH_SECRET` | JWT verification secret — must match `AUTH_SECRET` in `apps/api` | ## Auth `src/hooks.server.ts` gates every route except `/login` behind a valid `auth` JWT cookie (issued by the API's `/auth/login` endpoint). Requests without one are redirected to `/login`. ## Scripts Run from the repo root as `bun run dev:portal` / `bun run build:portal`, or from this directory: - `dev` — Vite dev server - `build` — production build - `preview` — preview a production build locally - `check` / `check:watch` — `svelte-check` type checking ## Structure - `src/routes/(app)/calculator/` — standards configs and datasets - `src/routes/(app)/apparel/` — Printful/Webflow orders and products - `src/routes/(app)/activity/` — activity events - `src/routes/login/` — login page - `src/lib/api.ts` — Eden client used to call `apps/api`