minmon/README.md

4.5 KiB

Dashboard Manajemen Layanan Server Private Berbasis Web

Minmon is a student-friendly web application for managing private servers, hosted services, attached domains, and internal server notes. The system focuses on CRUD operations plus lightweight DNS monitoring, not deployment automation.

Final Project Scope

This app allows an admin to:

  • Manage servers
  • Manage services running on each server
  • Manage domains attached to services
  • Manage notes/documentation for each server
  • Run DNS A-record checks and compare resolved IPs with the expected server IP
  • View a dashboard summary

Main Features

  • 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
    • total domains
    • matched domains
    • mismatched domains
    • unresolved domains
    • inactive/down services
    • recent notes
  • Server CRUD
  • Service CRUD
  • Domain CRUD
  • DNS check action
  • Server notes CRUD
  • Optional sample admin and demo dataset

Database / Entity Overview

Server

  • id
  • name
  • primaryIpAddress
  • secondaryIpAddress
  • operatingSystem
  • location
  • provider
  • description
  • status
  • createdAt
  • updatedAt

Service

  • id
  • serverId
  • name
  • type
  • internalPort
  • externalPort
  • protocol
  • status
  • description
  • createdAt
  • updatedAt

Domain

  • id
  • serviceId
  • name
  • expectedServerIp
  • lastResolvedIp
  • lastResolvedIps
  • resolutionStatus
  • lastCheckedAt
  • remarks
  • lastCheckMessage
  • createdAt
  • updatedAt

Note

  • id
  • serverId
  • title
  • content
  • category
  • createdAt
  • updatedAt

Relationships

  • One server has many services
  • One server has many notes
  • One service belongs to one server
  • One service has many domains
  • One domain belongs to one service

Tech Stack

  • React
  • TanStack Router
  • tRPC
  • PostgreSQL
  • Drizzle ORM
  • better-auth
  • Effect (used narrowly for DNS checking)
  • Bun
  • Turborepo

Local Run Instructions

  1. Install dependencies
bun install
  1. Create apps/server/.env
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/minmon
BETTER_AUTH_SECRET=your-32-char-or-longer-secret-value-here
BETTER_AUTH_URL=http://localhost:3000
CORS_ORIGIN=http://localhost:5173
NODE_ENV=development
  1. Start PostgreSQL if needed
bun run db:start
  1. Apply database schema
bun run db:push
  1. Run the application
bun run dev
  1. 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:

bun run --filter @minmon/db db:seed

Seeded admin:

  • Email: admin@minmon.local
  • Password: admin12345

Docker Compose Deployment

Run the full stack with PostgreSQL, database initialization, API, and web UI:

cp .env.example .env
docker compose up -d

Default endpoints:

  • Web: http://localhost:3001
  • API: http://localhost:3000

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

minmon/
├── apps/
│   ├── web/
│   └── server/
├── packages/
│   ├── api/
│   ├── auth/
│   ├── db/
│   ├── env/
│   └── ui/
└── docs/

Extra Assignment Deliverables

See:

  • docs/run-instructions.md
  • docs/uml-guidance.md
  • docs/report-outline.md

Notes

  • DNS checking is limited to A record / IPv4 as required.
  • Docker Compose is available for running the app stack; the app itself does not include SSH, reverse proxy, or host orchestration automation.
  • Full workspace typecheck is still blocked by a pre-existing desktop typing issue for three, but the web app and server app are verified.