How nikatsg/mpc works
MPC is a browser-based maritime maintenance planner and communicator. Users monitor fleet condition and position, add vessels, review AI-assisted fault or document intake, approve supplier-order drafts, and plan repair-port routing. The graph separates dashboard workflows, maritime planning, API orchestration, domain services, and persistence/integrations. Edges are limited to relationships visible in excerpts or documented by the README; unsampled routes and component internals are represented without asserting their wiring.
Main entry points: ShipDashboard.tsx Ship dashboard · intake.service.ts Reviewed intake · order.service.ts Procurement orders · db.ts Database client
Components 29
Fleet dashboard
- Ship dashboard
client/src/components/ShipDashboard.tsx - Live fleet map
client/src/components/LiveMap.tsx - Ship health model
client/src/components/shipModel.tsx - Vessel state
client/src/hooks/useVessel.ts - Order state
client/src/hooks/useOrder.ts - AI chat
client/src/components/AiChat.tsx - PDF intake UI
client/src/components/AiPdfWorkflow.tsx - AI settings
client/src/components/AiSettingsPanel.tsx
Repair planning
- Port conditions
client/src/utils/portCalls.ts - Sea routing
client/src/utils/seaRouter.ts - Port weather
client/src/hooks/usePortWeather.ts
API and domain
- MPC API client
client/src/api/mpcApi.ts - API route registry
server/src/routes/index.ts - Vessel endpoints
server/src/controllers/vessel.controller.ts - Fleet and health
server/src/services/vessel.service.ts - Procurement orders
server/src/services/order.service.ts - Fault reports
server/src/services/report.service.ts - Reviewed intake
server/src/services/intake.service.ts - AI API workflows
server/src/routes/ai.route.ts
AI and communications
- AI providers
server/src/integrations/ai/aiProvider.ts - Document reader
server/src/integrations/ai/documentReader.ts - Supplier draft agent
server/src/integrations/ai/orderAgent.ts - Email delivery
server/src/integrations/email/nodemailer.ts
Persistence
- Database client
server/prisma/db.ts - SQLite store
server/prisma/databasePath.ts
Other components
- Fleet user
- AI services
- Mail systems
- Marine conditions service
Connections 37
- Fleet user → Ship dashboard: uses
README.md - Ship dashboard → Live fleet map: renders
client/src/components/ShipDashboard.tsx - Ship dashboard → Ship health model: uses
client/src/components/ShipDashboard.tsx - Ship dashboard → Vessel state: uses
client/src/components/ShipDashboard.tsx - Ship dashboard → Order state: uses
client/src/components/ShipDashboard.tsx - Ship dashboard → AI chat: renders
client/src/components/ShipDashboard.tsx - Ship dashboard → PDF intake UI: renders
client/src/components/ShipDashboard.tsx - Ship dashboard → AI settings: renders
client/src/components/ShipDashboard.tsx - Vessel state → MPC API client: requests fleet
client/src/hooks/useVessel.ts - Order state → MPC API client: requests orders
client/src/components/ShipDashboard.tsx - Live fleet map → MPC API client: loads vessel data
client/src/components/LiveMap.tsx - Live fleet map → Sea routing: routes vessels
client/src/components/LiveMap.tsx - Live fleet map → Port conditions: gets port calls
client/src/components/LiveMap.tsx - Port weather → Port conditions: gets conditions
client/src/hooks/usePortWeather.ts - Port conditions → Sea routing: uses port routes
client/src/utils/portCalls.ts - Port conditions → Marine conditions service: fetches conditions
- MPC API client → API route registry: calls API
- API route registry → Vessel endpoints: mounts endpoints
server/src/routes/index.ts - Vessel endpoints → Fleet and health: delegates fleet work
server/src/controllers/vessel.controller.ts - Fleet and health → Database client: reads and writes
server/src/services/vessel.service.ts - AI API workflows → AI providers: requests AI
server/src/app.ts - AI API workflows → Reviewed intake: handles reviewed intake
server/src/app.ts - AI API workflows → Procurement orders: generates drafts
server/src/app.ts - AI API workflows → Fault reports: processes reports
server/src/app.ts - Reviewed intake → Document reader: extracts documents
server/src/services/intake.service.ts - Reviewed intake → Procurement orders: prepares orders
server/src/services/intake.service.ts - Reviewed intake → Fleet and health: applies fault damage
server/src/services/intake.service.ts - Procurement orders → Supplier draft agent: drafts supplier emails
server/src/services/order.service.ts - Supplier draft agent → AI providers: requests AI
server/src/integrations/ai/orderAgent.ts - AI providers → AI services: calls provider
server/src/integrations/ai/aiProvider.ts - Document reader → AI providers: uses AI extraction
server/src/integrations/ai/documentReader.ts - Procurement orders → Email delivery: dispatches drafts
- Email delivery → Mail systems: sends mail
- Reviewed intake → Database client: stores reviews
server/src/services/intake.service.ts - Procurement orders → Database client: stores orders
server/src/services/order.service.ts - Fault reports → Database client: uses persistence
server/src/services/report.service.ts - Database client → SQLite store: opens database
server/prisma/db.ts