en un clic
dev-workflow
// Information on how to build, lint, typecheck and test the project, with details on dev and prod mode differences
// Information on how to build, lint, typecheck and test the project, with details on dev and prod mode differences
| name | dev-workflow |
| description | Information on how to build, lint, typecheck and test the project, with details on dev and prod mode differences |
Describes how to build, typecheck, and test this project.
3222 (set via PORT env var)cityguide.local → proxied to port 3222 via localias with HTTPS enabledSERVER_DOMAIN=cityguide.local; on a real deployment this will be the actual domain nameTo confirm localias is running and check the mapping:
localias list
# cityguide.local -> 3222
If localias is running, treat https://cityguide.local as the live URL for the app. If it is not running, the app is reachable at http://localhost:3222.
# Frontend only (vue-tsc + vite build → frontend/dist)
bun run build:frontend
# Backend only (bun build → backend/dist/index.js)
bun run build:backend
# Both
bun run build:all
Frontend build uses vue-tsc -b && vite build.
Backend build uses bun build ./src/index.ts --target bun --outdir ./dist.
bun run dev # frontend build:watch + backend bun --watch in parallel
bun run dev:backend # backend only
bun run dev:frontend # frontend vite build --watch only
In dev mode the backend runs on http://localhost:3222. The frontend dev server (bunx vite) runs separately on port 5173 and proxies API calls to the backend via VITE_API_URL=http://localhost:3222.
bun run typecheck # runs both backend and frontend typecheck
tsc --noEmit (strict, bun-types, covers src/ scripts/ tests/ drizzle.config.ts)vue-tsc -b (composite project references via tsconfig.app.json / tsconfig.node.json)Tests exist only in the backend (backend/tests/*.test.ts).
bun run --cwd backend test # or: cd backend && bun test
Uses bun:test (describe, it, expect, beforeAll, afterAll).
backend/tests/helpers/app.ts exports makeTestApp(), which spins up a full Elysia app wired to a fresh in-memory PGlite database (via MemoryFS) with migrations applied. Each suite gets a clean DB; call teardown() in afterAll.
import { makeTestApp, get, post, patch } from './helpers/app'
let app: TestApp
let teardown: () => Promise<void>
beforeAll(async () => { ({ app, teardown } = await makeTestApp()) })
afterAll(async () => { await teardown() })
The helpers get, post, and patch call app.handle(new Request(...)) and return { status, body }.
backend/tests/ named *.test.ts.makeTestApp() — do not import the live DB or call external services.