au1h
Getting started

Installation

Run au1h locally with Bun, Postgres and Redis.

Prerequisites

  • Bun 1.2 or newer
  • PostgreSQL 15 or newer (the schema uses UNIQUE NULLS NOT DISTINCT)
  • Redis 6 or newer

Clone and configure

git clone https://github.com/AD12-codes/au1h
cd au1h
bun install

cp apps/server/.env.example apps/server/.env
cp apps/web/.env.example apps/web/.env

Edit apps/server/.env. The values you must set:

VariableWhat
DATABASE_URLPostgres connection string
REDIS_URLRedis connection string
BETTER_AUTH_SECRETA long random string. Signs cookies and encrypts the JWT private key
BETTER_AUTH_URLThe public URL of the server, e.g. http://localhost:4444
CORS_ORIGINThe admin portal's origin, e.g. http://localhost:4445

Everything else has a sensible default; see Configuration.

Apply the schema

cd apps/server
bun run db:migrate

Start

bun run dev
ServiceURL
au1h serverhttp://localhost:4444
Admin portalhttp://localhost:4445

Check it is up:

curl http://localhost:4444/api/v1/health

Create the first admin

Open http://localhost:4445/register. The very first sign-up is allowed and becomes an admin with its own workspace. After that, admin sign-up is closed unless the email is in AU1H_ADMIN_EMAILS or has a pending workspace invitation.

Admin accounts are separate from your applications' users. [email protected] can be an au1h admin and, independently, a user of each application.

Optional: GitHub and Google sign-in

Set GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET and GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET. Each provider is enabled when both of its values are present. The OAuth callback URL is ${BETTER_AUTH_URL}/api/auth/callback/github (or google).

On this page