Rebuild the hub on Bun: Elysia API, Better Auth, Drizzle, Next.js website
CI / test (push) Successful in 30s

The hub becomes a Bun monorepo: apps/api (Elysia, Better Auth for accounts, roles, bans, proxy device
sign-in and JWT keys; tagline linking, presence and the console as before), packages/db (Drizzle; Postgres in
production, PGlite in development and tests), and the Next.js website from apps/web. Self-hostable with
docker compose; the website deploys to Vercel-style hosts, the API to any that runs Bun or containers. The
first version, in Go, is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-29 05:03:54 -07:00
1 parent 64c552330b
commit 7a06ba49c3
59 files changed
+2640 -3523

No files matched your search

+16 -10
View File
@@ -1,7 +1,8 @@
# t5de-hub
T5DE's hub (see docs/design.md, a draft under discussion with the user). Related repositories, usually checked out
beside this one: `t5de` (patches), `t5de-proxy` (local proxy), later `t5de-catalog` and `t5de-api`.
T5DE's hub (see README.md and docs/design.md). Related repositories, usually checked out beside this one: `t5de`
(patches), `t5de-proxy` (local proxy, Go; it signs in to the hub), `t5de-api` (shared definitions), later
`t5de-catalog`.
## Rules
@@ -9,15 +10,20 @@ beside this one: `t5de` (patches), `t5de-proxy` (local proxy), later `t5de-catal
in our own words are fine.
- Test with a throwaway IMVU account, never a real one.
- Commits: author "dhkatz <dev@t5de.dev>"; never the user's real name or email.
- The user prioritizes backend performance (Go), and wants moderation centered on the hub's website.
- IMVU session keys never leave the user's machine; the hub never asks for them.
## Notes
- Go, net/http, html/template (server-rendered; htmx 2.0.4 vendored in `internal/web/static`, CSP without inline
scripts or styles), pgx with plain SQL (`internal/store`, migrations embedded), coder/websocket.
- Dev: `go run ./cmd/t5de-hub -dev` (embedded Postgres on port 54321). Tests use port 54339 and a database each.
- The look: IMVU Classic's dialog palette (dark grays, gold buttons with black text), like T5DE's setup. Copy is
short and plain.
- Calls to IMVU (`internal/imvu`, its public user API) are rare and rate-limited: linking and age re-checks only.
- Stack (the user's choice, 2026-10-29): Bun, Elysia, Better Auth, Drizzle (Postgres; PGlite in development and
tests), Next.js 16 with Tailwind 4 and shadcn/ui, Turborepo. Must stay self-hostable (docker compose) and deployable
to Vercel/Heroku-style hosts. Go was used first and replaced.
- The website's look: modern and neutral, light/dark following the system, color only for status. Not IMVU Classic's
style (T5DE's setup keeps that).
- Better Auth's tables must match its plugins: when changing plugins, compare with `getAuthTables` (Better Auth logs
"Drizzle schema mismatch" otherwise), then `bun x drizzle-kit generate` in packages/db.
- Device sign-in: the person's viewing a code (`deviceVerify`) claims it, then `deviceApprove`; the hub's
`/api/v1/device/approve` does both and logs it. Proxies' sessions are told apart by their User-Agent
(`t5de-proxy...`).
- On this VM, Bun and Node are portable installs in `%LOCALAPPDATA%\Programs\bun` and `...\nodejs` (not on PATH; no
`bunx`: use `bun x`).
- Calls to IMVU (`apps/api/src/imvu.ts`, its public user API) are rare and rate-limited: linking and age re-checks.