Skip to content

microh-labs/auth

Repository files navigation

@microh-labs/auth

Modern, secure authentication SPA and API for your apps. Built with React, Express, Drizzle ORM, shadcn/ui, and Vite.


Features

  • Username/password authentication with JWT (RS256, public/private key)
  • Professional, responsive UI (shadcn/ui, React, Vite)
  • Secure config, validation, and error handling
  • Auto-migrating SQLite DB (Drizzle ORM)
  • Programmatic migrations (no CLI needed)

Quick Start (End Users)

  1. Install:
    npx @microh-labs/auth
    # or clone and run: pnpm install && pnpm build && node .
  2. First Run:
    • Visit the setup page (/setup) to configure branding and upload/generate your JWT keypair.
  3. Sign Up/Login:
    • Use the web UI to create your first user and log in.

Developer Guide

Local Development

pnpm install
pnpm dev
# Open http://localhost:5173

Project Structure

  • src/ — Frontend (React, shadcn/ui, assets, components)
  • src/db/ — Drizzle ORM schema and DB logic
  • app.ts — Express backend (API, config, JWT, etc.)
  • public/ — Static assets

Database & Migrations

  • Uses SQLite (drizzle.db)
  • Migrations are run programmatically on server start (no CLI needed)

Linting & Build

pnpm lint
pnpm build

Screenshots

App Screenshot

Maintainers

  • Publishing:

    • Update version in package.json
    • Build and publish to npm
  • Screenshots:

    • See /screenshots/ for UI previews
  • Entrypoint:

    • index.js (CLI) and app.ts (server)

License

MIT — Chien Tran, microh-labs