How ayush2027-stack/coalgov-ai works
CoalGov AI is a mine-governance application for reviewing mine compliance, managing corrective actions, and conducting inspections with evidence and approval workflows. The principal path is the browser dashboard through tRPC procedures to domain data and persistent storage; inspection evidence also uses an external storage service. The sampled code supports the server wiring and several domain operations, but not the dashboard’s internal feature calls. The README is empty, so the UI’s other listed components are not treated as confirmed capabilities.
Main entry points: routers.ts Governance procedures · server.ts Express server · main.tsx Client bootstrap · db.ts Database access
Components 19
Browser application
- Client bootstrap
client/src/main.tsx - App shell
client/src/App.tsx - Governance dashboard
client/src/pages/Home.tsx - tRPC client
client/src/main.tsx
API and identity
- Express server
server.ts - Request context
server/_core/context.ts - OAuth routes
server/_core/oauth.ts - Storage proxy
server/_core/storageProxy.ts
Governance workflows
- Governance procedures
server/routers.ts - System procedures
server/_core/systemRouter.ts - Mines and compliance
server/routers.ts - Inspection lifecycle
server/routers.ts - Actions and audit
server/routers.ts
Data and files
- Database access
server/db.ts - Governance schema
drizzle/schema.ts - Evidence storage
server/storage.ts
Other components
- Mine personnel
- MySQL database
- Forge storage API
Connections 18
- Mine personnel → Client bootstrap: uses
client/src/main.tsx - Client bootstrap → App shell: renders
client/src/main.tsx - App shell → Governance dashboard: renders
client/src/App.tsx - Client bootstrap → tRPC client: configures
client/src/main.tsx - Express server → OAuth routes: registers
server.ts - Express server → Storage proxy: registers
server.ts - Express server → Governance procedures: mounts
server.ts - Express server → Request context: creates context
server.ts - Governance procedures → System procedures: includes
server/routers.ts - Governance procedures → Mines and compliance: defines
server/routers.ts - Governance procedures → Inspection lifecycle: defines
server/routers.ts - Governance procedures → Actions and audit: defines
server/routers.ts - Governance procedures → Database access: queries and writes
server/routers.ts - Governance procedures → Evidence storage: uploads evidence
server/routers.ts - Database access → Governance schema: uses tables
server/db.ts - Database access → MySQL database: reads and writes
server/db.ts - Evidence storage → Forge storage API: requests upload URLs
server/storage.ts - Storage proxy → Forge storage API: requests download URL
server/_core/storageProxy.ts