stack/apps
Bilal Godil c82448b4d9 backend: port from Next.js to Elysia/Bun
Replace the Next.js dev/start runtime with a standalone Elysia app
running under Bun. The route file layout (apps/backend/src/app/api/...)
is preserved; modules are loaded by a sorted dispatcher so static
routes win over dynamic and catch-all.

- elysia-app.ts: Elysia app, route loader, @elysia/opentelemetry
- elysia-server.ts: Bun listener entrypoint
- next-compat.ts: headers/cookies/redirect/nextUrl shims and
  StackRedirectError so existing route code keeps working
- otel-init.ts: NodeTracerProvider + AsyncLocalStorage context
  manager (Bun doesn't get OTel via Next.js anymore); optional
  JSONL span exporter gated on STACK_TRACE_LOG_FILE for profiling
- proxy.tsx: fetch-compatible CORS preflight, dev rate limit, and
  API-version rewrite (preserves x-middleware-rewrite header)
- smart-request/smart-response/smart-route-handler/redirect-handler:
  switch NextRequest -> StackNextRequest, normalize array catch-all
  params at the smart-request boundary, intercept StackRedirectError

dev/start scripts now run `bun --watch src/elysia-server.ts` with
NODE_ENV=development and BUN_RUNTIME_TRANSPILER_CACHE_PATH=0
(workaround for stale-edit issue with bun's transpiler cache).
NODE_ENV is set explicitly because Next used to set it implicitly,
and getNodeEnvironment()=="" was breaking the freestyle email
renderer's "mock key in production" guard.

Drops STACK_ARTIFICIAL_DEVELOPMENT_DELAY_MS to 0 in .env.development;
the 500ms artificial delay was masking real perf and made tests
unnecessarily slow on the new runtime.

Adds perf tooling under scripts/: benchmark.ts, profile-endpoint.ts,
profile-test.ts, analyze-endpoint.ts. They use the JSONL span
exporter to break down time by span name across many requests.
2026-04-29 14:15:05 -07:00
..
backend backend: port from Next.js to Elysia/Bun 2026-04-29 14:15:05 -07:00
dashboard [Dashboard][Backend][SDK] - Adds sharable session replay ids. (#1294) 2026-04-28 17:57:07 -05:00
dev-launchpad chore: update package versions 2026-04-20 19:06:56 -07:00
e2e [codex] fix OAuth redirect contract (#1393) 2026-04-28 16:33:59 -07:00
hosted-components chore: update package versions 2026-04-20 19:06:56 -07:00
internal-tool Dashboard: DataGrid refactor + layout (stacked on overview-revamp) (#1338) 2026-04-27 13:50:24 -07:00
mock-oauth-server fix(emulator): move mock OAuth off 8114 to avoid pnpm dev conflict (#1385) 2026-04-27 09:39:34 -07:00
oauth-mock-server In-source unit tests (#429) 2025-02-14 11:47:52 -08:00