Skip to content

Latest commit

Β 

History

History
100 lines (74 loc) Β· 5.79 KB

File metadata and controls

100 lines (74 loc) Β· 5.79 KB

Admin Starter

Bun Docker Compose GitHub Actions Workflow Status GitHub code size in bytes Security Rating

A TypeScript monorepo is implementing pieces of Better Auth in a Hono API, with a TanStack Start web app consuming it to demonstrate how they work together. πŸŽ“

It started as a starter template with no business logic, an experiment in a monorepo, focusing on file structure and build setup. Over time, the project naturally evolved, and I introduced features as the need arose.

The custom features are easily removable, so you can grab the files and use them to kick-start your own project.

Note

This isn’t even the final form. Its exact purpose are still evolving.

Architecture

flowchart LR
  subgraph "monorepo"
    A["πŸ“ apps/api<br/>Hono API<br/>Better Auth"]
    W["πŸ“ apps/web<br/>TanStack Start<br/>React + SSR"]
    P["πŸ“ packages/*<br/>Zod schemas<br/>shared utilities"]
    WW["πŸ“ apps/cli<br/>CLI to drive Ollama"]
  end

  U((User))
  UW(((CLI)))
  D[(PostgreSQL)]
  E{{Emails}}
  O{Ollama}

  P -.-> A
  P -.-> W
  P -.-> WW

  U <-->|Web| W
  U <-->|Mobile| A
  UW <-->|HTTP| A
  UW <==> O
  WW -.-> UW

  W <-->|HTTP| A
  A <==> D
  A -->|SMTP| E
Loading

Features

User Admin Docker Compose
πŸ”Ή Register and verify your email
πŸ”Ή Update your profile
πŸ”Ή Log in with cookies
or bearer tokens
πŸ”Ή View users
πŸ”Ή Revoke sessions


β–ͺ️ db
β–ͺ️ mail
β–ͺ️ api
β–ͺ️ web

Demo

Click Here for the demo!

It’s an ephemeral database. πŸ›‘οΈ
Register, or use a test credential to sign in.

Quick Start

Working defaults in the compose config and in .env files.

Just run:

docker compose up -d

Docker Compose mounts the PostgreSQL data in the ./pgdata folder.
Open http://localhost:3000 to access the UI.

More details on the dev page.

Documentation

A wise man once told me the source code is the best documentation. Share it with your favourite AI agent and ask for the details. :trollface: That Jekyll page is anything but RTFM.

Stack

Package API Web CLI Description
Better Auth βœ“ βœ“ βœ“ Authentication framework on PostgreSQL
Biome βœ“ βœ“ βœ“ Code format and linter
Bun βœ“ βœ“ βœ“ TypeScript runtime
Clack βœ“ CLI library
Hono βœ“ API framework
Lucide βœ“ Icons
Nodemailer βœ“ Send emails
Pino βœ“ Logger
React βœ“ βœ“ Library for user intrfaces (emails in API)
Tailwind CSS βœ“ Utility-first CSS framework
TanStack Form βœ“ Headless UI for type-safe forms
TanStack Query βœ“ Data fetching
TanStack Start βœ“ Full-stack framework powered by Vite
TanStack Table βœ“ Headless UI for tables & datagrids
Zod βœ“ βœ“ Schema validation with static type inference