TAJMAC Auth

Up and running in 5 minutes

Get TAJMAC Auth running locally with a Postgres database.

Prerequisites

1

Clone the repository

git clone https://github.com/tmsaas/tmsaas.git
cd tmsaas
bun install
2

Configure environment variables

Copy the example env and fill in your database URL and secrets:

cp apps/tajmac-auth-api/.env.example apps/tajmac-auth-api/.env.local

Key variables:

# apps/tajmac-auth-api/.env.local
DATABASE_URL="postgresql://user:pass@localhost:5432/tajmac_auth?schema=tajmac_auth"
DIRECT_URL="postgresql://user:pass@localhost:5432/tajmac_auth"
TAJMAC_AUTH_JWT_SECRET="your-32-char-secret-here"
TAJMAC_AUTH_ENCRYPTION_KEY="64-char-hex-key"
TAJMAC_AUTH_ADMIN_EMAIL="admin@example.com"
TAJMAC_AUTH_ADMIN_PASSWORD="YourSecurePassword123!"
3

Run database migrations

Apply the SQL migrations to your Postgres database:

# Apply each migration in order
psql "$DIRECT_URL" -f apps/tajmac-auth-api/prisma/migrations/20260406150000_app_user_multi_type/migration.sql
psql "$DIRECT_URL" -f apps/tajmac-auth-api/prisma/migrations/20260409120000_permission_system/migration.sql
# ... (see prisma/migrations/ for all files)

# Regenerate Prisma client
bunx prisma generate --schema=apps/tajmac-auth-api/prisma/schema.prisma
4

Start the dev servers

bun run dev

This starts all apps in parallel:

  • http://localhost:3002 — Auth API (Hono)
  • http://localhost:3003 — Admin Portal (this app)
  • http://localhost:3004 — Hosted Login UI
5

Sign in to the portal

Open http://localhost:3003/portal/login and sign in with your admin credentials from step 2.

Bootstrap creates the admin user automatically on first start.

Next: Next.js Integration →Back to Docs