Platform Operations
Start, stop, monitor, and validate the NaaP platform services.
Service Architecture#
The NaaP platform consists of these services:
| Service | Port | Description |
|---|---|---|
| Next.js Shell | 3000 | Main web application (hosts plugins) |
| Base Service | 4000 | Core API (auth, teams, plugin registry) |
| Plugin Server | 3100 | Plugin asset server + CDN proxy |
| PostgreSQL | 5432 | Unified database (Docker) |
| Plugin Backends | 4001-4012 | Per-plugin Express APIs |
Starting Services#
Shell + Core (Default)#
Starts: Database, Base Service, Plugin Server, Next.js Shell. Plugins are served as static UMD bundles -- no plugin backends needed for basic operation.
Everything#
Starts all of the above plus all 11 plugin backends.
Dev Mode (Single Plugin)#
Starts shell + core + one plugin with hot-reload frontend and live backend.
Services Only (No Frontend)#
Starts core services and all plugin backends without the Next.js shell.
Stopping Services#
All services receive SIGTERM simultaneously for parallel shutdown.
Services get 5 seconds for graceful shutdown before force-kill.
Set GRACEFUL_TIMEOUT=<seconds> environment variable to customize (e.g., GRACEFUL_TIMEOUT=15 ./bin/stop.sh).
Monitoring#
Status Dashboard#
Shows all running services with PID, uptime, and port information.
Live Watch#
Auto-refreshing status dashboard (default: every 5 seconds). Press Ctrl+C to exit.
Tail Logs#
Log files are stored in the logs/ directory.
Validation#
Runs a comprehensive health check covering:
- Core Services -- HTTP health endpoints for Base Service, Plugin Server, Shell
- Plugin Backends -- Health endpoints for each running plugin backend
- Plugin CDN Assets -- Verifies all 11 UMD bundles are accessible via CDN
- Plugin .env Files -- Ensures all DATABASE_URLs point to the unified database
- Database Schemas -- Checks all PostgreSQL schemas exist
- Core API Endpoints -- Verifies auth, feature flags, plugins, marketplace, health APIs
Interpreting Results#
| Status | Meaning |
|---|---|
| PASS | Service or check is healthy |
| SKIP | Service not running (expected if not started) |
| FAIL | Something is broken (action needed) |
A clean validation shows: 38 passed, 0 failed.
Database Operations#
Prisma Studio (Visual DB Editor)#
Opens a visual database editor at http://localhost:5555.
Reset Database#
View Schemas#
Plugin Build Operations#
Plugin UMD bundles are output to plugins/<name>/frontend/dist/production/<name>.js
and served via CDN at http://localhost:3000/cdn/plugins/<name>/1.0.0/<name>.js.