Buffet is a template for 2025. Let's recognize where we stand:
- Bun is awesome and powerful
- Effect is a new way of thinking about type and exception safety
- TailwindCSS makes styling easier for both humans and AI
So why not use them together?
Since Bun has better support for full-stack web development now, bringing a separate bundler, like Vite, is not required anymore. Less config files and dependencies to manage. Better DX.
The main goals of this template are:
- simplicity
- an optimized client bundle
- end-to-end type safety
bun i && bun run init && bun dev
⚠️ Warning
Bun >= 1.3.0 is required.
If you don't have Bun installed, runcurl -fsSL https://bun.com/install | bash
If you have an older version of Bun, runbun upgrade
If you are on Windows, I'm sorry for you
- The
bun run initcommand sets up your project's environment and updates the auth schema. - The
bun run make-migrationscommand generates migration scripts using drizzle-kit. Migrations should be committed to your repository for deployments to work. - In production, migrations are applied right after the server starts, in a separate Effect layer, using the SQLite migrator provided by Drizzle.
- Avoid using the Better Auth CLI in production as it has a dependency on
better-sqlite3, which requires V8 C++ APIs that Bun doesn't currently support. - To adjust rate limiting, refer to the corresponding plugin's documentation.
The template is a work in progress, but it's ready for you to fork and ship your next project! All basic building blocks are here - auth, DB operations, API, routing, etc.
While the stack was very simple at the start (based on HTMX and @kitajs/html JSX runtime), it has become much more opinionated. It's hard to be happy about having a super fast and lightweight client bundle, when the project is unmaintainable. We need the red squiggly lines in the editor, and the types, and reliable battle-tested solutions for common things like auth. Here are the picks:
ElysiaJS supports the backend, it has a great ecosystem of plugins and various helpers for serving static files and implementing the API.
Svelte SPA is the frontend solution of choice.
Shadcn Svelte components are added to unlock fast UI prototyping.
Better Auth is used for authentication.
- Eden Treaty keeps RPC calls end-to-end type safe
- Drizzle ORM enables type-safe database operations
- Routing is powered by an awesome lightweight library sv-router by @colinlienard
- Client data fetching is done with Svelte Query
- Biome is used for linting and formatting
❗ Note for Biome:
if you are on Linux (not macOS), replace the@biomejs/cli-darwin-arm64binary package with the appropriate one for your platform (see this list)
Contributions are welcome to keep polishing the experience!