How vignesh-2402/carbon-foot-print01 works
Carbon Footprint Awareness Platform: users authenticate, log activities, and view their emissions alongside goals, challenges, and comparisons. The React pages call an API service, which reaches Express routes; those routes own the domain operations and use MongoDB models, with activity logging also using the carbon calculator. The README documents personalized insights and data export as in progress; the tree shows a tips model but no export implementation. Edges reflect sampled calls, SOURCE INDEX references, or README statements; unsampled behavior is not inferred.
Main entry points: api.js API services · App.jsx App routing · server.js Express server · activities.js Activity routes
Components 30
Web application
- App routing
client/src/App.jsx - Login
client/src/pages/LoginPage.jsx - Registration
client/src/pages/RegisterPage.jsx - Google sign-in
client/src/components/GoogleAuthButton.jsx - Profile
client/src/pages/ProfilePage.jsx - Activities
client/src/pages/ActivitiesPage.jsx - Activity form
client/src/components/ActivityForm.jsx - Dashboard
client/src/pages/DashboardPage.jsx - Goals
client/src/pages/GoalsPage.jsx - Challenges
client/src/pages/ChallengesPage.jsx - API services
client/src/services/api.js
Identity
- Auth state
client/src/store.js - Authentication routes
server/routes/auth.js - OAuth routes
server/routes/oauth.js - Token verification
server/middleware/auth.js - User records
server/models/User.js
Footprint tracking
- Activity routes
server/routes/activities.js - Carbon calculator
server/utils/carbonCalculator.js - Activity records
server/models/Activity.js
Goals and community
- Goal routes
server/routes/goals.js - Goal records
server/models/Goal.js - Challenge routes
server/routes/challenges.js - Challenge records
server/models/Challenge.js - Statistics routes
server/routes/stats.js - Tip records
server/models/Tip.js
API and persistence
- Express server
server/server.js - MongoDB connection
server/config/database.js
Other components
- User
- MongoDB
- Google identity
Connections 48
- User → App routing: uses
README.md - App routing → Login: routes to
client/src/App.jsx - App routing → Registration: routes to
client/src/App.jsx - App routing → Activities: routes to
client/src/App.jsx - App routing → Dashboard: routes to
client/src/App.jsx - App routing → Goals: routes to
client/src/App.jsx - App routing → Challenges: routes to
client/src/App.jsx - App routing → Profile: routes to
client/src/App.jsx - App routing → Auth state: reads
client/src/App.jsx - Login → API services: calls
client/src/pages/LoginPage.jsx - Login → Auth state: updates
client/src/pages/LoginPage.jsx - Registration → API services: calls
client/src/pages/RegisterPage.jsx - Registration → Auth state: updates
client/src/pages/RegisterPage.jsx - Login → Google sign-in: renders
client/src/pages/LoginPage.jsx - Registration → Google sign-in: renders
client/src/pages/RegisterPage.jsx - Google sign-in → API services: verifies token
client/src/components/GoogleAuthButton.jsx - Google identity → Google sign-in: authenticates
README.md - Google sign-in → Auth state: updates
client/src/pages/LoginPage.jsx - Profile → API services: calls
client/src/pages/ProfilePage.jsx - Profile → Auth state: updates
client/src/pages/ProfilePage.jsx - Activities → API services: calls
client/src/pages/ActivitiesPage.jsx - Activities → Activity form: renders
client/src/pages/ActivitiesPage.jsx - Activity form → API services: calls
client/src/components/ActivityForm.jsx - Dashboard → API services: calls
client/src/pages/DashboardPage.jsx - Goals → API services: calls
client/src/pages/GoalsPage.jsx - Challenges → API services: calls
client/src/pages/ChallengesPage.jsx - API services → Authentication routes: requests
README.md - API services → OAuth routes: requests
client/src/services/api.js - API services → Activity routes: requests
README.md - API services → Goal routes: requests
README.md - API services → Challenge routes: requests
README.md - API services → Statistics routes: requests
README.md - Express server → Authentication routes: mounts
server/server.js - Express server → OAuth routes: mounts
server/server.js - Express server → Activity routes: mounts
server/server.js - Express server → Goal routes: mounts
server/server.js - Express server → Challenge routes: mounts
server/server.js - Express server → Statistics routes: mounts
server/server.js - Authentication routes → Token verification: protects profile
server/routes/auth.js - OAuth routes → Token verification: protects profile
server/routes/oauth.js - Authentication routes → User records: reads and writes
server/routes/auth.js - OAuth routes → User records: reads and writes
server/routes/oauth.js - Google identity → OAuth routes: verifies token
server/routes/oauth.js - Activity routes → Token verification: protects routes
server/routes/activities.js - Activity routes → Carbon calculator: calculates emissions
server/routes/activities.js - Activity routes → Activity records: reads and writes
server/routes/activities.js - Goal routes → Token verification: protects routes
server/routes/goals.js - Goal routes → Activity records: reads activity data
server/routes/goals.js