How varunikashrees/carbonbuddy_by_techtrio works
CarbonBuddy is a personal carbon-footprint tracker that turns spending records into emissions estimates and visual insights. Users sign in, add or upload transactions, review dashboard trends, and manage goals, offsets, settings, and committed action plans. The principal flow is routed by the home page and relies on shared user state backed by browser storage and Supabase. Smart-insight capabilities are represented, but the sampled excerpts do not establish their exact API wiring.
Main entry points: UserContext.tsx User context · AppShell.tsx App navigation · page.tsx Home router · Offset.tsx Goals and offsets
Components 17
User experience
- Home router
src/app/page.tsx - Sign-in
src/components/Login.tsx - App navigation
src/components/AppShell.tsx - Transactions
src/components/Transactions.tsx - Preferences
src/components/Settings.tsx
Carbon insights
- Dashboard
src/components/Dashboard.tsx - Goals and offsets
src/components/Offset.tsx - Action plans
src/components/CommittedActionPlans.tsx - Insights endpoint
src/app/api/insights/route.ts
User state and storage
- User context
src/lib/UserContext.tsx - Emissions and local storage
src/lib/storage.ts - Supabase client
src/lib/supabase.ts - Domain data types
src/lib/types.ts
Shared interface
- Context providers
src/components/Providers.tsx - UI primitives
src/components/ui/button.tsx
Other components
- Person
- Supabase
Connections 24
- Person → Home router: opens
src/app/page.tsx - Home router → User context: reads state
src/app/page.tsx - Home router → Sign-in: routes unauthenticated
src/app/page.tsx - Home router → App navigation: renders authenticated
src/app/page.tsx - App navigation → Dashboard: renders
src/app/page.tsx - App navigation → Transactions: renders
src/app/page.tsx - App navigation → Goals and offsets: renders
src/app/page.tsx - App navigation → Preferences: renders
src/app/page.tsx - Sign-in → User context: uses auth state
src/components/Login.tsx - Transactions → User context: updates records
src/components/Transactions.tsx - Transactions → Emissions and local storage: calculates emissions
src/components/Transactions.tsx - Dashboard → User context: reads user data
src/components/Dashboard.tsx - Goals and offsets → User context: updates goals
src/components/Offset.tsx - Goals and offsets → Action plans: renders plans
src/components/Offset.tsx - Preferences → User context: updates preferences
src/components/Settings.tsx - User context → Emissions and local storage: loads and saves
src/lib/UserContext.tsx - User context → Supabase client: uses client
src/lib/UserContext.tsx - Supabase client → Supabase: connects
- User context → Domain data types: uses schemas
src/lib/UserContext.tsx - Emissions and local storage → Domain data types: uses schemas
src/lib/storage.ts - Context providers → User context: provides context
src/components/Providers.tsx - Dashboard → Insights endpoint: may request insights
- Goals and offsets → Insights endpoint: may request insights
- App navigation → UI primitives: uses controls
src/components/AppShell.tsx