How adarshreddy13/etp_sludgeops works
This repository appears to implement an ETP sludge-operations application: users record sludge generation, manage batches through characterisation and dewatering, track storage and dispatch, and review compliance. A React frontend also exposes regulatory AI assistance, while a TypeScript API provides document, rule, authorisation, obligation, compliance, and AI endpoints. The Python backend is a separate additional service in the tree. The README is only a Vite template; unsampled modules are included where the source index identifies them, but their internal behavior and wiring are not assumed.
Main entry points: App.tsx Application shell · index.ts TypeScript API entry · database.ts Regulatory data store · documents.ts Document endpoints
Components 34
Operations frontend
- Application shell
src/App.tsx - Data table
src/components/common/DataTable.tsx - KPI cards
src/components/common/KPICard.tsx - AI analysis panel
src/components/common/GroqAIPanel.tsx - Regulatory assistant
src/components/common/RagAssistantModal.tsx - AI API client
src/services/groqService.ts
Sludge operations
- Operations state
src/context/ETPContext.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 centre
src/components/modules/ComplianceCenterView.tsx - Plant design
src/components/modules/Plant3DDesignView.tsx - Operations dashboard
src/components/modules/DashboardView.tsx - Operational calculations
src/utils/calculations.ts
Regulatory services
- TypeScript API entry
server/src/index.ts - Document endpoints
server/src/routes/documents.ts - Rule endpoints
server/src/routes/rules.ts - Authorisation endpoints
server/src/routes/authorisations.ts - Obligation endpoints
server/src/routes/obligations.ts - Compliance endpoints
server/src/routes/compliance.ts - AI endpoints
server/src/routes/ai.ts - Compliance evaluation
server/src/services/complianceEngine.ts - Regulatory retrieval
server/src/services/ragEngine.ts - Groq generation
server/src/services/groqAiService.ts - PDF extraction
server/src/services/pdfExtractor.ts - Rule extraction
server/src/services/ruleExtractor.ts - Python API service
backend/main.py
Persistence and models
- Regulatory data store
server/src/db/database.ts - Supabase reports
server/src/services/supabaseService.ts - Regulatory data types
server/src/models/types.ts - Python data access
backend/db.py
Other components
- Facility operator
- Frontend API
Connections 44
- Facility operator → Application shell: uses
src/App.tsx - Application shell → Operations state: provides state
src/App.tsx - Application shell → Operations dashboard: selects view
src/App.tsx - Application shell → Sludge generation: selects view
src/App.tsx - Application shell → Batch characterisation: selects view
src/App.tsx - Application shell → Dewatering: selects view
src/App.tsx - Application shell → Storage and dispatch: selects view
src/App.tsx - Application shell → Compliance centre: selects view
src/App.tsx - Application shell → Plant design: selects view
src/App.tsx - Sludge generation → Operations state: records operations
- Dewatering → Operational calculations: uses calculations
src/components/modules/DewateringView.tsx - Dewatering → Data table: renders table
src/components/modules/DewateringView.tsx - Dewatering → KPI cards: renders metrics
src/components/modules/DewateringView.tsx - Dewatering → AI analysis panel: renders analysis
src/components/modules/DewateringView.tsx - Storage and dispatch → Operations state: uses operations state
src/components/modules/StorageDisposalView.tsx - Storage and dispatch → Data table: renders table
src/components/modules/StorageDisposalView.tsx - Storage and dispatch → KPI cards: renders metrics
src/components/modules/StorageDisposalView.tsx - Regulatory assistant → AI API client: queries
src/components/common/RagAssistantModal.tsx - AI API client → Frontend API: posts AI requests
src/services/groqService.ts - Frontend API → TypeScript API entry: calls API
- TypeScript API entry → Document endpoints: registers route
server/src/index.ts - TypeScript API entry → Rule endpoints: registers route
server/src/index.ts - TypeScript API entry → Authorisation endpoints: registers route
server/src/index.ts - TypeScript API entry → Obligation endpoints: registers route
server/src/index.ts - TypeScript API entry → Compliance endpoints: registers route
server/src/index.ts - TypeScript API entry → AI endpoints: registers route
server/src/index.ts - Document endpoints → Regulatory data store: reads and writes
server/src/routes/documents.ts - Document endpoints → PDF extraction: extracts PDF
server/src/routes/documents.ts - Document endpoints → Rule extraction: extracts rules
server/src/routes/documents.ts - Document endpoints → Supabase reports: uses report service
server/src/routes/documents.ts - Rule endpoints → Regulatory data store: reads and writes
server/src/routes/rules.ts - Authorisation endpoints → Regulatory data store: reads and writes
server/src/routes/authorisations.ts - Obligation endpoints → Regulatory data store: reads and writes
server/src/routes/obligations.ts - Compliance endpoints → Compliance evaluation: evaluates compliance
server/src/routes/compliance.ts - Compliance evaluation → Regulatory data store: loads rules and saves findings
server/src/services/complianceEngine.ts - AI endpoints → Groq generation: requests generation
server/src/routes/ai.ts - AI endpoints → Regulatory retrieval: queries corpus
server/src/routes/ai.ts - AI endpoints → Supabase reports: uses report service
server/src/routes/ai.ts - Regulatory retrieval → Regulatory data store: loads regulatory records
server/src/services/ragEngine.ts - Python API service → Python data access: uses data access
backend/main.py - Document endpoints → Regulatory data types: uses document types
server/src/routes/documents.ts - Rule endpoints → Regulatory data types: uses rule types
server/src/routes/rules.ts - Obligation endpoints → Regulatory data types: uses obligation types
server/src/routes/obligations.ts - Regulatory data store → Regulatory data types: stores typed records
server/src/db/database.ts