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

@ -6,8 +6,14 @@ Minmon is a student-friendly web dashboard for managing private servers, service
## Current Main Features
- Admin sign-in with better-auth
- First-run administrator registration when no users exist
- Better Auth sign-in with ordinary public registration disabled
- User creation by initial password or one-time invitation link
- Invitation copy, revoke, replace, accepted, and revoked lifecycle states
- Forced password replacement for administrator-created initial passwords
- Root route (`/`) redirects automatically:
- no users -> `/setup`
- initial-password replacement required -> `/change-password`
- logged in -> `/dashboard`
- not logged in -> `/login`
- Dashboard summary for:
@ -29,12 +35,15 @@ Minmon is a student-friendly web dashboard for managing private servers, service
- service -> server
- domain -> service
- note -> server
- Sample seeded admin and demo dataset
- Optional sample admin and demo dataset
## Current Route Structure
- `/` -> auth-based redirect
- `/setup` -> first administrator registration, available only while there are no users
- `/login` -> sign-in page
- `/change-password` -> required initial-password replacement
- `/invite/$token` -> one-time invitation acceptance
- `/dashboard` -> summary page
- `/dashboard/servers` -> server list
- `/dashboard/servers/new` -> create server
@ -48,6 +57,7 @@ Minmon is a student-friendly web dashboard for managing private servers, service
- `/dashboard/notes` -> note list
- `/dashboard/notes/new` -> create note
- `/dashboard/notes/$noteId` -> note detail + edit
- `/dashboard/users` -> users, roles, and invitation lifecycle management
## Local Setup
@ -92,7 +102,25 @@ bun run db:start
bun run db:push
```
7. Seed sample data
7. Run the apps
```bash
bun run dev
```
8. Open the app
- Web: `http://localhost:5173`
- API: `http://localhost:3000`
With an empty user table, the root and login routes redirect to `/setup`. Create the
first administrator there. The backend serializes first-account creation and rejects
any later public registration attempt.
### Optional demo seed
The explicit demo seed is still available when the sample inventory and fixed demo
administrator are needed:
```bash
bun run --filter @minmon/db db:seed
@ -103,17 +131,6 @@ Seeded admin login:
- Email: `admin@minmon.local`
- Password: `admin12345`
8. Run the apps
```bash
bun run dev
```
9. Open the app
- Web: `http://localhost:5173`
- API: `http://localhost:3000`
## Docker Compose Deployment
Run the deployable stack with one command:
@ -128,11 +145,12 @@ Default Docker endpoints:
- Web: `http://localhost:3001`
- API: `http://localhost:3000`
The Compose stack starts PostgreSQL, applies the schema, and seeds the sample admin only if the users table is empty.
The Compose stack starts PostgreSQL, applies the schema, and ensures the default
roles and permissions exist. It does not seed a default user; finish initialization
from the first-run setup screen.
Docker Compose reads the root `.env` file automatically. Edit it before startup if you need different ports, public URLs, credentials, or secrets.
## Current Behavior Notes
### List Ordering