How bharatstack/civicsort-labs works
CivicSort Labs is a web application for civic waste services and broader environmental programs. The visible entry flow checks authentication, presents sign-in/profile setup when needed, and routes authenticated users to dashboards and feature pages. Product branches include citizen/ward reporting, waste and credit marketplaces, ESG reporting, green bonds, microfinance, and water trading. The README describes an older PHP pickup-and-wallet product, so the architecture below follows the supplied React/TypeScript tree. Unsampled feature internals are represented by their existing page paths; their implementation details and connections are not assumed.
Main entry points: App.tsx App routing · EnhancedAuth.tsx Authentication · CitizenReports.tsx Citizen reports · client.ts Supabase client
Components 25
App and access
- App routing
src/App.tsx - Authentication
src/pages/EnhancedAuth.tsx - Secure auth form
src/components/auth/SecureAuthForm.tsx - Profile setup
src/components/auth/ProfileSetup.tsx - Session state
src/hooks/useAuth.tsx - User dashboard
src/pages/Dashboard.tsx
Civic waste services
- Citizen reports
src/pages/CitizenReports.tsx - Report details
src/pages/CitizenReportDetails.tsx - New report
src/pages/NewCitizenReport.tsx - Ward reference data
src/data/bbmpWards.ts - Waste entry
src/pages/WasteEntry.tsx - Route optimization
src/pages/RouteOptimization.tsx
Environmental markets
- General marketplace
src/pages/Marketplace.tsx - Carbon credit trading
src/pages/CarbonCreditTrading.tsx - Plastic credit market
src/pages/PlasticCreditMarketplace.tsx - Green bonds
src/pages/GreenBonds.tsx - Microfinance
src/pages/MicroFinance.tsx - Water credit trading
src/pages/WaterCreditTrading.tsx
Enterprise sustainability
- ESG reporting tools
src/pages/ESGReportingTools.tsx - ESG compliance
src/pages/ESGReportingCompliance.tsx - Reporting engine
src/components/esg/ESGReportingEngine.tsx - Government dashboard
src/components/government/GovernmentDashboard.tsx
Data and platform
- Supabase client
src/integrations/supabase/client.ts
Other components
- User
- Supabase service
Connections 18
- User → App routing: opens app
src/App.tsx - App routing → Authentication: shows when signed out
src/App.tsx - App routing → User dashboard: routes after sign-in
src/App.tsx - App routing → Citizen reports: routes to reports
src/App.tsx - App routing → New report: routes to report form
src/App.tsx - App routing → Report details: routes to report details
src/App.tsx - App routing → Plastic credit market: routes to market
src/App.tsx - App routing → Route optimization: routes to routing
src/App.tsx - Authentication → Secure auth form: renders sign-in
src/pages/EnhancedAuth.tsx - Authentication → Profile setup: renders profile setup
src/pages/EnhancedAuth.tsx - Authentication → Government dashboard: renders for government users
src/pages/EnhancedAuth.tsx - Authentication → Supabase client: checks profile and session
src/pages/EnhancedAuth.tsx - Session state → Supabase client: reads session
src/hooks/useAuth.tsx - Citizen reports → Ward reference data: uses ward data
src/pages/CitizenReports.tsx - Citizen reports → Report details: links report detail view
- Microfinance → Session state: uses session state
src/pages/MicroFinance.tsx - ESG reporting tools → Reporting engine: hosts reporting engine
- Supabase client → Supabase service: connects to
src/integrations/supabase/client.ts