AmanVarshney01/Better-T-Stack

Tanstack Router, Hono, tRPC, Better Auth, Drizzle, Tailwind Template

โ˜… 71Forks 3TypeScriptGitHub โ†—Compare
better-authdrizzle-ormhonotailwindcsstanstack-routertrpctursotypescript

README

Better-T Stack

A modern TypeScript monorepo template powered by Hono, tRPC, TanStack Router, Tailwind CSS, shadcn/ui, Better-Auth, and Drizzle with libSQL - all bundled together with Bun for maximum performance.

๐Ÿš€ Tech Stack

Core

  • Bun - Fast all-in-one JavaScript runtime
  • TypeScript - Type safety across the stack
  • tRPC - End-to-end type-safe APIs

Frontend

Backend

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ client/                 # Frontend React application
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ components/    # UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ routes/        # TanStack Router routes
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ lib/           # Utilities and configurations
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ server/                 # Backend Hono API
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ db/            # Database schema and config
โ”‚       โ”‚   โ”œโ”€โ”€ lib/           # Auth and tRPC setup
โ”‚       โ”‚   โ””โ”€โ”€ routers/       # tRPC routers
โ”‚       โ””โ”€โ”€ ...

๐Ÿšฆ Getting Started

  1. Clone (or use github template) and install dependencies:
npx degit AmanVarshney01/Better-T-Stack my-project
cd my-project
bun install
  1. Set up the database:
# Start local SQLite database with turso
bun run db:local

# Push database schema
bun run db:push
  1. Start development servers:
# Start both client and server
bun run dev

# Or individually:
bun run dev:client
bun run dev:server

The client will be available at http://localhost:3001

๐Ÿ“ Available Scripts

Root

  • bun dev - Start all development servers
  • bun dev:client - Start client development server
  • bun dev:server - Start server development server
  • bun db:local - Start local SQLite database
  • bun db:push - Push database schema changes
  • bun clean - Clean all node_modules and lock files

Client

  • bun typecheck - Run TypeScript type checking
  • bun build - Build for production
  • bun serve - Preview production build

Server

  • bun dev - Start development server with hot reload
  • bun wrangler:dev - Run with Cloudflare Workers locally
  • bun wrangler:deploy - Deploy to Cloudflare Workers

๐Ÿ’ป Development

This template is configured for an optimal development experience out of the box:

  • Full-stack TypeScript configuration
  • End-to-end type safety with tRPC
  • Modern authentication with Better-Auth
  • Beautiful UI components from shadcn/ui
  • Fast development server with Bun
  • Production-ready with Cloudflare Workers support

Contributors

AmanVarshney01

Issues