A modern, production-ready template for building full-stack React applications using React Router with Bun and Hono.
- 🚀 Server-side rendering (w/ Bun & Hono Server!)
- ⚡️ Hot Module Replacement (HMR)
- 📦 Asset bundling and optimization
- 🔄 Data loading and mutations
- 🔒 TypeScript by default
- 🎉 TailwindCSS for styling
- 📖 React Router docs
- 🧪 Vitest + React Testing Library for testing
- 🔍 BiomeJS for code linting & formatting
This template uses bun as the package manager and Javascript Runtime. So, you need to install bun
globally:
curl -fsSL https://bun.sh/install | bash
Install the dependencies:
bun install
Start the development server with HMR:
bun dev
Your application will be available at http://localhost:5173
.
Create a production build:
bun run build
This template includes a Dockerfile to simplify the deployment:
To build and run using Docker:
# Build the image
docker build -t my-app .
# Run the container
docker run -p 3000:3000 my-app
The containerized application can be deployed to any platform that supports Docker, including:
- AWS ECS
- Google Cloud Run
- Azure Container Apps
- Digital Ocean App Platform
- Fly.io
- Railway
If you're familiar with deploying Node or Bun applications, the built-in app server is production-ready.
Make sure to deploy the output of bun run build
├── package.json
├── bun.lockb
├── build/
│ ├── client/ # Static assets
│ └── server/ # Server-side code
Biome is used to ensure code consistency across the project. It is already included a config file with the default + recommended options to enable when using this setup. Feel free to change it to your liking!
To run all the biome checks (linting and formatting):
bun biome check
To automatically fix linting issues and format code:
bun biome check --write
This template uses Vitest as the testing framework and React Testing Library for component testing. There's also included a basic setup with recommended settings.
To run the tests, use the following command:
bun run test
This will run all the unit and integration tests.
To watch and re-run tests on file changes during development:
bun run test:watch
This template comes with Tailwind CSS already configured for a simple default starting experience. You can use whatever CSS framework you prefer.