Naalya Handbook

Getting started

Clone, install with Bun, point at the API, and boot the Education Hub locally with the schema watcher running.

Getting the Education Hub running locally takes about five minutes, but there's one twist that catches most newcomers. This frontend doesn't define its own API types. They're generated from the backend's live OpenAPI spec. So "running the app" really means running two things side by side: the dev server, and a watcher that keeps the typed API client in sync with the API.

Get that mental model first and the rest is just commands.

Stack at a glance

Before you touch a command, here's the shape of what you're booting. You don't need to know any of these deeply yet: this is just a map so the package names stop looking like noise.

ConcernTool
FrameworkTanStack Start (React 19 + SSR) on Vite 7
RoutingTanStack Router (file-based, src/routes/)
Data fetchingTanStack React Query
Client stateZustand (auth tokens, theme, panels)
API clientAxios, with types generated from OpenAPI
Package managerBun
TestingVitest + React Testing Library

The one row that drives this whole page is the API client. Let's set it up.

Step 1: Clone and install

The project uses Bun. package.json sets packageManager to bun@1.3.13, and preinstall refuses other package managers. The Dockerfile builder is node:22-slim and then copies the bun binary. The runtime image is oven/bun:1-alpine, which is not pinned to 1.3.13. There is no engines field.

terminal
git clone <repo-url> education-hub
cd education-hub
bun install

That bun install also runs the prepare script, which wires up Husky git hooks. The commands in this section were not re-run on 11 November 2026. They match package.json.

Step 2: Point at the API

Copy .env.example to .env.local. The example names VITE_API_URL, VITE_BASE_URL, VITE_CENTRIFUGO_URL, and the PostHog variables. Nothing in the example is marked required by a schema. The Axios instance uses VITE_API_URL and does not throw when it is missing.

.env.local
VITE_API_URL=http://localhost:8000
VITE_BASE_URL=http://localhost:3000
VITE_CENTRIFUGO_URL=ws://localhost:8006

api.config.toml sets base_url_env = "VITE_API_URL" and api_endpoint to http://localhost:8000/docs/swagger/json. The shipped Axios client reads import.meta.env, not process.env.

The API has to be running

The schema watcher generates types by polling the API's live spec at http://localhost:8000/docs/swagger/json. If the backend isn't up, the watcher has nothing to read and your types won't refresh. Start the backend API before, or alongside, the frontend. This is the single most common "why won't it work" for new devs.

Step 3: Boot with dev:all

You could run bun dev on its own: it starts Vite on port 3000 with --host (so it's reachable from other devices on your network). But that only runs the app. It does nothing to keep your API types fresh.

The recommended way to run the project is dev:all, which uses concurrently to run the schema watcher and the dev server together in one terminal:

terminal
bun run dev:all

Under the hood that's just two scripts glued together:

package.json
"dev": "vite dev --port 3000 --host",
"api:watch": "chowbea-axios watch",
"dev:all": "concurrently --names 'api,vite' \"bun api:watch\" \"bun dev\"",

The api process polls the OpenAPI spec every 20 seconds (poll_interval_ms = 20000 in api.config.toml). When a backend dev changes an endpoint, your src/services/api client regenerates automatically, and TypeScript starts flagging the mismatch in your editor seconds later. That tight loop is the whole point of dev:all.

Where the generated client lives

The watcher writes _generated/ and _internal/openapi.json under src/services/api (the [output] folder in api.config.toml). Those files say not to edit them. api.instance.ts and api.client.ts are generated once and then left alone. The live instance reads import.meta.env.VITE_API_URL, even though api.config.toml sets env_accessor to process.env. The generated client page explains the split.

Step 4: Open it and log in

With dev:all running, open the app:

http://localhost:3000

You'll land on the public landing page at /. Sign-in is not Google OAuth. The Hub asks the schools API for a token pair, then stores it in Zustand under localStorage key auth-token. The doors in source are password login (POST /api/v1/auth/login), one-time codes, magic links, and Microsoft OAuth, which returns to /auth/callback with the tokens on the query string. UserType is student, staff, guardian, guest, or platform_admin. The /auth/operator screen is a route, not a sixth type. See Authentication across the platforms.

Keeping types in sync

Most of the time the watcher in dev:all handles this for you. But if you started with plain bun dev, or you pulled a branch where the backend changed, you can regenerate the client by hand in a one-shot:

terminal
bun run api:generate

That hits the same spec and rewrites src/services/api once, then exits. Run it any time your types look stale and you don't have the watcher running.

Style and conventions

You don't have to memorize the style rules: they're enforced for you. The project runs Prettier + ESLint (TanStack's config) with TypeScript in strict mode, and the git hooks format staged files on commit. The house style is no semicolons, single quotes, trailing commas.

To format and lint the whole project on demand:

terminal
bun run check

One alias is worth committing to memory: @/* maps to src/*. So @/services/api is the generated client, @/routes is the route tree, and you'll see that prefix everywhere instead of long ../../ chains.

Check that the setup works

If the app loads at http://localhost:3000, the api process in your dev:all terminal isn't throwing errors, and your editor shows no red squiggles in src/services/api, you're set. Run the tests once to confirm the toolchain is healthy:

terminal
bun run test

That runs the Vitest suite once and exits. Use bun run test, not bun test. Plain bun test starts Bun's own test runner instead of Vitest. A green run means Bun, Vite, and the generated client are all wired up correctly: time to go read how the pieces fit together.

Where to go next

On this page