{message}
+{details}
+ {stack && ( +
+ {stack}
+
+ )}
+ From 0cea20deb99d8794c6c311c6b28347a79a3ed35f Mon Sep 17 00:00:00 2001
From: Javi Aguilar <122741+itsjavi@users.noreply.github.com>
Date: Sat, 8 Nov 2025 23:04:19 +0100
Subject: [PATCH 1/2] feat: add Bun template
---
.gitignore | 2 +
bun/.dockerignore | 4 +
bun/.gitignore | 7 ++
bun/Dockerfile | 23 +++++
bun/README.md | 86 +++++++++++++++++++
bun/app/app.css | 15 ++++
bun/app/entry.client.tsx | 12 +++
bun/app/entry.server.tsx | 53 ++++++++++++
bun/app/root.tsx | 75 ++++++++++++++++
bun/app/routes.ts | 3 +
bun/app/routes/home.tsx | 13 +++
bun/app/welcome/logo-dark.svg | 23 +++++
bun/app/welcome/logo-light.svg | 23 +++++
bun/app/welcome/welcome.tsx | 89 +++++++++++++++++++
bun/package.json | 28 ++++++
bun/public/favicon.ico | Bin 0 -> 15086 bytes
bun/react-router.config.ts | 7 ++
bun/server.ts | 152 +++++++++++++++++++++++++++++++++
bun/tsconfig.json | 27 ++++++
bun/vite.config.ts | 8 ++
pnpm-lock.yaml | 70 ++++++++++++++-
pnpm-workspace.yaml | 1 +
22 files changed, 719 insertions(+), 2 deletions(-)
create mode 100644 bun/.dockerignore
create mode 100644 bun/.gitignore
create mode 100644 bun/Dockerfile
create mode 100644 bun/README.md
create mode 100644 bun/app/app.css
create mode 100644 bun/app/entry.client.tsx
create mode 100644 bun/app/entry.server.tsx
create mode 100644 bun/app/root.tsx
create mode 100644 bun/app/routes.ts
create mode 100644 bun/app/routes/home.tsx
create mode 100644 bun/app/welcome/logo-dark.svg
create mode 100644 bun/app/welcome/logo-light.svg
create mode 100644 bun/app/welcome/welcome.tsx
create mode 100644 bun/package.json
create mode 100644 bun/public/favicon.ico
create mode 100644 bun/react-router.config.ts
create mode 100644 bun/server.ts
create mode 100644 bun/tsconfig.json
create mode 100644 bun/vite.config.ts
diff --git a/.gitignore b/.gitignore
index a3e300f..b02b575 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,5 @@
.parcel-cache
# Deno
deno.lock
+# Bun
+bun.lock
diff --git a/bun/.dockerignore b/bun/.dockerignore
new file mode 100644
index 0000000..9b8d514
--- /dev/null
+++ b/bun/.dockerignore
@@ -0,0 +1,4 @@
+.react-router
+build
+node_modules
+README.md
\ No newline at end of file
diff --git a/bun/.gitignore b/bun/.gitignore
new file mode 100644
index 0000000..039ee62
--- /dev/null
+++ b/bun/.gitignore
@@ -0,0 +1,7 @@
+.DS_Store
+.env
+/node_modules/
+
+# React Router
+/.react-router/
+/build/
diff --git a/bun/Dockerfile b/bun/Dockerfile
new file mode 100644
index 0000000..7d7364a
--- /dev/null
+++ b/bun/Dockerfile
@@ -0,0 +1,23 @@
+FROM oven/bun:1-alpine AS development-dependencies-env
+COPY . /app
+WORKDIR /app
+RUN bun ci
+
+FROM oven/bun:1-alpine AS production-dependencies-env
+COPY ./package.json bun.lock /app/
+WORKDIR /app
+RUN bun ci --omit=dev
+
+FROM oven/bun:1-alpine AS build-env
+COPY . /app/
+COPY --from=development-dependencies-env /app/node_modules /app/node_modules
+WORKDIR /app
+RUN bun run build
+
+FROM oven/bun:1-alpine
+COPY ./package.json bun.lock /app/
+COPY --from=production-dependencies-env /app/node_modules /app/node_modules
+COPY --from=build-env /app/build /app/build
+COPY --from=build-env /app/server.ts /app/server.ts
+WORKDIR /app
+CMD ["bun", "--trace-uncaught", "--trace-warnings", "run", "/app/server.ts", "build/server/index.js"]
diff --git a/bun/README.md b/bun/README.md
new file mode 100644
index 0000000..b1cb0c8
--- /dev/null
+++ b/bun/README.md
@@ -0,0 +1,86 @@
+# Welcome to React Router!
+
+A modern, production-ready template for building full-stack React applications using React Router and Bun.
+
+## Features
+
+- 🚀 Server-side rendering
+- ⚡️ Hot Module Replacement (HMR)
+- 📦 Asset bundling and optimization
+- 🔄 Data loading and mutations
+- 🔒 TypeScript by default
+- 🎉 TailwindCSS for styling
+- 📖 [React Router docs](https://reactrouter.com/)
+
+## Getting Started
+
+### Installation
+
+Install the dependencies:
+
+```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
+```
+
+## Deployment
+
+### Docker Deployment
+
+To build and run using Docker:
+
+```bash
+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
+
+### DIY Deployment
+
+If you're familiar with deploying Bun applications, the built-in app server is production-ready, even though it is
+still recommended to use a dedicated static file server for production, e.g. nginx, with gzip compression enabled.
+
+Make sure to deploy the output of `bun run build`
+
+```
+├── package.json
+├── bun.lock
+├── build/
+│ ├── client/ # Static assets
+│ └── server/ # Server-side code
+```
+
+## 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.
diff --git a/bun/app/app.css b/bun/app/app.css
new file mode 100644
index 0000000..99345d8
--- /dev/null
+++ b/bun/app/app.css
@@ -0,0 +1,15 @@
+@import "tailwindcss";
+
+@theme {
+ --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif,
+ "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+}
+
+html,
+body {
+ @apply bg-white dark:bg-gray-950;
+
+ @media (prefers-color-scheme: dark) {
+ color-scheme: dark;
+ }
+}
diff --git a/bun/app/entry.client.tsx b/bun/app/entry.client.tsx
new file mode 100644
index 0000000..7e8a937
--- /dev/null
+++ b/bun/app/entry.client.tsx
@@ -0,0 +1,12 @@
+import { startTransition, StrictMode } from 'react'
+import { hydrateRoot } from 'react-dom/client'
+import { HydratedRouter } from 'react-router/dom'
+
+startTransition(() => {
+ hydrateRoot(
+ document,
+
{details}
+ {stack && ( +
+ {stack}
+
+ )}
+ BP_2ehBt1?`~ypvg_Ot4x1V+43P@Ve8>qd)9NX_jWdLo`Zfy
zoeam9)@Dpym{4m@+LNx K7osU{Xp5PG4-K+L2G=)c3f&}H&M3wo7TlO_UJjQ-Oq&_
zjAc9=nNIYz{c3zxOiS5UfcE1}8#iI4@uy;$Q7>}u`j+OU0N<*Ezx$k{x_27+{s2Eg
z`^=rhtIzCm!_UcJ?