How dsragul/green-habit-tracker works
This is an eco-habits rewards app: users track sustainability impact, submit proof of completed tasks, earn points and achievements, and redeem rewards. The React app initializes its client state from sample data and presents dashboard, task, reward, leaderboard, achievement, and settings views; the server provides API routes, persists shared app state in Firestore, and initializes Gemini for AI features. Gmail impact-report sharing is also represented. The excerpts do not show all client-to-server calls or the complete verification flow, so those links are omitted rather than inferred.
Main entry points: App.tsx App state · server.ts API server · GmailShareModal.tsx Gmail sharing · initialData.ts Initial data
Components 19
App experience
- App state
App.tsx - Initial data
initialData.ts - Navigation
Navbar.tsx - Notifications
Toast.tsx - Account settings
SettingsPage.tsx
Eco engagement
- Task verification
TaskVerificationFlow.tsx - Impact dashboard
UserDashboard.tsx - Reward center
RewardCenter.tsx - Leaderboard
LeaderboardView.tsx - Achievements
AchievementsView.tsx - AI chat
AIChatbot.tsx
Server services
- API server
server.ts - App state store
server.ts - Gemini AI
- Firestore
Impact sharing
- Gmail sharing
GmailShareModal.tsx - Google sign-in
- Gmail API
Other components
- Eco user
Connections 17
- Eco user → App state: uses
- App state → Initial data: initializes from
App.tsx - App state → Navigation: renders
App.tsx - App state → Notifications: renders
App.tsx - App state → Impact dashboard: renders
App.tsx - App state → Task verification: renders
App.tsx - App state → Reward center: renders
App.tsx - App state → Leaderboard: renders
App.tsx - App state → Achievements: renders
App.tsx - App state → Account settings: renders
App.tsx - App state → API server: posts state
App.tsx - App state → API server: posts chat
App.tsx - API server → App state store: reads and writes
server.ts - API server → Firestore: loads and seeds
server.ts - API server → Gemini AI: initializes
server.ts - Gmail sharing → Google sign-in: signs in with
GmailShareModal.tsx - Gmail sharing → Gmail API: fetches profile and sends
GmailShareModal.tsx