# 27kanghan/pendy architecture

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

- Interactive diagram: https://gitdiagram.com/27kanghan/pendy
- Repository: https://github.com/27kanghan/pendy

## Overview

Pendy is an AI-assisted finance diary: users connect an account, review spending, set goals and emotions, and receive AI-generated diary entries and monthly feedback. The React app presents those workflows; the Spring backend owns accounts, transactions, goals, diaries, and statistics, while a FastAPI ML service exposes diary, report, and chatbot endpoints. The README documents the major product capabilities; sampled sources show the frontend route structure and ML endpoint dispatch, but not the backend controller wiring or frontend-to-backend request ownership.

Main entry points: [`frontend/src/App.js`](https://github.com/27kanghan/pendy/blob/dev/frontend/src/App.js) (React app routes), [`backend/namani/src/main/java/com/ssafy/namani/domain/transactionInfo/service/TransactionInfoService.java`](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/transactionInfo/service/TransactionInfoService.java) (Transactions and OCR), [`ML/main.py`](https://github.com/27kanghan/pendy/blob/dev/ML/main.py) (AI API), [`backend/namani/src/main/java/com/ssafy/namani/domain/diary/service/DiaryService.java`](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/diary/service/DiaryService.java) (Diary and calendar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User experience"]
  node_app["React app routes<br/>[App.js]"]
end

subgraph group_backend["Finance backend"]
  node_accounts["Member and accounts<br/>[MemberService.java]"]
  node_transactions["Transactions and OCR"]
  node_diaries["Diary and calendar<br/>[DiaryService.java]"]
  node_goals["Monthly goals<br/>[GoalService.java]"]
  node_statistics["Spending statistics"]
  node_averages["Consumption averages"]
  node_bank["Account verification"]
end

subgraph group_ml["AI services"]
  node_mlapi["AI API<br/>[main.py]"]
  node_diaryai["Diary generation<br/>[Mkdiary.py]"]
  node_reportai["Monthly report<br/>[Mkreport.py]"]
  node_chatbot["Finance chatbot<br/>[namani.py]"]
end

subgraph group_storage["Persistence and integrations"]
  node_db[("MariaDB")]
  node_s3[("Amazon S3")]
  node_clova["Clova OCR"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -.->|"manages accounts"| node_accounts
node_app -.->|"reviews spending"| node_transactions
node_app -.->|"views diaries"| node_diaries
node_app -.->|"sets goals"| node_goals
node_app -.->|"views analytics"| node_statistics
node_accounts -.->|"persists"| node_db
node_transactions -.->|"persists"| node_db
node_diaries -.->|"persists"| node_db
node_goals -.->|"persists"| node_db
node_statistics -.->|"persists"| node_db
node_transactions -.->|"OCR integration"| node_clova
node_transactions -.->|"receipt storage"| node_s3
node_mlapi -->|"dispatches"| node_diaryai
node_mlapi -->|"dispatches"| node_reportai
node_mlapi -->|"dispatches"| node_chatbot
node_diaries -.->|"requests generated diary"| node_mlapi
node_goals -.->|"requests feedback"| node_reportai
node_averages -.->|"reads and writes"| node_db

click node_app "https://github.com/27kanghan/pendy/blob/dev/frontend/src/App.js"
click node_accounts "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/member/service/MemberService.java"
click node_transactions "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/transactionInfo/service/TransactionInfoService.java"
click node_diaries "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/diary/service/DiaryService.java"
click node_goals "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/goal/service/GoalService.java"
click node_statistics "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/statistic/service/StatisticService.java"
click node_averages "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/avgConsumptionAmount/service/AvgConsumptionAmountService.java"
click node_bank "https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/accountInfo/service/AccountInfoService.java"
click node_mlapi "https://github.com/27kanghan/pendy/blob/dev/ML/main.py"
click node_diaryai "https://github.com/27kanghan/pendy/blob/dev/ML/diaries/Mkdiary.py"
click node_reportai "https://github.com/27kanghan/pendy/blob/dev/ML/feedback/Mkreport.py"
click node_chatbot "https://github.com/27kanghan/pendy/blob/dev/ML/chatbot/namani.py"

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_user toneBlue
class node_accounts,node_transactions,node_diaries,node_goals,node_statistics,node_averages,node_bank toneAmber
class node_mlapi,node_diaryai,node_reportai,node_chatbot toneMint
class node_db,node_s3,node_clova toneRose
```

## Components

### User experience

- [React app routes](https://github.com/27kanghan/pendy/blob/dev/frontend/src/App.js): `frontend/src/App.js`

### Finance backend

- [Member and accounts](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/member/service/MemberService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/member/service/MemberService.java`
- [Transactions and OCR](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/transactionInfo/service/TransactionInfoService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/transactionInfo/service/TransactionInfoService.java`
- [Diary and calendar](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/diary/service/DiaryService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/diary/service/DiaryService.java`
- [Monthly goals](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/goal/service/GoalService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/goal/service/GoalService.java`
- [Spending statistics](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/statistic/service/StatisticService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/statistic/service/StatisticService.java`
- [Consumption averages](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/avgConsumptionAmount/service/AvgConsumptionAmountService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/avgConsumptionAmount/service/AvgConsumptionAmountService.java`
- [Account verification](https://github.com/27kanghan/pendy/blob/dev/backend/namani/src/main/java/com/ssafy/namani/domain/accountInfo/service/AccountInfoService.java): `backend/namani/src/main/java/com/ssafy/namani/domain/accountInfo/service/AccountInfoService.java`

### AI services

- [AI API](https://github.com/27kanghan/pendy/blob/dev/ML/main.py): `ML/main.py`
- [Diary generation](https://github.com/27kanghan/pendy/blob/dev/ML/diaries/Mkdiary.py): `ML/diaries/Mkdiary.py`
- [Monthly report](https://github.com/27kanghan/pendy/blob/dev/ML/feedback/Mkreport.py): `ML/feedback/Mkreport.py`
- [Finance chatbot](https://github.com/27kanghan/pendy/blob/dev/ML/chatbot/namani.py): `ML/chatbot/namani.py`

### Persistence and integrations

- **MariaDB**
- **Amazon S3**
- **Clova OCR**

### Other components

- **User**

## Connections

- User → React app routes: uses (evidence: `README.md`)
- React app routes → Member and accounts: manages accounts
- React app routes → Transactions and OCR: reviews spending
- React app routes → Diary and calendar: views diaries
- React app routes → Monthly goals: sets goals
- React app routes → Spending statistics: views analytics
- Member and accounts → MariaDB: persists
- Transactions and OCR → MariaDB: persists
- Diary and calendar → MariaDB: persists
- Monthly goals → MariaDB: persists
- Spending statistics → MariaDB: persists
- Transactions and OCR → Clova OCR: OCR integration
- Transactions and OCR → Amazon S3: receipt storage
- AI API → Diary generation: dispatches (evidence: `ML/main.py`)
- AI API → Monthly report: dispatches (evidence: `ML/main.py`)
- AI API → Finance chatbot: dispatches (evidence: `ML/main.py`)
- Diary and calendar → AI API: requests generated diary
- Monthly goals → Monthly report: requests feedback
- Consumption averages → MariaDB: reads and writes
