# wajih1234/paycom architecture

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

- Interactive diagram: https://gitdiagram.com/wajih1234/paycom
- Repository: https://github.com/wajih1234/paycom

## Overview

Paycom is a bill-payment application with a React client and an Express/MongoDB backend. Users sign up or log in, view bills, pay them, and review payment history; administrators have bill and user-management screens. The backend also supports password recovery and account updates. The graph includes documented routes and sampled controller/model interactions. Client-to-API calls and some unsampled route details are not shown in the available evidence, so those connections are omitted.

Main entry points: [`front/src/App.js`](https://github.com/wajih1234/paycom/blob/main/front/src/App.js) (Page router), [`back/routes/index.js`](https://github.com/wajih1234/paycom/blob/main/back/routes/index.js) (Route registry), [`back/routes/auth.js`](https://github.com/wajih1234/paycom/blob/main/back/routes/auth.js) (Auth routes), [`back/controllers/bill.js`](https://github.com/wajih1234/paycom/blob/main/back/controllers/bill.js) (Bill operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Page router<br/>[App.js]"]
  node_home["Home and auth<br/>[Home.jsx]"]
  node_userdash["User dashboard<br/>[userdashbaord.jsx]"]
  node_adminboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_addbill["Add bill<br/>[addbill.jsx]"]
  node_paybill["Pay bill<br/>[paybill.jsx]"]
  node_history["Payment history"]
  node_charts["Charts<br/>[Chart.jsx]"]
  node_profile["Profile<br/>[profil.jsx]"]
  node_settings["Settings<br/>[Settings.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_routes["Route registry<br/>[index.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_billroutes["Bill routes<br/>[bills.js]"]
  node_txroutes["Transaction routes<br/>[transactions.js]"]
  node_authctl["Authentication<br/>[auth.js]"]
  node_billctl["Bill operations<br/>[bill.js]"]
  node_userctl["User operations<br/>[user.js]"]
  node_txctl["Transaction queries<br/>[transaction.js]"]
  node_middleware["JWT authorization<br/>[auth.js]"]
end

subgraph group_data["Persistence"]
  node_mongo[("MongoDB")]
  node_dbconfig["DB connection<br/>[db.js]"]
  node_users[("User records<br/>[User.js]")]
  node_bills[("Bill records<br/>[Bill.js]")]
  node_transactions[("Transaction records<br/>[Transaction.js]")]
end

subgraph group_integrations["External services"]
  node_email["Reset email service<br/>[emailService.js]"]
end

node_user(("User"))
node_admin(("Administrator"))

node_user -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_userdash
node_app -->|"routes to"| node_adminboard
node_app -->|"routes to"| node_addbill
node_app -->|"routes to"| node_paybill
node_app -->|"routes to"| node_charts
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_settings
node_adminboard -->|"renders"| node_history
node_charts -->|"uses"| node_history
node_server -->|"connects"| node_dbconfig
node_server -->|"mounts"| node_routes
node_routes -->|"registers"| node_authroutes
node_routes -->|"registers"| node_billroutes
node_routes -->|"registers"| node_txroutes
node_authroutes -->|"dispatches"| node_authctl
node_authroutes -->|"dispatches"| node_userctl
node_authroutes -->|"protects"| node_middleware
node_billroutes -->|"dispatches"| node_billctl
node_billroutes -->|"protects"| node_middleware
node_txroutes -->|"dispatches"| node_txctl
node_txroutes -->|"protects"| node_middleware
node_authctl -->|"reads and writes"| node_users
node_authctl -->|"sends reset email"| node_email
node_billctl -->|"reads and writes"| node_users
node_billctl -->|"reads and writes"| node_bills
node_billctl -->|"creates"| node_transactions
node_userctl -->|"reads and writes"| node_users
node_txctl -->|"queries"| node_transactions
node_dbconfig -->|"connects"| node_mongo

click node_app "https://github.com/wajih1234/paycom/blob/main/front/src/App.js"
click node_home "https://github.com/wajih1234/paycom/blob/main/front/src/pages/Home.jsx"
click node_userdash "https://github.com/wajih1234/paycom/blob/main/front/src/pages/userdashbaord.jsx"
click node_adminboard "https://github.com/wajih1234/paycom/blob/main/front/src/pages/Dashboard.jsx"
click node_addbill "https://github.com/wajih1234/paycom/blob/main/front/src/pages/addbill.jsx"
click node_paybill "https://github.com/wajih1234/paycom/blob/main/front/src/pages/paybill.jsx"
click node_history "https://github.com/wajih1234/paycom/blob/main/front/src/pages/PaymentHistoryChart.jsx"
click node_charts "https://github.com/wajih1234/paycom/blob/main/front/src/pages/Chart.jsx"
click node_profile "https://github.com/wajih1234/paycom/blob/main/front/src/pages/profil.jsx"
click node_settings "https://github.com/wajih1234/paycom/blob/main/front/src/pages/Settings.jsx"
click node_server "https://github.com/wajih1234/paycom/blob/main/back/server.js"
click node_routes "https://github.com/wajih1234/paycom/blob/main/back/routes/index.js"
click node_authroutes "https://github.com/wajih1234/paycom/blob/main/back/routes/auth.js"
click node_billroutes "https://github.com/wajih1234/paycom/blob/main/back/routes/bills.js"
click node_txroutes "https://github.com/wajih1234/paycom/blob/main/back/routes/transactions.js"
click node_authctl "https://github.com/wajih1234/paycom/blob/main/back/controllers/auth.js"
click node_billctl "https://github.com/wajih1234/paycom/blob/main/back/controllers/bill.js"
click node_userctl "https://github.com/wajih1234/paycom/blob/main/back/controllers/user.js"
click node_txctl "https://github.com/wajih1234/paycom/blob/main/back/controllers/transaction.js"
click node_middleware "https://github.com/wajih1234/paycom/blob/main/back/middleware/auth.js"
click node_email "https://github.com/wajih1234/paycom/blob/main/back/controllers/emailService.js"
click node_dbconfig "https://github.com/wajih1234/paycom/blob/main/back/config/db.js"
click node_users "https://github.com/wajih1234/paycom/blob/main/back/models/User.js"
click node_bills "https://github.com/wajih1234/paycom/blob/main/back/models/Bill.js"
click node_transactions "https://github.com/wajih1234/paycom/blob/main/back/models/Transaction.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_home,node_userdash,node_adminboard,node_addbill,node_paybill,node_history,node_charts,node_profile,node_settings,node_user toneBlue
class node_server,node_routes,node_authroutes,node_billroutes,node_txroutes,node_authctl,node_billctl,node_userctl,node_txctl,node_middleware toneAmber
class node_mongo,node_dbconfig,node_users,node_bills,node_transactions toneMint
class node_email toneRose
class node_admin toneIndigo
```

## Components

### Web client

- [Page router](https://github.com/wajih1234/paycom/blob/main/front/src/App.js): `front/src/App.js`
- [Home and auth](https://github.com/wajih1234/paycom/blob/main/front/src/pages/Home.jsx): `front/src/pages/Home.jsx`
- [User dashboard](https://github.com/wajih1234/paycom/blob/main/front/src/pages/userdashbaord.jsx): `front/src/pages/userdashbaord.jsx`
- [Admin dashboard](https://github.com/wajih1234/paycom/blob/main/front/src/pages/Dashboard.jsx): `front/src/pages/Dashboard.jsx`
- [Add bill](https://github.com/wajih1234/paycom/blob/main/front/src/pages/addbill.jsx): `front/src/pages/addbill.jsx`
- [Pay bill](https://github.com/wajih1234/paycom/blob/main/front/src/pages/paybill.jsx): `front/src/pages/paybill.jsx`
- [Payment history](https://github.com/wajih1234/paycom/blob/main/front/src/pages/PaymentHistoryChart.jsx): `front/src/pages/PaymentHistoryChart.jsx`
- [Charts](https://github.com/wajih1234/paycom/blob/main/front/src/pages/Chart.jsx): `front/src/pages/Chart.jsx`
- [Profile](https://github.com/wajih1234/paycom/blob/main/front/src/pages/profil.jsx): `front/src/pages/profil.jsx`
- [Settings](https://github.com/wajih1234/paycom/blob/main/front/src/pages/Settings.jsx): `front/src/pages/Settings.jsx`

### Backend API

- [HTTP server](https://github.com/wajih1234/paycom/blob/main/back/server.js): `back/server.js`
- [Route registry](https://github.com/wajih1234/paycom/blob/main/back/routes/index.js): `back/routes/index.js`
- [Auth routes](https://github.com/wajih1234/paycom/blob/main/back/routes/auth.js): `back/routes/auth.js`
- [Bill routes](https://github.com/wajih1234/paycom/blob/main/back/routes/bills.js): `back/routes/bills.js`
- [Transaction routes](https://github.com/wajih1234/paycom/blob/main/back/routes/transactions.js): `back/routes/transactions.js`
- [Authentication](https://github.com/wajih1234/paycom/blob/main/back/controllers/auth.js): `back/controllers/auth.js`
- [Bill operations](https://github.com/wajih1234/paycom/blob/main/back/controllers/bill.js): `back/controllers/bill.js`
- [User operations](https://github.com/wajih1234/paycom/blob/main/back/controllers/user.js): `back/controllers/user.js`
- [Transaction queries](https://github.com/wajih1234/paycom/blob/main/back/controllers/transaction.js): `back/controllers/transaction.js`
- [JWT authorization](https://github.com/wajih1234/paycom/blob/main/back/middleware/auth.js): `back/middleware/auth.js`

### Persistence

- **MongoDB**
- [DB connection](https://github.com/wajih1234/paycom/blob/main/back/config/db.js): `back/config/db.js`
- [User records](https://github.com/wajih1234/paycom/blob/main/back/models/User.js): `back/models/User.js`
- [Bill records](https://github.com/wajih1234/paycom/blob/main/back/models/Bill.js): `back/models/Bill.js`
- [Transaction records](https://github.com/wajih1234/paycom/blob/main/back/models/Transaction.js): `back/models/Transaction.js`

### External services

- [Reset email service](https://github.com/wajih1234/paycom/blob/main/back/controllers/emailService.js): `back/controllers/emailService.js`

### Other components

- **User**
- **Administrator**

## Connections

- User → Page router: uses
- Administrator → Page router: uses
- Page router → Home and auth: routes to (evidence: `front/src/App.js`)
- Page router → User dashboard: routes to (evidence: `front/src/App.js`)
- Page router → Admin dashboard: routes to (evidence: `front/src/App.js`)
- Page router → Add bill: routes to (evidence: `front/src/App.js`)
- Page router → Pay bill: routes to (evidence: `front/src/App.js`)
- Page router → Charts: routes to (evidence: `front/src/App.js`)
- Page router → Profile: routes to (evidence: `front/src/App.js`)
- Page router → Settings: routes to (evidence: `front/src/App.js`)
- Admin dashboard → Payment history: renders (evidence: `front/src/pages/Dashboard.jsx`)
- Charts → Payment history: uses (evidence: `front/src/pages/Chart.jsx`)
- HTTP server → DB connection: connects (evidence: `back/server.js`)
- HTTP server → Route registry: mounts (evidence: `back/server.js`)
- Route registry → Auth routes: registers (evidence: `back/routes/index.js`)
- Route registry → Bill routes: registers (evidence: `back/routes/index.js`)
- Route registry → Transaction routes: registers (evidence: `back/routes/index.js`)
- Auth routes → Authentication: dispatches (evidence: `back/routes/auth.js`)
- Auth routes → User operations: dispatches (evidence: `back/routes/auth.js`)
- Auth routes → JWT authorization: protects (evidence: `back/routes/auth.js`)
- Bill routes → Bill operations: dispatches (evidence: `back/routes/bills.js`)
- Bill routes → JWT authorization: protects (evidence: `back/routes/bills.js`)
- Transaction routes → Transaction queries: dispatches (evidence: `back/routes/transactions.js`)
- Transaction routes → JWT authorization: protects (evidence: `back/routes/transactions.js`)
- Authentication → User records: reads and writes (evidence: `back/controllers/auth.js`)
- Authentication → Reset email service: sends reset email (evidence: `back/controllers/auth.js`)
- Bill operations → User records: reads and writes (evidence: `back/controllers/bill.js`)
- Bill operations → Bill records: reads and writes (evidence: `back/controllers/bill.js`)
- Bill operations → Transaction records: creates (evidence: `back/controllers/bill.js`)
- User operations → User records: reads and writes (evidence: `back/controllers/user.js`)
- Transaction queries → Transaction records: queries (evidence: `back/controllers/transaction.js`)
- DB connection → MongoDB: connects
