What just changed in sitzio.de: a new local Hono auth backend, ten file edits in the SPA, zero remaining WorkOS imports. Test bed running on two ports.
flowchart TB classDef user fill:#1c2128,stroke:#58a6ff,stroke-width:2px,color:#e6edf3,font-weight:600 classDef spa fill:#1c2128,stroke:#d2a8ff,stroke-width:2px,color:#e6edf3,font-weight:600 classDef cloud fill:#1c2128,stroke:#f85149,stroke-width:2px,color:#e6edf3,font-weight:600 U["Browser"]:::user S["sitzio.de SPA
Vite + React"]:::spa W["WorkOS Cloud
AuthKit hosted login
—
their UI
their database
their brand"]:::cloud U --> S S -->|"redirect to login"| W W -->|"callback"| S
flowchart TB classDef user fill:#1c2128,stroke:#58a6ff,stroke-width:2px,color:#e6edf3,font-weight:600 classDef spa fill:#1c2128,stroke:#d2a8ff,stroke-width:2px,color:#e6edf3,font-weight:600 classDef api fill:#1c2128,stroke:#56d364,stroke-width:2px,color:#e6edf3,font-weight:600 classDef db fill:#1c2128,stroke:#e3b341,stroke-width:2px,color:#e6edf3,font-weight:600 U["Browser"]:::user S["sitzio.de SPA
Vite + React
localhost:5173"]:::spa A["auth-server
Hono + Better-Auth
localhost:3001"]:::api D[("SQLite
data/auth.db")]:::db U --> S S <-->|"fetch /api/auth/*"| A A <--> D
sequenceDiagram autonumber actor User participant SPA as SPA :5173 participant API as auth-server :3001 participant DB as SQLite User->>SPA: Click "Anmelden" SPA-->>User: /sign-up form User->>SPA: name + email + password SPA->>API: POST /api/auth/sign-up/email Note over API: Hash password (Argon2id) API->>DB: INSERT user API->>DB: INSERT account (with hash) API->>DB: INSERT session API-->>SPA: Set-Cookie session_token
(httpOnly, SameSite=Lax) SPA-->>User: redirect to / Note over SPA: useSession() returns user SPA-->>User: Header shows "Hi, name"
auth.ts until Resend is wired up./reset-password page.