Skip to content

System Architecture

The system is a Turborepo monorepo managed with Bun. It contains two applications:

  • apps/web — React + Vite frontend served as Cloudflare Workers static assets.
  • apps/api — Hono REST API deployed to Cloudflare Workers.

A single Cloudflare Worker (social-osu) serves both the frontend static assets and the API. The worker configuration in apps/api/wrangler.toml references ../web/dist as the static asset directory.

Client Browser
Cloudflare Worker (social-osu)
├── /api/* → Hono API routes
│ │
│ ▼
│ Neon PostgreSQL
└── /* → Static assets (React SPA)
ServicePurposeIntegration
ClerkIdentity and authentication@hono/clerk-auth middleware, JWT verification
Neon PostgreSQLPrimary databasePrisma ORM with @prisma/adapter-neon
Google GeminiLLM (chatbot, tagging, title generation) and embeddingsVercel AI SDK via shared AI model router
Ticketmaster APIOff-campus event dataScheduled cron trigger, REST API
OSU Events FeedOn-campus event dataScheduled cron trigger
LayerTechnology
FrameworkReact 19
Build toolVite
RoutingTanStack Router (file-based)
Data fetchingTanStack Query
StylingTailwind CSS 4
Componentsshadcn/ui (Radix primitives)
LayerTechnology
FrameworkHono
RuntimeCloudflare Workers (production), Bun (development)
ORMPrisma with Neon serverless adapter
Vector searchpgvector extension on Neon PostgreSQL
Auth middleware@hono/clerk-auth
AI SDKVercel AI SDK, routed through shared AI model router

GitHub Actions pipeline with three stages:

  1. secret-scan — TruffleHog scans for leaked secrets.
  2. checks — Install, generate Prisma client, lint, typecheck, build. Uploads apps/web/dist as artifact.
  3. deploy-preview (on PR) — Uploads preview version via wrangler versions upload.
  4. deploy-production (on main push) — Deploys via wrangler deploy.
AppPort
Frontend (Vite)5173
Backend (Bun)3001

In development, Vite proxies /api/* requests to the backend on port 3001.