Skip to content

reybahl/vithos

Repository files navigation

Vithos

A typesafe, modern, opinionated full-stack template, built for the edge, with deployment to Cloudflare Workers configured.

Stack

Raed more about the architectural choices behind the stack here!

Layer Tech Role
Frontend Vite 8, React 19, TanStack Router & Query SPA, file-based routes, typed data fetching
API Hono Lightweight HTTP app; same createApp() runs on Node (dev) and Workers (prod)
Types Hono RPC (hc<AppType>) Client infers request/response shapes from the server — no OpenAPI codegen
Auth Better Auth Email/password, cookie sessions, Kysely adapter
DB Prisma schema → Kysely Migrations + generated SQL types; queries in app code
UI shadcn/ui (Tailwind 4) Shared @acme/ui package
Deploy Cloudflare Workers + Assets, Hyperdrive, Neon Edge runtime, pooled Postgres to Neon; PR preview branches optional
Monorepo pnpm, Turborepo Shared packages, cached tasks

Local dev: Vite proxies /apiapps/api (Node). Production: apps/worker serves the built SPA and API on one origin.

Project structure

apps/
  web/          # Vite + React SPA
  api/          # Node dev server (Hono)
  worker/       # Cloudflare Worker (production + previews)
packages/
  hono-app/     # API routes, middleware, Zod validators — imported by api + worker
  auth/         # Better Auth config
  db/           # Prisma schema, migrations, Kysely client
  ui/           # shadcn components + styles
tooling/        # Shared ESLint + TypeScript configs

Rename @acme/* package scopes when you fork. See DEPLOYMENT.md for Cloudflare, Neon, and CI.

Get started

  1. Use this template on GitHub, then clone your new repo.
  2. docker compose up -d
  3. Copy env examples and set a local auth secret:
 cp .env.example .env
 cp apps/api/.env.example apps/api/.env
 cp apps/web/.env.example apps/web/.env   # optional

 # paste into apps/api/.env as BETTER_AUTH_SECRET=
 openssl rand -base64 32
  1. pnpm install
  2. pnpm db:migrate
  3. pnpm devhttp://localhost:5173

Deploy

See DEPLOYMENT.md.

Commands

Command Description
pnpm dev Web + API (not Worker)
pnpm build Build apps/packages
pnpm db:migrate Prisma migrate dev
pnpm lint / pnpm typecheck CI-style checks (run on pre-commit via husky).

About

Type-safe fullstack monorepo for Cloudflare Workers - Vite, Hono, Better Auth, Postgres (Neon + Hyperdrive).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors