Skip to main content

Database Documentation

Overview​

NodePrism uses PostgreSQL as its primary database with Prisma as the ORM.

Connection​

DATABASE_URL=postgresql://user:password@localhost:5432/nodeprism

Migrations​

# Generate migration after schema changes
pnpm prisma migrate dev --name <migration_name>

# Apply migrations in production
pnpm prisma migrate deploy

# Reset database (development only)
pnpm prisma migrate reset

Key Models​

ModelPurpose
ServerMonitored server instances
AgentMonitoring agents (node_exporter, etc.)
AlertActive and historical alerts
MetricHistoryTime-series metric storage
EventLogSystem events and audit trail
UserAuthentication and authorization