A full-stack TypeScript monorepo starter with shared types, using Bun, Hono, Vite, and React.
Why bhvr?
While there are plenty of existing app building stacks out there, many of them are either bloated, outdated, or have too much of a vendor lock-in. bhvr is built with the opinion that you should be able to deploy your client or server in any environment while also keeping type safety.
Turbo for monorepo build orchestration and caching
Project Structure
.
āāā client/ # React frontend
āāā server/ # Hono backend
āāā shared/ # Shared TypeScript definitions
ā āāā src/types/ # Type definitions used by both client and server
āāā package.json # Root package.json with workspaces
āāā turbo.json # Turbo configuration for build orchestration
Server
bhvr uses Hono as a backend API for its simplicity and massive ecosystem of plugins. If you have ever used Express then it might feel familiar. Declaring routes and returning data is easy.
All response types are defined in the shared package for type safety across client and server.
If you wanted to add a database to Hono you can do so with a multitude of Typescript libraries like Supabase, or ORMs like Drizzle or Prisma
Client
bhvr uses Vite + React Typescript template, which means you can build your frontend just as you would with any other React app. This makes it flexible to add UI components like shadcn/ui or routing using React Router.
The Shared package is used for anything you want to share between the Server and Client. This could be types, utility functions, or libraries that you use in both environments.
# Install dependencies for all workspaces
bun install
Development
# Run all workspaces in development mode with Turbo
bun run dev
# Or run individual workspaces directly
bun run dev:client # Run the Vite dev server for React
bun run dev:server # Run the Hono backend
Building
# Build all workspaces with Turbo
bun run build
# Or build individual workspaces directly
bun run build:client # Build the React frontend
bun run build:server # Build the Hono backend
Additional Commands
# Lint all workspaces with Biome
bun run lint
# Format code with Biome
bun run format
# Type check all workspaces
bun run type-check
# Run tests across all workspaces
bun run test
Code Quality & Development Workflow
bhvr uses Biome for fast linting and formatting, along with Husky for pre-commit hooks to ensure code quality.
Biome Configuration
The project is configured with Biome for consistent code style:
Automatic import organization
Tab-based indentation
Double quotes for strings
VCS integration with Git
Recommended linting rules enabled
Pre-commit Hooks
Husky runs automatically before each commit to maintain code quality:
# Pre-commit hook runs:
bun run lint # Checks for linting issues
bun run format # Formats code automatically
If there are any linting errors, the commit will be blocked until they're fixed. To manually run these checks:
# Check for issues
bun run lint
# Auto-fix formatting
bun run format
Automation & CI/CD
The project includes GitHub Actions workflows for:
Auto-implement: Automatically plans and implements issues labeled with auto-implement
Continuous Integration: Runs tests, type checking, and builds on every push
Automated Code Review: Uses Claude for intelligent code review
Preview Deployments: Automatically deploys preview environments for pull requests
Production Deployments: Handles production deployment automation
See .github/AUTO-IMPLEMENT.md for details on the auto-implementation workflow.
Deployment
Deplying each piece is very versatile and can be done numerous ways, and exploration into automating these will happen at a later date. Here are some references in the meantime.
Types are automatically shared between the client and server thanks to the shared package and TypeScript path aliases. You can import them in your code using: