Skip to main content

Documentation Index

Fetch the complete documentation index at: https://monitor-f3599674.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Prerequisites
  • Node.js version 19 or higher
  • MongoDB (local via Docker or Atlas)
  • A Resend API key for transactional email

Running locally

Navigate to the monitor-web directory and start the dev server:
cd monitor-web
npm run dev
The application runs on port 9100 by default:
http://localhost:9100

Environment variables

Create a .env file inside monitor-web/ (copy .env.example if present). Required variables:
VariableDescription
MONGODB_URIMongoDB connection string
SESSION_SECRETRandom secret used to sign cookies
RESEND_API_KEYResend API key for email delivery
NEXT_PUBLIC_APP_URLPublic base URL of the app (used in generated links)
SMTP_HOST / SMTP_PORTSMTP fallback for email when Resend is unavailable

Project structure

monitor-web/
├── app/
│   ├── (app)/            # Authenticated routes (dashboard, monitors, incidents…)
│   ├── (auth)/           # Login, register, OTP verification
│   ├── api/v1/           # REST API handlers (Next.js Route Handlers)
│   └── status/           # Public status page routes
├── components/           # React components (forms, sidebar, charts…)
├── lib/
│   ├── models/           # Mongoose models (Monitor, Incident, AlertChannel…)
│   ├── mongodb.ts        # DB connection singleton
│   └── auth-session.ts   # Session helpers
├── utils/                # Shared utilities (HTTP client, formatters)
└── scripts/              # Build-time scripts (OpenAPI generation)

Generating the OpenAPI spec

Monitor auto-generates an OpenAPI JSON spec from its route handlers at build time:
npm run openapi:generate
The spec is written to docs/api-reference/openapi.json and used by the API Reference tab in these docs. It also runs automatically before every production build (prebuild hook):
npm run build

Tech stack

ConcernLibrary
FrameworkNext.js 16 with App Router
UI componentsRadix UI + shadcn/ui
StylingTailwind CSS v4
FormsFormik + Yup
DatabaseMongoDB via Mongoose
EmailResend · Nodemailer (fallback)
ChartsRecharts
StateZustand

Linting

npm run lint

Troubleshooting

Ensure your MONGODB_URI is set correctly in .env and that your MongoDB instance is running. For Atlas, check that your IP is whitelisted.
Verify RESEND_API_KEY is set and valid. If using SMTP fallback, confirm SMTP_HOST and SMTP_PORT are reachable from your machine.
Change the port in monitor-web/package.json under the "dev" script:
"dev": "next dev -p YOUR_PORT"