airi/apps/server
RainbowBird a3a401d79d
Some checks are pending
CI / Lint (push) Waiting to run
CI / Build Test (stage-tamagotchi) (push) Waiting to run
CI / Build Test (stage-tamagotchi-godot) (push) Waiting to run
CI / Build Test (stage-web) (push) Waiting to run
CI / Build Test (ui-loading-screens) (push) Waiting to run
CI / Build Test (ui-transitions) (push) Waiting to run
CI / Type Check (push) Waiting to run
CI / Check Provenance (push) Waiting to run
Cloudflare Workers / Deploy - stage-web (push) Waiting to run
feat(server): new metrics for auth
- Added a new ObservableGauge for distinct active users to track real active user count, mitigating session row inflation issues.
- Updated the Grafana dashboard to reflect changes, including the removal of redundant WS Connections panel and the addition of new metrics for active sessions and distinct users.
- Improved documentation for verification automation processes, outlining a structured approach to automate verification steps and maintain evidence of tests.
2026-05-15 18:54:05 +08:00
..
docs/ai-context feat(server): new metrics for auth 2026-05-15 18:54:05 +08:00
drizzle refactor(server): drop redis stream + worker role (#1792) 2026-05-08 21:14:01 +08:00
otel feat(server): new metrics for auth 2026-05-15 18:54:05 +08:00
production/railway fix(docker): enhance server-schema build process with error handling 2026-05-08 21:59:36 +08:00
sql fix(server): docker-compose fix 2026-01-05 16:26:44 +08:00
src feat(server): new metrics for auth 2026-05-15 18:54:05 +08:00
.env feat(server): env-based trusted origins for Capacitor dev (#1763) 2026-05-14 16:17:13 +08:00
CLAUDE.md refactor(server): drop redis stream + worker role (#1792) 2026-05-08 21:14:01 +08:00
docker-compose.otel.yml feat(server): add OpenTelemetry observability stack 2026-03-06 02:58:44 +08:00
docker-compose.yml refactor(server): drop redis stream + worker role (#1792) 2026-05-08 21:14:01 +08:00
Dockerfile fix(docker): enhance server-schema build process with error handling 2026-05-08 21:59:36 +08:00
drizzle.config.ts fix(server): database with duplicated index 2026-01-05 16:27:10 +08:00
instrumentation.ts feat(server/otel): restructure observability metrics and add active sessions gauge 2026-05-12 23:10:13 +08:00
package.json feat(analytics): integrate PostHog for server-side event tracking 2026-05-15 16:20:47 +08:00
railway.toml revert(server/docker): restore assets distribution image 2026-04-28 00:54:13 +08:00
README.md feat(server): env-based trusted origins for Capacitor dev (#1763) 2026-05-14 16:17:13 +08:00
tsconfig.json feat(server/otel): restructure observability metrics and add active sessions gauge 2026-05-12 23:10:13 +08:00
vitest.config.ts feat(ui-server-auth): init server auth page 2026-04-03 01:26:38 +08:00

@proj-airi/server

HTTP and WebSocket backend for AIRI. This app owns auth, billing, chat synchronization, gateway forwarding, and server-side observability export.

What It Does

  • Serves the Hono-based API and WebSocket endpoints.
  • Uses Postgres as the source of truth for users, billing, and durable state.
  • Uses Redis for cache, KV, Pub/Sub, and Streams.
  • Forwards GenAI requests to the configured upstream gateway and records billing from usage.
  • Exports traces, metrics, and logs through OpenTelemetry.

How To Use It

Install dependencies from the repo root and run scoped commands:

pnpm -F @proj-airi/server typecheck
pnpm -F @proj-airi/server exec vitest run
pnpm -F @proj-airi/server build

For local observability infrastructure, use:

docker compose -f apps/server/docker-compose.otel.yml up -d

ADDITIONAL_TRUSTED_ORIGINS (LAN / Capacitor dev)

When the mobile dev server uses a non-localhost origin (for example https://10.x.x.x:5273 from cap copy ios / capacitor.config.json), set ADDITIONAL_TRUSTED_ORIGINS in apps/server/.env.local to a comma-separated list of exact origins (parsed and normalized at startup). Example:

ADDITIONAL_TRUSTED_ORIGINS=https://10.0.0.129:5273,https://198.18.0.1:5273

Restart the API server after changing this variable.