feat: add onboarding and user invitations

This commit is contained in:
Syahdan 2026-08-07 19:53:11 +07:00
parent 24351eb897
commit 762cfe2b16
37 changed files with 5208 additions and 384 deletions

View file

@ -15,7 +15,11 @@ This app allows an admin to:
## Main Features
- Better-auth admin login
- First-run administrator setup when the user directory is empty
- Better Auth email/password sign-in with public registration disabled
- Administrator-created users with either an initial password or a one-time invitation link
- Non-expiring invitation links with copy, revoke, replace, accepted, and revoked states
- Admin, Editor, and Viewer role management with last-administrator protection
- Dashboard summary for:
- total servers
- total services
@ -30,7 +34,7 @@ This app allows an admin to:
- Domain CRUD
- DNS check action
- Server notes CRUD
- Sample seeded admin and demo dataset
- Optional sample admin and demo dataset
## Database / Entity Overview
@ -137,7 +141,25 @@ bun run db:start
bun run db:push
```
5. Seed sample data
5. Run the application
```bash
bun run dev
```
6. Open the app
- Web: `http://localhost:5173`
- API: `http://localhost:3000`
On a new database, Minmon redirects to `/setup`. The first account is assigned the
Admin role, the one-time setup endpoint closes, and ordinary public sign-up remains
disabled.
### Optional demo data
Run the explicit demo seed only when you want the sample monitoring inventory and
the fixed demonstration account:
```bash
bun run --filter @minmon/db db:seed
@ -148,17 +170,6 @@ Seeded admin:
- Email: `admin@minmon.local`
- Password: `admin12345`
6. Run the application
```bash
bun run dev
```
7. Open the app
- Web: `http://localhost:5173`
- API: `http://localhost:3000`
## Docker Compose Deployment
Run the full stack with PostgreSQL, database initialization, API, and web UI:
@ -173,11 +184,12 @@ Default endpoints:
- Web: `http://localhost:3001`
- API: `http://localhost:3000`
On first startup, the database initializer applies the schema and seeds the sample admin only when the users table is empty.
On startup, the database initializer applies the schema and ensures the default roles
and permissions exist. It does not create a default user. Open the web app to create
the first administrator securely through the setup screen.
Docker Compose reads the root `.env` file automatically. Edit it before startup if you need different ports, public URLs, credentials, or secrets.
## Project Structure
```text