# mcrs101/my-project architecture

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

- Interactive diagram: https://gitdiagram.com/mcrs101/my-project
- Repository: https://github.com/mcrs101/my-project

## Overview

This is a personal-finance web application: users register or log in, then view financial summaries, record notes and savings, and review income/expense reports. The React client is routed through App.jsx; the Express server mounts API routes, whose controllers operate on user and finance models. The sampled report explicitly requests income and expense data and can export a PDF. Other page-to-API links and unsampled route details are not asserted; the README contains no product documentation.

Main entry points: [`frontend/src/App.jsx`](https://github.com/mcrs101/my-project/blob/main/frontend/src/App.jsx) (React routes), [`server.js`](https://github.com/mcrs101/my-project/blob/main/server.js) (Express API), [`Middleware/auth.js`](https://github.com/mcrs101/my-project/blob/main/Middleware/auth.js) (JWT verification), [`frontend/src/hooks/useAuthTimeout.js`](https://github.com/mcrs101/my-project/blob/main/frontend/src/hooks/useAuthTimeout.js) (Session timeout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["React routes<br/>[App.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_register["Registration<br/>[register.jsx]"]
  node_home["Overview<br/>[Home.jsx]"]
  node_savingsview["Savings view<br/>[Page1.jsx]"]
  node_notes["Notes view<br/>[์Note.jsx]"]
  node_report["Financial report<br/>[Report.jsx]"]
  node_timeout["Session timeout<br/>[useAuthTimeout.js]"]
end

subgraph group_identity["Identity and access"]
  node_api["Express API<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_authcontroller["Auth operations<br/>[auth.js]"]
  node_authmw["JWT verification<br/>[auth.js]"]
end

subgraph group_finance["Finance APIs"]
  node_expense["Expense operations<br/>[Con_expense.js]"]
  node_income["Income operations<br/>[Con_incomes.js]"]
  node_products["Product operations<br/>[Con_products.js]"]
  node_savings["Savings operations<br/>[Con_savings.js]"]
  node_expensroute["Expense routes<br/>[expense.js]"]
  node_incomeroute["Income routes<br/>[income.js]"]
  node_productroute["Product routes<br/>[products.js]"]
  node_savingsroute["Savings routes<br/>[savings.js]"]
end

subgraph group_data["Persistence"]
  node_users[("User model<br/>[user.js]")]
  node_expenses[("Expense model<br/>[Models_expenes.js]")]
  node_incomes[("Income model<br/>[Models_incomes.js]")]
  node_productmodel[("Product model<br/>[Models_products.js]")]
  node_savingsmodel[("Savings model<br/>[Models_savings.js]")]
  node_dbconfig["Mongo connection<br/>[db.js]"]
end

node_user(("Finance user"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_savingsview
node_app -->|"routes to"| node_notes
node_app -->|"routes to"| node_report
node_login -.->|"uses"| node_timeout
node_home -->|"uses"| node_timeout
node_savingsview -->|"uses"| node_timeout
node_report -->|"uses"| node_timeout
node_api -->|"connects"| node_dbconfig
node_api -->|"mounts routes"| node_authroutes
node_api -->|"mounts routes"| node_expensroute
node_api -->|"mounts routes"| node_incomeroute
node_api -->|"mounts routes"| node_productroute
node_api -->|"mounts routes"| node_savingsroute
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"imports"| node_authmw
node_authcontroller -->|"queries"| node_users
node_expensroute -->|"dispatches"| node_expense
node_expensroute -->|"checks token"| node_authmw
node_incomeroute -->|"dispatches"| node_income
node_incomeroute -->|"checks token"| node_authmw
node_productroute -->|"dispatches"| node_products
node_productroute -->|"checks token"| node_authmw
node_savingsroute -->|"dispatches"| node_savings
node_savingsroute -->|"checks token"| node_authmw
node_expense -->|"reads and writes"| node_expenses
node_income -->|"uses"| node_incomes
node_products -->|"uses"| node_productmodel
node_savings -->|"uses"| node_savingsmodel
node_report -->|"requests report data"| node_api

click node_app "https://github.com/mcrs101/my-project/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/register.jsx"
click node_home "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Home.jsx"
click node_savingsview "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Page1.jsx"
click node_notes "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/%E0%B9%8CNote.jsx"
click node_report "https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Report.jsx"
click node_timeout "https://github.com/mcrs101/my-project/blob/main/frontend/src/hooks/useAuthTimeout.js"
click node_api "https://github.com/mcrs101/my-project/blob/main/server.js"
click node_authroutes "https://github.com/mcrs101/my-project/blob/main/Routes/auth.js"
click node_authcontroller "https://github.com/mcrs101/my-project/blob/main/Controllers/auth.js"
click node_authmw "https://github.com/mcrs101/my-project/blob/main/Middleware/auth.js"
click node_expense "https://github.com/mcrs101/my-project/blob/main/Controllers/Con_expense.js"
click node_income "https://github.com/mcrs101/my-project/blob/main/Controllers/Con_incomes.js"
click node_products "https://github.com/mcrs101/my-project/blob/main/Controllers/Con_products.js"
click node_savings "https://github.com/mcrs101/my-project/blob/main/Controllers/Con_savings.js"
click node_expensroute "https://github.com/mcrs101/my-project/blob/main/Routes/expense.js"
click node_incomeroute "https://github.com/mcrs101/my-project/blob/main/Routes/income.js"
click node_productroute "https://github.com/mcrs101/my-project/blob/main/Routes/products.js"
click node_savingsroute "https://github.com/mcrs101/my-project/blob/main/Routes/savings.js"
click node_users "https://github.com/mcrs101/my-project/blob/main/Models/user.js"
click node_expenses "https://github.com/mcrs101/my-project/blob/main/Models/Models_expenes.js"
click node_incomes "https://github.com/mcrs101/my-project/blob/main/Models/Models_incomes.js"
click node_productmodel "https://github.com/mcrs101/my-project/blob/main/Models/Models_products.js"
click node_savingsmodel "https://github.com/mcrs101/my-project/blob/main/Models/Models_savings.js"
click node_dbconfig "https://github.com/mcrs101/my-project/blob/main/config/db.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_login,node_register,node_home,node_savingsview,node_notes,node_report,node_timeout,node_user toneBlue
class node_api,node_authroutes,node_authcontroller,node_authmw toneAmber
class node_expense,node_income,node_products,node_savings,node_expensroute,node_incomeroute,node_productroute,node_savingsroute toneMint
class node_users,node_expenses,node_incomes,node_productmodel,node_savingsmodel,node_dbconfig toneRose
```

## Components

### Web client

- [React routes](https://github.com/mcrs101/my-project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/register.jsx): `frontend/src/pages/register.jsx`
- [Overview](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Savings view](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Page1.jsx): `frontend/src/pages/Page1.jsx`
- [Notes view](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/%E0%B9%8CNote.jsx): `frontend/src/pages/์Note.jsx`
- [Financial report](https://github.com/mcrs101/my-project/blob/main/frontend/src/pages/Report.jsx): `frontend/src/pages/Report.jsx`
- [Session timeout](https://github.com/mcrs101/my-project/blob/main/frontend/src/hooks/useAuthTimeout.js): `frontend/src/hooks/useAuthTimeout.js`

### Identity and access

- [Express API](https://github.com/mcrs101/my-project/blob/main/server.js): `server.js`
- [Auth routes](https://github.com/mcrs101/my-project/blob/main/Routes/auth.js): `Routes/auth.js`
- [Auth operations](https://github.com/mcrs101/my-project/blob/main/Controllers/auth.js): `Controllers/auth.js`
- [JWT verification](https://github.com/mcrs101/my-project/blob/main/Middleware/auth.js): `Middleware/auth.js`

### Finance APIs

- [Expense operations](https://github.com/mcrs101/my-project/blob/main/Controllers/Con_expense.js): `Controllers/Con_expense.js`
- [Income operations](https://github.com/mcrs101/my-project/blob/main/Controllers/Con_incomes.js): `Controllers/Con_incomes.js`
- [Product operations](https://github.com/mcrs101/my-project/blob/main/Controllers/Con_products.js): `Controllers/Con_products.js`
- [Savings operations](https://github.com/mcrs101/my-project/blob/main/Controllers/Con_savings.js): `Controllers/Con_savings.js`
- [Expense routes](https://github.com/mcrs101/my-project/blob/main/Routes/expense.js): `Routes/expense.js`
- [Income routes](https://github.com/mcrs101/my-project/blob/main/Routes/income.js): `Routes/income.js`
- [Product routes](https://github.com/mcrs101/my-project/blob/main/Routes/products.js): `Routes/products.js`
- [Savings routes](https://github.com/mcrs101/my-project/blob/main/Routes/savings.js): `Routes/savings.js`

### Persistence

- [User model](https://github.com/mcrs101/my-project/blob/main/Models/user.js): `Models/user.js`
- [Expense model](https://github.com/mcrs101/my-project/blob/main/Models/Models_expenes.js): `Models/Models_expenes.js`
- [Income model](https://github.com/mcrs101/my-project/blob/main/Models/Models_incomes.js): `Models/Models_incomes.js`
- [Product model](https://github.com/mcrs101/my-project/blob/main/Models/Models_products.js): `Models/Models_products.js`
- [Savings model](https://github.com/mcrs101/my-project/blob/main/Models/Models_savings.js): `Models/Models_savings.js`
- [Mongo connection](https://github.com/mcrs101/my-project/blob/main/config/db.js): `config/db.js`

### Other components

- **Finance user**

## Connections

- Finance user → React routes: opens (evidence: `frontend/src/App.jsx`)
- React routes → Login: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Registration: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Overview: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Savings view: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Notes view: routes to (evidence: `frontend/src/App.jsx`)
- React routes → Financial report: routes to (evidence: `frontend/src/App.jsx`)
- Login → Session timeout: uses
- Overview → Session timeout: uses (evidence: `frontend/src/pages/Home.jsx`)
- Savings view → Session timeout: uses (evidence: `frontend/src/pages/Page1.jsx`)
- Financial report → Session timeout: uses (evidence: `frontend/src/pages/Report.jsx`)
- Express API → Mongo connection: connects (evidence: `server.js`)
- Express API → Auth routes: mounts routes (evidence: `server.js`)
- Express API → Expense routes: mounts routes (evidence: `server.js`)
- Express API → Income routes: mounts routes (evidence: `server.js`)
- Express API → Product routes: mounts routes (evidence: `server.js`)
- Express API → Savings routes: mounts routes (evidence: `server.js`)
- Auth routes → Auth operations: dispatches (evidence: `Routes/auth.js`)
- Auth routes → JWT verification: imports (evidence: `Routes/auth.js`)
- Auth operations → User model: queries (evidence: `Controllers/auth.js`)
- Expense routes → Expense operations: dispatches (evidence: `Routes/expense.js`)
- Expense routes → JWT verification: checks token (evidence: `Routes/expense.js`)
- Income routes → Income operations: dispatches (evidence: `Routes/income.js`)
- Income routes → JWT verification: checks token (evidence: `Routes/income.js`)
- Product routes → Product operations: dispatches (evidence: `Routes/products.js`)
- Product routes → JWT verification: checks token (evidence: `Routes/products.js`)
- Savings routes → Savings operations: dispatches (evidence: `Routes/savings.js`)
- Savings routes → JWT verification: checks token (evidence: `Routes/savings.js`)
- Expense operations → Expense model: reads and writes (evidence: `Controllers/Con_expense.js`)
- Income operations → Income model: uses (evidence: `Controllers/Con_incomes.js`)
- Product operations → Product model: uses (evidence: `Controllers/Con_products.js`)
- Savings operations → Savings model: uses (evidence: `Controllers/Con_savings.js`)
- Financial report → Express API: requests report data (evidence: `frontend/src/pages/Report.jsx`)
