Skip to content

RedEagle-dh/briochestack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Briochestack

A modern fullstack web project template with:

  • Runtime: Native Bun (no Node.js, no Turborepo)
  • Frontend: TanStack Start + React 19
  • Backend: ElysiaJS + Eden Treaty (type-safe API)
  • Auth: Better Auth with Drizzle adapter
  • Database: Drizzle ORM + Bun SQLite
  • UI: Tailwind CSS v4 with custom shadcn-style components
image

Getting Started

Prerequisites

  • Bun v1.1.0 or later

Setup

  1. Install dependencies:

    bun install
  2. Copy environment file:

    cp .env.example .env
  3. Generate and run database migrations:

    bun run db:generate
    bun run db:migrate
  4. Start the development servers:

    bun run dev

The frontend will be available at http://localhost:3000 and the API at http://localhost:3001.

Project Structure

bun-fullstack-template/
├── apps/
│   ├── web/              # TanStack Start frontend
│   │   └── src/
│   │       ├── routes/   # File-based routing
│   │       ├── components/ui/  # Custom UI components
│   │       └── lib/      # Utilities
│   │
│   └── api/              # ElysiaJS backend
│       └── src/
│           ├── app.ts    # Main app with type export
│           └── routes/   # API routes
│
└── packages/
    ├── database/         # Drizzle ORM + Bun SQLite
    ├── auth/             # Better Auth config
    └── api-client/       # Eden Treaty client

Available Scripts

Script Description
bun run dev Start all development servers
bun run dev:api Start API server only
bun run dev:web Start frontend only
bun run build Build all packages and apps
bun run db:generate Generate Drizzle migrations
bun run db:migrate Run migrations
bun run db:studio Open Drizzle Studio
bun run lint Run Biome linter
bun run lint:fix Fix lint issues

Type-Safe API with Eden Treaty

The API types flow from backend to frontend:

apps/api/src/app.ts
  └─> export type App = typeof app
        │
        ▼
packages/api-client
  └─> treaty<App>(url)
        │
        ▼
apps/web
  └─> api.api.demo.greeting({ name }).get()
      // Full autocomplete & type checking!

UI Components

Custom shadcn-style components are available in apps/web/src/components/ui/:

  • Button - Variant-based button with loading states
  • Input - Styled input with label and error support
  • Card - Card container with header/content/footer
  • Badge - Status badges with variants
  • Spinner - Loading spinner

All components use the cn() utility for class merging.

API Documentation

Swagger documentation is available at http://localhost:3001/swagger when the API is running.

License

MIT

About

A modern fullstack web template with Bun, TanStack Start, ElysiaJS, Better Auth, and Drizzle ORM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors