Development Reference
Code Organisation
- Components:
src/components/with subdirectories:ui/- shadcn/ui components and reusable UI elementsdashboard/- Dashboard-specific componentssettings/- Settings page componentsserver-details/- Server detail page components
- API Routes:
src/app/api/with RESTful endpoint structure (see API Reference) - Database: SQLite with better-sqlite3, utilities in
src/lib/db-utils.ts, migrations insrc/lib/db-migrations.ts - Types: TypeScript interfaces in
src/lib/types.ts - Configuration: Default configs in
src/lib/default-config.ts - Cron Service:
src/cron-service/(runs on port 8667 dev, 9667 prod) - Scripts: Utility scripts in
scripts/directory - Security: CSRF protection in
src/lib/csrf-middleware.ts, usewithCSRFmiddleware for protected endpoints
Testing & Debugging
- Test data generation:
pnpm generate-test-data --servers=N - Notification testing:
/api/notifications/testendpoint - Cron health checks:
curl http://localhost:8667/healthorcurl http://localhost:8666/api/cron/health - Overdue backup testing: Settings → Backup monitoring (Test overdue backups), or
POST /api/notifications/check-overduewith authentication - Development mode: verbose logging and JSON file storage
- Database maintenance: use maintenance menu for cleanup operations
- Pre-checks:
scripts/pre-checks.shfor troubleshooting startup issues
Development References
- API endpoints: See API Reference
- Database schema: See Database Schema
- Follow patterns in
src/lib/db-utils.tsfor database operations
Frameworks & Libraries
info
For exact versions, see package.json (dependencies, devDependencies, engines, and packageManager). The list below is intentionally version-light so it stays accurate across dependency upgrades.
Runtime & Package Management
- Node.js (see
engines.node) - pnpm (enforced via the
preinstallscript; seeengines.pnpm/packageManager)
Core Frameworks & Libraries
- Next.js (App Router)
- React & React-DOM
- Radix UI (
@radix-ui/react-*primitives) - Tailwind CSS v4 + tailwindcss-animate
- better-sqlite3
- Recharts, react-day-picker, react-hook-form, react-datepicker
- lucide-react, clsx, class-variance-authority
- date-fns, uuid
- bcrypt
- express (cron service), node-cron
- nodemailer, qrcode
- ai-i18n-tools, i18next, react-i18next (UI + docs translation pipeline)
Type Checking & Linting
- TypeScript (strict mode)
- TSX (for running TypeScript scripts)
- ESLint (flat config
eslint.config.mjs+eslint-config-next; run viapnpm lint→eslint .) - webpack
Build & Deployment
- Next.js standalone output (
output: 'standalone') with container entrypoint startingserver.js - Docker (node:alpine base) with multi-architecture builds (AMD64, ARM64)
- GitHub Actions workflows for CI/CD
- Inkscape for logos and pictures
- Docusaurus for documentation
- Greenfish Icon Editor for icons
Project Configuration
tsconfig.json,next.config.ts,tailwind.config.ts,postcss.config.mjspnpm-workspace.yaml,components.json(shadcn/ui)
System Features
- Cron Service: Separate service for scheduled tasks, started by
docker-entrypoint.shin Docker deployments - Notifications: ntfy.sh integration and SMTP email (nodemailer), configurable templates
- Auto-refresh: Configurable automatic refresh for dashboard and detail pages