- Open-source
- Self-hostable
- Great performance thanks to Hono & Bun
- Type-safety
- Have Docker or a similar app (like Orb.stack) up and running
- Boot up the Postgres & Redis server (from the
docker-compose.yml
file):bun infra:start
- Run the backend server:
bun dev
- Access the API documentation of the api server at http://localhost:4000/docs
- Access the API documentation for Better-auth endpoints at http://localhost:4000/api/auth/reference
- Access the OpenAPI specs at http://localhost:4000/openapi.json
- Not being locked-in to any database. Better-auth can work with many types of DB
- Not being locked-in to any closed-source services
- All solutions in this framework can be migrated to another similar solutions.
The app comes with Postgres by default. Better-auth interacts with it via the DATABASE_URL (connection string) so you can deploy this app to prod and connect it to any database service via said variable. To use MySQL, SQLite or any other SQL flavors, refer to Better-auth docs.
- For usage with Drizzle ORM, please refer to the orm/drizzle branch.
- Prisma (coming soon)
- Railway: Refer to RAILWAY.md
Credits:
- https://github.com/kadumedim/better-auth-starter
- https://github.com/daveyplate/better-auth-tanstack-starter
Others:
@t3-oss/env-core
for managing env variables in a type-safe mannerzod
for runtime schema validation, feel free to replace it with something like Valibot- If you are looking for a self-hostable web anlytics service that utilizes the existing Postgres/MySQL & Redis resources, Umami is a great fit!
- OpenObserve is a great selfhost service for observability.