# keepudihemanth/subtracker architecture

> Architecture diagram of the GitHub repository keepudihemanth/subtracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keepudihemanth/subtracker
- Repository: https://github.com/keepudihemanth/subtracker

## Overview

SubTracker lets users register or log in, then manage subscriptions and review spending and upcoming renewals in a dashboard. The React app routes users through authentication and subscription screens; its API calls reach Express routes, which authenticate requests and read or write MongoDB models. The backend also exposes a reminder-email endpoint. The README documents expense insights and reminders, though the sampled code does not show a separate analytics stage. Frontend-to-backend HTTP links follow the documented API behavior; unsampled UI details are represented by their existing component paths.

Main entry points: [`backend/server.js`](https://github.com/keepudihemanth/subtracker/blob/main/backend/server.js) (Reminder endpoint), [`frontend/src/App.jsx`](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/components/Dashboard.jsx`](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/Dashboard.jsx) (Subscription dashboard), [`backend/routes/subscriptions.js`](https://github.com/keepudihemanth/subtracker/blob/main/backend/routes/subscriptions.js) (Subscription routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web app"]
  node_app["App routing<br/>[App.jsx]"]
  node_authui["Login and register"]
  node_authclient["Auth API client<br/>[auth.js]"]
  node_dashboard["Subscription dashboard<br/>[Dashboard.jsx]"]
  node_subform["Subscription form"]
  node_sublist["Subscription list"]
  node_landing["Landing and about"]
  node_subclient["Subscription API client<br/>[subscriptions.js]"]
end

subgraph group_api["Backend API"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_subroutes["Subscription routes<br/>[subscriptions.js]"]
  node_reminder["Reminder endpoint<br/>[server.js]"]
  node_mailer["Email delivery<br/>[mailer.js]"]
end

subgraph group_data["Persistence and security"]
  node_authmw["JWT middleware<br/>[auth.js]"]
  node_userdb[("User records<br/>[User.js]")]
  node_subdb[("Subscription records<br/>[Subscriptions.js]")]
end

node_user(("User"))
node_mongo[("MongoDB")]
node_mailservice["Gmail SMTP"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_dashboard
node_app -->|"renders"| node_landing
node_authui -->|"submits credentials"| node_authclient
node_authui -->|"returns auth state"| node_app
node_authclient -->|"HTTP requests"| node_authroutes
node_dashboard -->|"renders"| node_subform
node_dashboard -->|"renders"| node_sublist
node_dashboard -.->|"manages subscriptions"| node_subclient
node_subclient -.->|"HTTP requests"| node_subroutes
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_subroutes
node_authroutes -->|"reads and writes"| node_userdb
node_subroutes -->|"protects routes"| node_authmw
node_subroutes -->|"reads and writes"| node_subdb
node_userdb -.->|"persists in"| node_mongo
node_subdb -.->|"persists in"| node_mongo
node_server -->|"registers endpoint"| node_reminder
node_reminder -->|"authenticates with"| node_authmw
node_reminder -->|"loads subscription"| node_subdb
node_reminder -->|"loads user"| node_userdb
node_reminder -->|"sends reminder"| node_mailer
node_mailer -->|"sends email"| node_mailservice
node_user -.->|"enters details"| node_subform

click node_app "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/keepudihemanth/subtracker/tree/main/frontend/src/components"
click node_authclient "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/api/auth.js"
click node_dashboard "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/Dashboard.jsx"
click node_subform "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/SubscriptionForm.jsx"
click node_sublist "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/SubscriptionList.jsx"
click node_landing "https://github.com/keepudihemanth/subtracker/tree/main/frontend/src/components"
click node_subclient "https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/api/subscriptions.js"
click node_server "https://github.com/keepudihemanth/subtracker/blob/main/backend/server.js"
click node_authroutes "https://github.com/keepudihemanth/subtracker/blob/main/backend/routes/auth.js"
click node_subroutes "https://github.com/keepudihemanth/subtracker/blob/main/backend/routes/subscriptions.js"
click node_reminder "https://github.com/keepudihemanth/subtracker/blob/main/backend/server.js"
click node_mailer "https://github.com/keepudihemanth/subtracker/blob/main/backend/utils/mailer.js"
click node_authmw "https://github.com/keepudihemanth/subtracker/blob/main/backend/middleware/auth.js"
click node_userdb "https://github.com/keepudihemanth/subtracker/blob/main/backend/models/User.js"
click node_subdb "https://github.com/keepudihemanth/subtracker/blob/main/backend/models/Subscriptions.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authui,node_authclient,node_dashboard,node_subform,node_sublist,node_landing,node_subclient,node_user toneBlue
class node_server,node_authroutes,node_subroutes,node_reminder,node_mailer,node_mongo toneAmber
class node_authmw,node_userdb,node_subdb toneMint
class node_mailservice toneIndigo
```

## Components

### Web app

- [App routing](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and register](https://github.com/keepudihemanth/subtracker/tree/main/frontend/src/components): `frontend/src/components`
- [Auth API client](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/api/auth.js): `frontend/src/api/auth.js`
- [Subscription dashboard](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/Dashboard.jsx): `frontend/src/components/Dashboard.jsx`
- [Subscription form](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/SubscriptionForm.jsx): `frontend/src/components/SubscriptionForm.jsx`
- [Subscription list](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/components/SubscriptionList.jsx): `frontend/src/components/SubscriptionList.jsx`
- [Landing and about](https://github.com/keepudihemanth/subtracker/tree/main/frontend/src/components): `frontend/src/components`
- [Subscription API client](https://github.com/keepudihemanth/subtracker/blob/main/frontend/src/api/subscriptions.js): `frontend/src/api/subscriptions.js`

### Backend API

- [Express server](https://github.com/keepudihemanth/subtracker/blob/main/backend/server.js): `backend/server.js`
- [Authentication routes](https://github.com/keepudihemanth/subtracker/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Subscription routes](https://github.com/keepudihemanth/subtracker/blob/main/backend/routes/subscriptions.js): `backend/routes/subscriptions.js`
- [Reminder endpoint](https://github.com/keepudihemanth/subtracker/blob/main/backend/server.js): `backend/server.js`
- [Email delivery](https://github.com/keepudihemanth/subtracker/blob/main/backend/utils/mailer.js): `backend/utils/mailer.js`

### Persistence and security

- [JWT middleware](https://github.com/keepudihemanth/subtracker/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User records](https://github.com/keepudihemanth/subtracker/blob/main/backend/models/User.js): `backend/models/User.js`
- [Subscription records](https://github.com/keepudihemanth/subtracker/blob/main/backend/models/Subscriptions.js): `backend/models/Subscriptions.js`

### Other components

- **User**
- **MongoDB**
- **Gmail SMTP**

## Connections

- User → App routing: uses (evidence: `README.md`)
- App routing → Login and register: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Subscription dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Landing and about: renders (evidence: `frontend/src/App.jsx`)
- Login and register → Auth API client: submits credentials (evidence: `frontend/src/components/AuthPage.jsx`)
- Login and register → App routing: returns auth state (evidence: `frontend/src/App.jsx`)
- Auth API client → Authentication routes: HTTP requests (evidence: `frontend/src/api/auth.js`)
- Subscription dashboard → Subscription form: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- Subscription dashboard → Subscription list: renders (evidence: `frontend/src/components/Dashboard.jsx`)
- Subscription dashboard → Subscription API client: manages subscriptions
- Subscription API client → Subscription routes: HTTP requests
- Express server → Authentication routes: mounts routes (evidence: `backend/server.js`)
- Express server → Subscription routes: mounts routes (evidence: `backend/server.js`)
- Authentication routes → User records: reads and writes (evidence: `backend/routes/auth.js`)
- Subscription routes → JWT middleware: protects routes (evidence: `backend/routes/subscriptions.js`)
- Subscription routes → Subscription records: reads and writes (evidence: `backend/routes/subscriptions.js`)
- User records → MongoDB: persists in
- Subscription records → MongoDB: persists in
- Express server → Reminder endpoint: registers endpoint (evidence: `backend/server.js`)
- Reminder endpoint → JWT middleware: authenticates with (evidence: `backend/server.js`)
- Reminder endpoint → Subscription records: loads subscription (evidence: `backend/server.js`)
- Reminder endpoint → User records: loads user (evidence: `backend/server.js`)
- Reminder endpoint → Email delivery: sends reminder (evidence: `backend/server.js`)
- Email delivery → Gmail SMTP: sends email (evidence: `backend/utils/mailer.js`)
- User → Subscription form: enters details
