Skip to content

Repository files navigation

Banner Title

Full Stack Starter

A modern full-stack starter template with React, Hono, and Capacitor for building web and native mobile apps.

Start building by runing bun create zerodays/full-stack-starter my-new-app.

Tech Stack

LayerTechnology
RuntimeBun
FrontendReact 19 + Vite
BackendHono
StylingTailwind CSS v4
DatabasePostgreSQL + Drizzle ORM
AuthBetter Auth
ObservabilityOpenTelemetry + Axiom
i18ni18next
ValidationZod
LintingBiome

Prerequisites

Getting Started

1. Install Dependencies

bun install

2. Setup Environment Variables

Configure your Infisical project or create a .env file with required variables.

3. Start Development Server

bun dev

This command starts:

  • PostgreSQL database (via Docker)
  • Vite dev server with HMR
  • Drizzle Studio for database management

Scripts

ScriptDescription
bun devStart full development environment
bun run buildBuild for production
bun startRun production server
bun run allRun all CI checks locally
bun run typecheckType-check the entire project
bun run lintFix linting issues
bun run lint:checkCheck code with Biome
bun run formatFix formatting issues
bun run format:checkCheck formatting

Database

ScriptDescription
bun run db:startStart PostgreSQL container
bun run db:studioOpen Drizzle Studio
bun run db:resetReset database (destroys all data)
bun run db:pushSync schema to DB (dev only, no migrations)
bun run db:generateGenerate migration files from schema changes
bun run db:migrateApply pending migrations
bun run db:regenerate-authRegenerate Better Auth schema
bun run import:stagingImport data from staging

Workflow:

  • Development: Use db:push for fast iteration (no migration files)
  • Staging/Production: Use db:generate + db:migrate (tracked, reviewable changes)

Re-run db:regenerate-auth when adding Better Auth plugins or upgrading.

Schema files:

  • server/database/schema/auth.ts - Auto-generated (safe to overwrite)
  • server/database/schema/app.ts - Your custom tables (never overwritten)

Project Structure

├── web/ # Frontend (React)
│ ├── app.tsx # Main app component
│ ├── client.tsx # Client entry point
│ ├── router.tsx # Route definitions
│ ├── components/ # UI components
│ ├── lib/
│ │ ├── api.ts # Hono RPC client (type-safe API calls)
│ │ └── auth-client.ts # Better Auth client
│ ├── i18n/ # Internationalization
│ └── styles.css # Global styles
├── server/ # Backend (Hono)
│ ├── server.ts # Server entry point & route assembly
│ ├── lib/ # Shared utilities
│ │ ├── auth.ts # Better Auth configuration
│ │ ├── logger.ts # Pino logger with trace context
│ │ ├── router.ts # Typed Hono router factory
│ │ ├── tracing.ts # OpenTelemetry tracing helpers
│ │ ├── request-context.ts # AsyncLocalStorage request context
│ │ └── instrumentation.ts # Node SDK setup
│ ├── middleware/ # Hono middleware
│ │ ├── auth.middleware.ts # User context middleware
│ │ └── db.middleware.ts # Database middleware
│ ├── features/ # Feature modules
│ │ ├── auth/ # Auth routes (Better Auth handler)
│ │ ├── health/ # Health check
│ │ └── demo/ # Demo routes
│ │ └── routes/ # Route handlers (one file per route)
│ └── database/
│ ├── index.ts # Drizzle connection
│ └── schema/
│ ├── auth.ts # Better Auth tables (auto-generated)
│ ├── app.ts # Your custom tables
│ └── index.ts # Re-exports all tables
├── shared/ # Shared utilities
│ └── tracing.ts # OpenTelemetry helpers
├── docs/ # Documentation
├── scripts/ # Utility scripts
└── env.ts # Environment schema (Zod)

CI

GitHub Actions runs on every push and PR to master:

  • Format check
  • Lint
  • Type check
  • Build

Documentation

GuideDescription
OpenTelemetry GuideHow to add tracing to your code
OpenTelemetry ArchitectureWhy the setup is structured this way
Capacitor GuideBuilding native iOS/Android apps

TODO

  • Sentry frontend integration

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages