elysia-and-better-auth-api

Scaffold a Bun API server with Elysia, BetterAuth, Drizzle, and PostgreSQL.

Updated Oct 8, 2025
One-click install
npx skills add https://github.com/ichabodcole/project-docs-scaffold-template --skill elysia-and-better-auth-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elysia-and-better-auth-api
Source: https://github.com/ichabodcole/project-docs-scaffold-template/tree/main/plugins/recipes/skills/elysia-betterauth-api
Command: npx skills add https://github.com/ichabodcole/project-docs-scaffold-template --skill elysia-and-better-auth-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This scaffolding recipe provides a cohesive, production-ready foundation for building API services using Bun, Elysia, BetterAuth, and Drizzle with PostgreSQL, reducing setup time and ensuring consistent security, typing, and architecture.

Core Features & Use Cases

  • Integrated stack: Bun runtime, Elysia framework, BetterAuth for authentication, Drizzle ORM, and PostgreSQL with a clear migration path.
  • Structured architecture: Six-layer design (Database, Auth, Session, Guards, Routes, App Entry) with cross-cutting concerns like error handling and event bus.
  • Type-safe development: TypeScript-first configuration, Path aliases, and a typed API client integration.

Quick Start

Follow the steps to install dependencies, bootstrap a Bun + Elysia API project, and run the initial drizzle migrations to start the server.

Frequently Asked Questions about elysia-and-better-auth-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Bun API with Elysia, BetterAuth, and PostgreSQL?

Scaffold a production-ready Bun API with Elysia, BetterAuth, and PostgreSQL by applying this recipe to bootstrap a six-layer architecture, integrate the Drizzle adapter, and generate a typed API client.

What is the best way to structure a Bun and Elysia backend for authentication?

The best way to structure an authenticated Elysia backend is a six-layer architecture covering Database, Auth, Session, Guards, Routes, and App Entry, with cross-cutting concerns for error handling and event bus integration.

Does BetterAuth work with Drizzle ORM and Elysia for type-safe API routes?

Yes, BetterAuth works with Drizzle ORM and Elysia by using the BetterAuth Drizzle adapter, enabling global session middleware, and providing type-safe API client generation for fully typed routes.

How do I set up database migrations for a Bun Elysia server using Drizzle?

Set up Drizzle database migrations for your Bun Elysia server by installing dependencies, bootstrapping the project, and running the initial migration commands to initialize the PostgreSQL database schema.

Can I use this Elysia API scaffold for scalable production infrastructure?

Yes, you can use this Elysia API scaffold for scalable production infrastructure because it provides a structured six-layer architecture, TypeScript-first configuration, and integrated authentication via BetterAuth.