A monorepo for the vidyafreshmen project that includes various components and services.
apps/: Contains the main applications.web/: The SvelteKit frontend and server routes, including the Hono API, deployed together as one Cloudflare Worker. Workflow entrypoints remain underapps/web/src/worker/workflows/.
packages/: Contains shared libraries and utilities.auth/: BetterAuth configuration for authentication.server/: Hono routers and business-logic services shared by the API.db/: Database utilities and migrations.typescript-config/: Shared TypeScript configuration (seem to be broken).
turbo.json: Configuration for Turborepo to manage tasks and dependencies across the monorepo.
We use bun as the package manager and task runner. To get started, install bun if you haven't already:
curl -fsSL https://bun.sh/install | bashThen, install the dependencies:
bun installSetting up environment variables:
apps/web/example.dev.varsrename to.dev.varsand fill in the required values. (You mosly need to setGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETfor Google OAuth)apps/web/.env.examplerename to.env(no need to fill in anything, just rename it).
For sake of simplicity, run the following command to rename the files:
mv apps/web/example.dev.vars apps/web/.dev.vars && mv apps/web/.env.example apps/web/.envPush database schema changes:
bun turbo db:pushThen start the development server:
bun run devNavigate to http://localhost:5173 for SvelteKit page, API, and auth development. The Cloudflare adapter provides local platform bindings to the SvelteKit server routes.
bun run dev already runs the full stack (pages + Hono API + Workflows) — navigate to http://localhost:5173.
To share a running build externally (e.g. testing on another device), run cd apps/web && bun run dev:tunnel: it builds the worker and serves it behind a public Cloudflare quick tunnel, printing the tunnel URL on start. This serves a snapshot of the last build, not live source changes.
Time-gated features are controlled by packages/flags/config.ts (all times Asia/Bangkok, +07:00). This is the only place feature availability is date-gated — everything else reads through FeatureFlags.isEnabled(...).
| Flag | Window |
|---|---|
registering |
always open (no end) |
team-joining |
2026-07-19 18:00 → 2026-07-21 23:59 |
group-choosing (group preference ordering) |
2026-07-19 18:00 → 2026-07-21 23:59 |
group-announcement |
opens 2026-07-23 18:00 (no end) |
game-playing (d-day) |
2026-07-25 00:00 → 2026-07-27 23:59 |
In dev, use the floating dev toolbar (bottom of the screen, dev-only) to force any of these flags on/off regardless of the actual date/time, and to mock-login as a test student without going through Google SSO.
For deployment, we use Cloudflare Workers for both the API and web applications. If you are the maintainer, you can deploy using the following commands:
bun turbo deployI took too long to come up with these value so put here for future reference.
Build configuration
Build command:
bun turbo build -- --filter api
Deploy command:
bun run deploy
Version command:
bunx wrangler versions upload
Root directory:
/
