How jkep2004/tdp-capstone-2026 works
This is a customer-facing carbon and savings advisor: customers sign in, submit monthly spending, then view estimated emissions, category insights, recommendations, savings, trends, and challenges. The frontend calls a FastAPI API, which exposes domain routers and uses SQL storage; selected API services provide calculation and insight logic. The README documents the product capabilities, while several router and service implementations were not sampled, so those internal links are omitted where their call relationships cannot be verified.
Main entry points: main.py FastAPI application · App.tsx Application shell · api.ts API client · database.py SQL database
Components 26
Customer experience
- Application shell
frontend/src/app/App.tsx - Spending entry
frontend/src/features/spending/SpendingPage.tsx - Manual entry
frontend/src/features/spending/SpendingForm.tsx - CSV upload
frontend/src/features/spending/CsvUpload.tsx - Insights dashboard
frontend/src/features/insights/InsightsPage.tsx - Challenge experience
frontend/src/features/challenges/ChallengesPage.tsx - API client
frontend/src/services/api.ts
API and identity
- FastAPI application
api/src/main.py - Authentication
api/src/Routers/auth.py - Token validation
api/src/Core/auth.py - Spending endpoints
api/src/Routers/spend.py - Category endpoints
api/src/Routers/categories.py - Recommendation endpoints
api/src/Routers/recommendations.py - Challenge endpoints
api/src/Routers/challenges.py - Savings endpoints
api/src/Routers/savings.py - Summary endpoints
api/src/Routers/summary.py - Trend endpoints
api/src/Routers/trends.py - Challenge response
api/src/schemas/ChallengeResponse.py
Carbon and insights
- Carbon calculation
api/src/Services/carbon.py - Recommendations
api/src/Services/recommendations.py - Monthly summary
api/src/Services/summary.py - Progress trends
api/src/Services/trends.py - Challenge logic
api/src/Services/challenges.py
Persistence
- SQL database
api/database/database.py
Other components
- Customer
- Microsoft Entra
Connections 32
- Customer → Application shell: uses
frontend/src/app/App.tsx - Application shell → Microsoft Entra: signs in through
frontend/src/app/App.tsx - Application shell → Spending entry: opens
frontend/src/app/App.tsx - Application shell → Insights dashboard: shows
frontend/src/app/App.tsx - Application shell → Challenge experience: shows
frontend/src/app/App.tsx - Spending entry → Manual entry: renders
frontend/src/features/spending/SpendingPage.tsx - Spending entry → CSV upload: renders
frontend/src/features/spending/SpendingPage.tsx - Manual entry → API client: submits through
frontend/src/features/spending/SpendingForm.tsx - CSV upload → API client: submits through
frontend/src/features/spending/CsvUpload.tsx - Insights dashboard → API client: loads insights
frontend/src/features/insights/InsightsPage.tsx - Challenge experience → API client: loads challenges
frontend/src/features/challenges/ChallengesPage.tsx - API client → FastAPI application: requests API
- FastAPI application → Authentication: registers
api/src/main.py - FastAPI application → Spending endpoints: registers
api/src/main.py - FastAPI application → Category endpoints: registers
api/src/main.py - FastAPI application → Recommendation endpoints: registers
api/src/main.py - FastAPI application → Challenge endpoints: registers
api/src/main.py - FastAPI application → Savings endpoints: registers
api/src/main.py - FastAPI application → Summary endpoints: registers
api/src/main.py - FastAPI application → Trend endpoints: registers
api/src/main.py - Authentication → Token validation: validates token
api/src/Routers/auth.py - Authentication → SQL database: reads and writes
api/src/Routers/auth.py - Token validation → SQL database: provides dependency
api/src/Core/auth.py - Spending endpoints → SQL database: reads and writes
api/src/Routers/spend.py - Category endpoints → SQL database: reads
api/src/Routers/categories.py - Recommendation endpoints → Recommendations: delegates
api/src/Routers/recommendations.py - Challenge endpoints → Challenge logic: delegates
api/src/Routers/challenges.py - Challenge endpoints → Challenge response: returns
api/src/Routers/challenges.py - Carbon calculation → SQL database: uses
- Summary endpoints → Monthly summary: delegates
- Trend endpoints → Progress trends: delegates
- Savings endpoints → Monthly summary: uses