How samudralaajaykumarrr/carbon-credits works
EcoCommute Credits is a role-based commuting and carbon-credit application. Users authenticate, join an approved organization, record commutes, and view earned credits; organization and system administrators manage members and organization approvals. Organization administrators can also trade credits through a marketplace, with analytics dashboards for organizational and system views. The graph follows the documented product capabilities and sampled client/server entry points; detailed wiring for unsampled dashboard and commute components is not asserted.
Main entry points: queryClient.ts API query client · App.tsx Role-based router · routes.ts REST API routes · auth-page.tsx Login and registration
Components 19
Web application
- Role-based router
client/src/App.tsx - Login and registration
client/src/pages/auth-page.tsx - Auth session state
client/src/hooks/use-auth.tsx - API query client
client/src/lib/queryClient.ts - Employee dashboard
client/src/pages/employee-dashboard.tsx - Organization admin
client/src/pages/org-admin-dashboard.tsx - System admin
client/src/pages/system-admin-dashboard.tsx - Commute entry
client/src/components/commute-log-form.tsx - Commute distance
client/src/components/commute-distance-modal.tsx
API and domain
- REST API routes
server/routes.ts - Server authentication
server/auth.ts - Credit calculation
shared/utils.ts
Persistence and models
- Storage operations
server/sqlite-storage.ts - SQLite database
server/db.ts - Domain data models
shared/schema.ts
Marketplace and analytics
- Credit marketplace
client/src/components/marketplace.tsx - Organization analytics
client/src/components/analytics-dashboard.tsx - System analytics
client/src/components/system-analytics-dashboard.tsx
Other components
- Employee or admin
Connections 25
- Employee or admin → Role-based router: uses
- Role-based router → Login and registration: routes to
- Role-based router → Employee dashboard: selects by role
- Role-based router → Organization admin: selects by role
- Role-based router → System admin: selects by role
- Role-based router → Auth session state: provides auth
- Login and registration → Auth session state: submits credentials
- Login and registration → API query client: loads organizations
- Auth session state → API query client: sends auth requests
- Employee dashboard → Commute entry: records commutes
- Employee dashboard → Commute distance: sets distance
- Commute entry → API query client: submits log
- Commute distance → API query client: updates distance
- API query client → REST API routes: requests API
- REST API routes → Server authentication: sets up authentication
- REST API routes → Storage operations: reads and writes
- REST API routes → Credit calculation: calculates credits
- Storage operations → SQLite database: persists records
- Storage operations → Domain data models: uses domain models
- Organization admin → Credit marketplace: manages listings
- Credit marketplace → API query client: loads and trades
- Organization admin → Organization analytics: views analytics
- System admin → System analytics: views analytics
- Organization analytics → API query client: loads metrics
- System analytics → API query client: loads metrics