Skip to content

Amitind/bhvr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bhvr 🦫

cover

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 enviorment while also keeping type saftey.

Features

  • Full-Stack TypeScript: End-to-end type safety between client and server
  • Shared Types: Common type definitions shared between client and server
  • Monorepo Structure: Organized as a workspaces-based monorepo
  • Modern Stack:
    • Bun as the JavaScript runtime
    • Hono as the backend framework
    • Vite for frontend bundling
    • React for the frontend UI

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

Getting Started

Installation

# Install dependencies for all workspaces
bun install

Development

# Run shared types in watch mode, server, and client all at once
bun run dev

# Or run individual parts
bun run dev:shared  # Watch and compile shared types
bun run dev:server  # Run the Hono backend
bun run dev:client  # Run the Vite dev server for React

Building

# Build everything
bun run build

# Or build individual parts
bun run build:shared  # Build the shared types package
bun run build:client  # Build the React frontend

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.

Client

Server

Type Sharing

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:

import { ApiResponse } from '@shared/types';

Learn More

About

A monorepo template using Bun, Hono, Vite, and React

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 47.7%
  • CSS 33.3%
  • JavaScript 12.8%
  • HTML 6.2%