How mohammedhuzef/etp_sludgeops works
This is an ETP sludge-operations application with a React workflow for generation, characterisation, dewatering, storage/disposal and compliance, alongside an Express regulatory/AI backend. The frontend context coordinates operational state; backend routes expose regulatory data and AI services. The README is only a Vite template and documents no product capabilities. Some major views and services are indexed but unsampled, so their internal behavior and unshown connections are omitted.
Main entry points: App.tsx Application Router · ETPContext.tsx ETP State Context · ComplianceCenterView.tsx Compliance Center · documents.ts Documents Route
Components 29
Operations UI
- Application Router
src/App.tsx - Operations Dashboard
src/components/modules/DashboardView.tsx - Sludge Generation
src/components/modules/SludgeGenerationView.tsx - Batch Characterisation
src/components/modules/CharacterisationView.tsx - Dewatering
src/components/modules/DewateringView.tsx - Storage and Dispatch
src/components/modules/StorageDisposalView.tsx - Compliance Center
src/components/modules/ComplianceCenterView.tsx - Plant Design
src/components/modules/Plant3DDesignView.tsx - Navigation and Alerts
src/components/layout/Sidebar.tsx - AI API Client
src/services/groqService.ts - Regulatory Assistant
src/components/common/RagAssistantModal.tsx - AI Advice Panel
src/components/common/GroqAIPanel.tsx
Operational Data
- ETP State Context
src/context/ETPContext.tsx - Operational Calculations
src/utils/calculations.ts - Initial Sample Data
src/utils/mockData.ts - Operational Types
src/types/index.ts
Regulatory API
- HTTP Server and Routes
server/src/index.ts - Compliance Route
server/src/routes/compliance.ts - Documents Route
server/src/routes/documents.ts - AI Route
server/src/routes/ai.ts
Compliance and AI
- Compliance Evaluator
server/src/services/complianceEngine.ts - Regulatory RAG
server/src/services/ragEngine.ts - Server AI Service
server/src/services/groqAiService.ts - PDF Extraction
server/src/services/pdfExtractor.ts - Rule Extraction
server/src/services/ruleExtractor.ts
Persistence
- Regulatory Data Store
server/src/db/database.ts - Supabase Report Service
server/src/services/supabaseService.ts
Other components
- Operator
- Supabase
Connections 35
- Operator → Application Router: uses
src/App.tsx - Application Router → Operations Dashboard: routes to
src/App.tsx - Application Router → Sludge Generation: routes to
src/App.tsx - Application Router → Batch Characterisation: routes to
src/App.tsx - Application Router → Dewatering: routes to
src/App.tsx - Application Router → Storage and Dispatch: routes to
src/App.tsx - Application Router → Compliance Center: routes to
src/App.tsx - Application Router → Plant Design: routes to
src/App.tsx - Application Router → ETP State Context: provides state
src/App.tsx - ETP State Context → Initial Sample Data: loads defaults
src/context/ETPContext.tsx - ETP State Context → Operational Calculations: evaluates metrics
src/context/ETPContext.tsx - ETP State Context → Operational Types: uses types
src/context/ETPContext.tsx - Dewatering → Operational Calculations: calculates
src/components/modules/DewateringView.tsx - Dewatering → ETP State Context: reads state
src/components/modules/DewateringView.tsx - Storage and Dispatch → ETP State Context: reads state
src/components/modules/StorageDisposalView.tsx - Compliance Center → ETP State Context: reads state
src/components/modules/ComplianceCenterView.tsx - Compliance Center → AI Advice Panel: renders
src/components/modules/ComplianceCenterView.tsx - Compliance Center → Regulatory Assistant: renders
src/components/modules/ComplianceCenterView.tsx - Compliance Center → AI API Client: requests advice
src/components/modules/ComplianceCenterView.tsx - Regulatory Assistant → AI API Client: queries
src/components/common/RagAssistantModal.tsx - AI API Client → AI Route: posts AI requests
src/services/groqService.ts - HTTP Server and Routes → Compliance Route: registers route
server/src/index.ts - HTTP Server and Routes → Documents Route: registers route
server/src/index.ts - HTTP Server and Routes → AI Route: registers route
server/src/index.ts - Compliance Route → Compliance Evaluator: runs evaluation
server/src/routes/compliance.ts - Compliance Evaluator → Regulatory Data Store: reads rules and saves findings
server/src/services/complianceEngine.ts - Documents Route → Regulatory Data Store: manages documents
server/src/routes/documents.ts - Documents Route → PDF Extraction: extracts PDF
server/src/routes/documents.ts - Documents Route → Rule Extraction: extracts rules
server/src/routes/documents.ts - Documents Route → Supabase Report Service: stores reports
server/src/routes/documents.ts - AI Route → Server AI Service: requests generation
server/src/routes/ai.ts - AI Route → Regulatory RAG: queries corpus
server/src/routes/ai.ts - AI Route → Supabase Report Service: uses report service
server/src/routes/ai.ts - Regulatory RAG → Regulatory Data Store: reads regulatory records
server/src/services/ragEngine.ts - Supabase Report Service → Supabase: accesses
server/src/services/supabaseService.ts