# abooddeveloper/infoza-tech-pocket architecture

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

- Interactive diagram: https://gitdiagram.com/abooddeveloper/infoza-tech-pocket
- Repository: https://github.com/abooddeveloper/infoza-tech-pocket

## Overview

Pocketwise is a personal income and expense tracker. A user works through the browser UI to register or sign in, then uses authenticated transaction operations and filtered summaries to review a dashboard with balances, category breakdowns, a six-month chart, and recent activity. Express routes requests through controllers to services, which perform user-scoped Prisma operations against PostgreSQL. The README documents dashboard and security capabilities beyond the sampled browser source; those UI details and some middleware wiring are therefore represented at the documented level.

Main entry points: [`src/app.js`](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/app.js) (Express app), [`src/controllers/transactionController.js`](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/transactionController.js) (Transaction controller), [`src/controllers/authController.js`](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/authController.js) (Auth controller), [`src/db.js`](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/db.js) (Prisma client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser experience"]
  node_browser["Dashboard UI<br/>[app.js]"]
end

subgraph group_http["HTTP API"]
  node_webapp["Express app<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_txroutes["Transaction routes"]
  node_authctrl["Auth controller<br/>[authController.js]"]
  node_txctrl["Transaction controller"]
  node_authmw["Bearer auth<br/>[auth.js]"]
  node_errors["Error responses<br/>[errorHandler.js]"]
end

subgraph group_domain["Account and money"]
  node_authsvc["Account service<br/>[authService.js]"]
  node_txsvc["Transaction service"]
  node_validation["Input validation<br/>[validation.js]"]
  node_async["Async wrapper<br/>[asyncHandler.js]"]
  node_httperror["HTTP errors<br/>[httpError.js]"]
end

subgraph group_infra["Runtime and storage"]
  node_config["App configuration<br/>[config.js]"]
  node_dbclient["Prisma client<br/>[db.js]"]
  node_postgres[("PostgreSQL<br/>[schema.prisma]")]
  node_runtime["Server runtime<br/>[server.js]"]
end

node_person(("Tracker user"))

node_person -->|"uses"| node_browser
node_browser -->|"requests API"| node_webapp
node_webapp -->|"serves UI"| node_browser
node_webapp -->|"mounts"| node_authroutes
node_webapp -->|"mounts"| node_txroutes
node_webapp -->|"handles errors"| node_errors
node_authroutes -->|"routes to"| node_authctrl
node_txroutes -->|"protects routes"| node_authmw
node_txroutes -->|"routes to"| node_txctrl
node_authctrl -->|"calls"| node_authsvc
node_txctrl -->|"calls"| node_txsvc
node_authctrl -->|"validates email"| node_validation
node_txctrl -->|"validates dates"| node_validation
node_authctrl -->|"wraps handlers"| node_async
node_txctrl -->|"wraps handlers"| node_async
node_txctrl -->|"raises errors"| node_httperror
node_authsvc -->|"queries users"| node_dbclient
node_authsvc -->|"signs tokens"| node_config
node_txsvc -->|"queries transactions"| node_dbclient
node_authmw -->|"checks tokens"| node_config
node_dbclient -->|"persists data"| node_postgres
node_runtime -->|"starts"| node_webapp
node_runtime -.->|"disconnects"| node_dbclient

click node_browser "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/public/app.js"
click node_webapp "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/app.js"
click node_authroutes "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/routes/authRoutes.js"
click node_txroutes "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/routes/transactionRoutes.js"
click node_authctrl "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/authController.js"
click node_txctrl "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/transactionController.js"
click node_authmw "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/middleware/auth.js"
click node_errors "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/middleware/errorHandler.js"
click node_authsvc "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/services/authService.js"
click node_txsvc "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/services/transactionService.js"
click node_validation "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/validation.js"
click node_async "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/asyncHandler.js"
click node_httperror "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/httpError.js"
click node_config "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/config.js"
click node_dbclient "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/db.js"
click node_postgres "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/prisma/schema.prisma"
click node_runtime "https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/server.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_browser,node_person toneBlue
class node_webapp,node_authroutes,node_txroutes,node_authctrl,node_txctrl,node_authmw,node_errors toneAmber
class node_authsvc,node_txsvc,node_validation,node_async,node_httperror toneMint
class node_config,node_dbclient,node_postgres,node_runtime toneRose
```

## Components

### Browser experience

- [Dashboard UI](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/public/app.js): `public/app.js`

### HTTP API

- [Express app](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/app.js): `src/app.js`
- [Auth routes](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/routes/authRoutes.js): `src/routes/authRoutes.js`
- [Transaction routes](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/routes/transactionRoutes.js): `src/routes/transactionRoutes.js`
- [Auth controller](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/authController.js): `src/controllers/authController.js`
- [Transaction controller](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/controllers/transactionController.js): `src/controllers/transactionController.js`
- [Bearer auth](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/middleware/auth.js): `src/middleware/auth.js`
- [Error responses](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/middleware/errorHandler.js): `src/middleware/errorHandler.js`

### Account and money

- [Account service](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/services/authService.js): `src/services/authService.js`
- [Transaction service](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/services/transactionService.js): `src/services/transactionService.js`
- [Input validation](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/validation.js): `src/utils/validation.js`
- [Async wrapper](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/asyncHandler.js): `src/utils/asyncHandler.js`
- [HTTP errors](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/utils/httpError.js): `src/utils/httpError.js`

### Runtime and storage

- [App configuration](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/config.js): `src/config.js`
- [Prisma client](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/db.js): `src/db.js`
- [PostgreSQL](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/prisma/schema.prisma): `prisma/schema.prisma`
- [Server runtime](https://github.com/abooddeveloper/infoza-tech-pocket/blob/main/src/server.js): `src/server.js`

### Other components

- **Tracker user**

## Connections

- Tracker user → Dashboard UI: uses (evidence: `README.md`)
- Dashboard UI → Express app: requests API (evidence: `README.md`)
- Express app → Dashboard UI: serves UI (evidence: `src/app.js`)
- Express app → Auth routes: mounts (evidence: `src/app.js`)
- Express app → Transaction routes: mounts (evidence: `src/app.js`)
- Express app → Error responses: handles errors (evidence: `src/app.js`)
- Auth routes → Auth controller: routes to (evidence: `src/routes/authRoutes.js`)
- Transaction routes → Bearer auth: protects routes (evidence: `src/routes/transactionRoutes.js`)
- Transaction routes → Transaction controller: routes to (evidence: `src/routes/transactionRoutes.js`)
- Auth controller → Account service: calls (evidence: `src/controllers/authController.js`)
- Transaction controller → Transaction service: calls (evidence: `src/controllers/transactionController.js`)
- Auth controller → Input validation: validates email (evidence: `src/controllers/authController.js`)
- Transaction controller → Input validation: validates dates (evidence: `src/controllers/transactionController.js`)
- Auth controller → Async wrapper: wraps handlers (evidence: `src/controllers/authController.js`)
- Transaction controller → Async wrapper: wraps handlers (evidence: `src/controllers/transactionController.js`)
- Transaction controller → HTTP errors: raises errors (evidence: `src/controllers/transactionController.js`)
- Account service → Prisma client: queries users (evidence: `src/services/authService.js`)
- Account service → App configuration: signs tokens (evidence: `src/services/authService.js`)
- Transaction service → Prisma client: queries transactions (evidence: `src/services/transactionService.js`)
- Bearer auth → App configuration: checks tokens (evidence: `src/middleware/auth.js`)
- Prisma client → PostgreSQL: persists data (evidence: `README.md`)
- Server runtime → Express app: starts (evidence: `src/server.js`)
- Server runtime → Prisma client: disconnects (evidence: `README.md`)
