An open API service indexing awesome lists of open source software.

https://github.com/bskimball/react-router-rsc-hono-bun

React Router RSC with Hono server
https://github.com/bskimball/react-router-rsc-hono-bun

bun hono react react-router rsc

Last synced: about 1 month ago
JSON representation

React Router RSC with Hono server

Awesome Lists containing this project

README

          

# Welcome to React Router! (Experimental RSC)

โš ๏ธ **EXPERIMENTAL**: This template demonstrates React Server Components with React Router. This is experimental technology and not recommended for production use.

A modern template for exploring React Server Components (RSC) with React Router, powered by Vite and served with Hono. Built for speed with Bun and formatted with Biome.

## Features

- ๐Ÿงช **Experimental React Server Components**
- ๐Ÿš€ Server-side rendering with RSC
- โšก๏ธ Hot Module Replacement (HMR)
- ๐Ÿ“ฆ Asset bundling and optimization with Vite
- ๐Ÿ”„ Data loading and mutations
- ๐Ÿ”’ TypeScript by default
- ๐ŸŽ‰ TailwindCSS for styling
- ๐ŸŒ **Hono** - Fast, lightweight web framework for the server
- โšก **Bun** - Fast JavaScript runtime for package management and production server
- ๐Ÿงน **Biome** - Fast formatter and linter for consistent code style
- ๐Ÿ“– [React Router docs](https://reactrouter.com/)
- ๐Ÿ“š [React Server Components guide](https://reactrouter.com/how-to/react-server-components)
- ๐Ÿ”ฅ [Hono documentation](https://hono.dev/)
- ๐Ÿƒโ€โ™‚๏ธ [Bun documentation](https://bun.sh/)
- โšก [Biome documentation](https://biomejs.dev/)

## Getting Started

### Installation

Install the dependencies with Bun:

```bash
bun install
```

### Development

Start the development server with HMR:

```bash
bun run dev
```

Your application will be available at `http://localhost:5173`.

## Building for Production

Create a production build:

```bash
bun run build
```

## Running Production Build

Run the production server (powered by Hono and Bun):

```bash
bun run start
```

The production server uses:

- **Bun** as the JavaScript runtime for optimal performance
- **Hono** as the web framework for fast, efficient request handling
- Compression middleware and static asset serving
- Customizable port via the `PORT` environment variable (defaults to 3000)

## Understanding React Server Components

This template includes three entry points:

- **`entry.rsc.tsx`** - React Server Components entry point
- **`entry.ssr.tsx`** - Server-side rendering entry point
- **`entry.browser.tsx`** - Client-side hydration entry point

The production server (`server.js`) uses Hono to:

- Serve static assets from the build output
- Handle compression with built-in middleware
- Route all requests through the RSC handler
- Provide fast, efficient request processing

Learn more about React Server Components with React Router in our [comprehensive guide](https://reactrouter.com/how-to/react-server-components).

## Code Quality

This project uses **Biome** for fast, consistent code formatting and linting:

### Formatting

Format your code:

```bash
bun run format
```

### Linting

Check for code issues:

```bash
bun run lint
```

### Combined Check

Run both formatting and linting:

```bash
bun run check
```

Biome is configured to:

- Use double quotes for JavaScript/TypeScript
- Use tab indentation
- Enable recommended linting rules
- Automatically organize imports

## Styling

This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer.

---

Built with โค๏ธ using React Router, Hono, Bun, and Biome.