Single-page web app project template curated for performance, developer experience, and type safety. Bun/Elysia backend, React Router frontend, Socket.IO and TanStack Query bridging the gap.
-
Server/client interaction is 100% type-safe. See api.ts and useApi.ts for simple HTTP and WebSocket examples.
-
Scalar documentation for API routes is served on /api/reference. OpenAPI Specification raw .json data is served on /api/reference/json.
-
The client meets PWA requirements for an installable, native app-like experience on a variety of platforms, and boasts a near-perfect PageSpeed Insights score out of the box.
-
Installs a service worker for caching static assets and API responses client-side, enabling offline functionality and faster subsequent loads with fewer requests to the server.
-
Includes a Dockerfile, fly.toml, and GitHub workflow for deploying to fly.io on pushes to the
main
branch. The Dockerfile compiles the app into a standalone binary and runs it in a distroless image.
-
Server-side rendering
-
Database
-
Authentication
-
CSS Framework
-
Tests
...but I may look into adding these in the future!
Install Bun.
Optionally create a .env
file in the root directory to override default environment variables. See .env.example for available options.
Install dependencies and launch:
bun install
bun run dev
Build client and compile server to standalone binary:
bun run build
bun run compile
Start server by executing the compiled main
binary or by running:
bun run start
Alternatively, build and run in a Docker container:
docker build -t fullstack-bun .
docker run -p 3000:3000 fullstack-bun
- Bun - server runtime, package manager, script runner
- Elysia - web framework
- React - user interface
- React Router - client-side routing
- TanStack Query - async state management
- Socket.IO - real-time server/client communication
- TypeScript, Biome, Lefthook - code quality/style
- Vite - dev server, bundler