# aczh05/money-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/aczh05/money-tracker
- Repository: https://github.com/aczh05/money-tracker

## Overview

This is a NestJS API with user, authentication, and transaction endpoints. Clients call controllers, which delegate domain operations to services; user and transaction services use a shared Prisma export for persistence. Login looks up a user, checks the supplied password, and returns a signed JWT. The auth module registers a global guard and JWT configuration. The excerpts do not show the Prisma export’s implementation or the guard’s request-validation flow, so those runtime links are not asserted.

Main entry points: [`api/src/app.module.ts`](https://github.com/aczh05/money-tracker/blob/main/api/src/app.module.ts) (App wiring), [`api/src/transaction/transaction.controller.ts`](https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/transaction.controller.ts) (Transaction endpoints), [`api/src/auth/auth.service.ts`](https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.service.ts) (Login service), [`api/src/auth/auth.controller.ts`](https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.controller.ts) (Auth endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_bootstrap["Nest bootstrap<br/>[main.ts]"]
  node_app["App wiring<br/>[app.module.ts]"]
  node_hello["Health endpoint<br/>[app.controller.ts]"]
  node_hello_service["Hello response<br/>[app.service.ts]"]
end

subgraph group_identity["Identity and access"]
  node_auth_controller["Auth endpoint<br/>[auth.controller.ts]"]
  node_auth_service["Login service<br/>[auth.service.ts]"]
  node_auth_guard["Global auth guard<br/>[auth.guard.ts]"]
  node_jwt["JWT provider"]
end

subgraph group_domain["Domain operations"]
  node_user_controller["User endpoints<br/>[user.controller.ts]"]
  node_user_service["User service<br/>[user.service.ts]"]
  node_transaction_controller["Transaction endpoints"]
  node_transaction_service["Transaction service"]
  node_transaction_dto["Transaction input"]
end

subgraph group_persistence["Persistence"]
  node_prisma_export["Prisma access export<br/>[prisma.export.ts]"]
  node_prisma_service["Prisma client service<br/>[prisma.service.ts]"]
  node_database[("Database")]
end

node_client(("API client"))

node_client -->|"calls login"| node_auth_controller
node_client -->|"calls endpoints"| node_user_controller
node_client -->|"calls endpoints"| node_transaction_controller
node_bootstrap -->|"boots"| node_app
node_app -->|"registers"| node_hello
node_app -->|"provides"| node_hello_service
node_app -->|"provides"| node_prisma_service
node_app -->|"imports auth module"| node_auth_controller
node_app -->|"imports user module"| node_user_controller
node_app -->|"imports transaction module"| node_transaction_controller
node_hello -->|"calls"| node_hello_service
node_auth_controller -->|"calls login"| node_auth_service
node_auth_service -->|"looks up user"| node_user_service
node_auth_service -->|"signs token"| node_jwt
node_auth_guard -.-> node_jwt
node_user_controller -->|"delegates"| node_user_service
node_user_service -->|"queries users"| node_prisma_export
node_transaction_controller -->|"delegates"| node_transaction_service
node_transaction_controller -->|"accepts input"| node_transaction_dto
node_transaction_service -->|"reads and writes"| node_prisma_export
node_prisma_service -.->|"connects"| node_database

click node_bootstrap "https://github.com/aczh05/money-tracker/blob/main/api/src/main.ts"
click node_app "https://github.com/aczh05/money-tracker/blob/main/api/src/app.module.ts"
click node_hello "https://github.com/aczh05/money-tracker/blob/main/api/src/app.controller.ts"
click node_hello_service "https://github.com/aczh05/money-tracker/blob/main/api/src/app.service.ts"
click node_auth_controller "https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.controller.ts"
click node_auth_service "https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.service.ts"
click node_auth_guard "https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.guard.ts"
click node_user_controller "https://github.com/aczh05/money-tracker/blob/main/api/src/user/user.controller.ts"
click node_user_service "https://github.com/aczh05/money-tracker/blob/main/api/src/user/user.service.ts"
click node_transaction_controller "https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/transaction.controller.ts"
click node_transaction_service "https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/transaction.service.ts"
click node_transaction_dto "https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/dto/createTransaction.dto.ts"
click node_prisma_export "https://github.com/aczh05/money-tracker/blob/main/api/src/prisma/prisma.export.ts"
click node_prisma_service "https://github.com/aczh05/money-tracker/blob/main/api/src/prisma/prisma.service.ts"

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_bootstrap,node_app,node_hello,node_hello_service,node_client toneBlue
class node_auth_controller,node_auth_service,node_auth_guard,node_jwt toneAmber
class node_user_controller,node_user_service,node_transaction_controller,node_transaction_service,node_transaction_dto toneMint
class node_prisma_export,node_prisma_service,node_database toneRose
```

## Components

### API entry

- [Nest bootstrap](https://github.com/aczh05/money-tracker/blob/main/api/src/main.ts): `api/src/main.ts`
- [App wiring](https://github.com/aczh05/money-tracker/blob/main/api/src/app.module.ts): `api/src/app.module.ts`
- [Health endpoint](https://github.com/aczh05/money-tracker/blob/main/api/src/app.controller.ts): `api/src/app.controller.ts`
- [Hello response](https://github.com/aczh05/money-tracker/blob/main/api/src/app.service.ts): `api/src/app.service.ts`

### Identity and access

- [Auth endpoint](https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.controller.ts): `api/src/auth/auth.controller.ts`
- [Login service](https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.service.ts): `api/src/auth/auth.service.ts`
- [Global auth guard](https://github.com/aczh05/money-tracker/blob/main/api/src/auth/auth.guard.ts): `api/src/auth/auth.guard.ts`
- **JWT provider**

### Domain operations

- [User endpoints](https://github.com/aczh05/money-tracker/blob/main/api/src/user/user.controller.ts): `api/src/user/user.controller.ts`
- [User service](https://github.com/aczh05/money-tracker/blob/main/api/src/user/user.service.ts): `api/src/user/user.service.ts`
- [Transaction endpoints](https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/transaction.controller.ts): `api/src/transaction/transaction.controller.ts`
- [Transaction service](https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/transaction.service.ts): `api/src/transaction/transaction.service.ts`
- [Transaction input](https://github.com/aczh05/money-tracker/blob/main/api/src/transaction/dto/createTransaction.dto.ts): `api/src/transaction/dto/createTransaction.dto.ts`

### Persistence

- [Prisma access export](https://github.com/aczh05/money-tracker/blob/main/api/src/prisma/prisma.export.ts): `api/src/prisma/prisma.export.ts`
- [Prisma client service](https://github.com/aczh05/money-tracker/blob/main/api/src/prisma/prisma.service.ts): `api/src/prisma/prisma.service.ts`
- **Database**

### Other components

- **API client**

## Connections

- API client → Auth endpoint: calls login (evidence: `api/src/auth/auth.controller.ts`)
- API client → User endpoints: calls endpoints (evidence: `api/src/user/user.controller.ts`)
- API client → Transaction endpoints: calls endpoints (evidence: `api/src/transaction/transaction.controller.ts`)
- Nest bootstrap → App wiring: boots (evidence: `api/src/main.ts`)
- App wiring → Health endpoint: registers (evidence: `api/src/app.module.ts`)
- App wiring → Hello response: provides (evidence: `api/src/app.module.ts`)
- App wiring → Prisma client service: provides (evidence: `api/src/app.module.ts`)
- App wiring → Auth endpoint: imports auth module (evidence: `api/src/app.module.ts`)
- App wiring → User endpoints: imports user module (evidence: `api/src/app.module.ts`)
- App wiring → Transaction endpoints: imports transaction module (evidence: `api/src/app.module.ts`)
- Health endpoint → Hello response: calls (evidence: `api/src/app.controller.ts`)
- Auth endpoint → Login service: calls login (evidence: `api/src/auth/auth.controller.ts`)
- Login service → User service: looks up user (evidence: `api/src/auth/auth.service.ts`)
- Login service → JWT provider: signs token (evidence: `api/src/auth/auth.service.ts`)
- Global auth guard → JWT provider
- User endpoints → User service: delegates (evidence: `api/src/user/user.controller.ts`)
- User service → Prisma access export: queries users (evidence: `api/src/user/user.service.ts`)
- Transaction endpoints → Transaction service: delegates (evidence: `api/src/transaction/transaction.controller.ts`)
- Transaction endpoints → Transaction input: accepts input (evidence: `api/src/transaction/transaction.controller.ts`)
- Transaction service → Prisma access export: reads and writes (evidence: `api/src/transaction/transaction.service.ts`)
- Prisma client service → Database: connects
