How danielc34/equipment-maintenance works
EMMS is a manufacturing equipment-maintenance platform. Users sign in, then work through role-protected equipment, maintenance, and downtime screens; server-side domain logic reads and changes operational records, while dashboards, reports, and audit views expose history and performance. The README describes a server-first Next.js architecture with Prisma and PostgreSQL, centralized RBAC, and optional Redis caching. Relationships below are limited to README statements and shown source references; unsampled routes and service internals are not inferred.
Main entry points: downtime.ts Downtime Services · prisma.ts Database Access · rbac.ts Authorization · page.tsx Maintenance Workflow
Components 23
Access and Shell
- App Shell
src/app/(app)/layout.tsx - Authentication
src/auth.ts - Authorization
src/server/rbac.ts - User Administration
src/app/(app)/admin/users/page.tsx
Plant Operations
- Equipment Registry
src/app/(app)/equipment/page.tsx - Equipment Services
src/server/equipment.ts - Maintenance Workflow
src/app/(app)/maintenance/page.tsx - Maintenance Services
src/server/maintenance.ts - Maintenance Mutations
src/server/actions/maintenance.ts - Downtime Tracking
src/app/(app)/downtime/page.tsx - Downtime Services
src/server/downtime.ts
Operational Insights
- Dashboard
src/app/(app)/dashboard/page.tsx - Dashboard Aggregates
src/server/dashboard.ts - Reports
src/app/(app)/reports/page.tsx - Reporting
src/server/reports.ts - Audit History
src/app/(app)/audit/page.tsx - Audit Services
src/server/audit.ts
Server Platform
- Input Validation
src/lib/validations.ts - Shared UI Components
src/components/ui - Database Access
src/lib/prisma.ts - PostgreSQL
- Redis Cache
Other components
- Plant User
Connections 30
- Plant User → App Shell: uses
- App Shell → Authentication: authenticates
- Equipment Registry → Equipment Services: requests data
src/app/(app)/equipment/page.tsx - Maintenance Workflow → Maintenance Services: requests data
src/app/(app)/maintenance/page.tsx - Maintenance Workflow → Input Validation: validates filters
src/app/(app)/maintenance/page.tsx - Maintenance Mutations → Maintenance Services: calls
src/server/actions/maintenance.ts - Maintenance Mutations → Audit Services: records changes
src/server/actions/maintenance.ts - Maintenance Mutations → Database Access: writes records
src/server/actions/maintenance.ts - Downtime Tracking → Downtime Services: requests data
src/app/(app)/downtime/page.tsx - Downtime Tracking → Maintenance Services: requests data
src/app/(app)/downtime/page.tsx - Dashboard → Dashboard Aggregates: loads overview
src/app/(app)/dashboard/page.tsx - Dashboard → Downtime Services: loads downtime
src/app/(app)/dashboard/page.tsx - Dashboard Aggregates → Downtime Services: uses metrics
src/server/dashboard.ts - Reports → Reporting: requests reports
src/app/(app)/reports/page.tsx - Reports → Downtime Services: requests downtime
src/app/(app)/reports/page.tsx - Audit History → Audit Services: loads history
src/app/(app)/audit/page.tsx - Audit History → Input Validation: validates filters
src/app/(app)/audit/page.tsx - Equipment Registry → Authorization: checks access
src/app/(app)/equipment/page.tsx - Maintenance Workflow → Authorization: checks access
src/app/(app)/maintenance/page.tsx - Downtime Tracking → Authorization: checks access
src/app/(app)/downtime/page.tsx - Dashboard → Authorization: checks access
src/app/(app)/dashboard/page.tsx - Maintenance Services → Database Access: queries records
src/server/maintenance.ts - Downtime Services → Database Access: queries records
src/server/downtime.ts - Dashboard Aggregates → Database Access: queries aggregates
src/server/dashboard.ts - Database Access → PostgreSQL: reads and writes
- Dashboard Aggregates → Redis Cache: caches aggregates
- Reporting → Redis Cache: caches aggregates
- Equipment Registry → Shared UI Components: renders controls
src/app/(app)/equipment/page.tsx - Maintenance Workflow → Shared UI Components: renders controls
src/app/(app)/maintenance/page.tsx - User Administration → Authorization: checks access