# ikaique26/mertilo architecture

> Architecture diagram of the GitHub repository ikaique26/mertilo, 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/ikaique26/mertilo
- Repository: https://github.com/ikaique26/mertilo

## Overview

Mertilo is an Electron desktop personal-finance application with a React interface and a Node/TypeScript API. Users enter through the desktop UI, authenticate, and access financial tracking, imports, and Brazilian income-tax preparation. The API separates HTTP routing, business services, and persistence; IRPF additionally handles document processing and tax assistance. The README documents the desktop/frontend/backend stack and core finance capabilities. Some frontend-to-API wiring and unsampled subsystem internals are not shown, so those links are omitted rather than inferred.

Main entry points: [`resources/app/api/src/app.ts`](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/app.ts) (HTTP application), [`resources/app/src/App.jsx`](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/App.jsx) (React application), [`resources/app/api/src/controllers/irpf.controller.ts`](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/controllers/irpf.controller.ts) (Tax controller), [`resources/app/api/src/services/irpf.service.ts`](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/irpf.service.ts) (Tax domain service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_electron["Electron host<br/>[main.cjs]"]
  node_react["React application<br/>[App.jsx]"]
  node_dashboard["Finance views<br/>[index.jsx]"]
  node_taxui["Tax workflow UI<br/>[index.jsx]"]
  node_financialapi["Finance API client<br/>[financial.ts]"]
  node_importui["Import interface<br/>[index.jsx]"]
end

subgraph group_finance["Finance API"]
  node_api["HTTP application<br/>[app.ts]"]
  node_finance_routes["Finance routes"]
  node_accounts["Accounts service<br/>[account.service.ts]"]
  node_categories["Categories service"]
  node_history["History service<br/>[history.service.ts]"]
  node_salary["Salary service<br/>[salary.service.ts]"]
  node_vehicle["Vehicle expenses"]
  node_financial_import["Financial import"]
end

subgraph group_tax["Tax preparation"]
  node_irpf_routes["Tax routes<br/>[routes.ts]"]
  node_irpf_controller["Tax controller<br/>[irpf.controller.ts]"]
  node_irpf_service["Tax domain service<br/>[irpf.service.ts]"]
  node_file_processor["Document processor<br/>[file-processor.ts]"]
  node_assistant["Tax assistant<br/>[irpf-assistant.ts]"]
  node_tax_repository["Tax repositories<br/>[irpf.repository.ts]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_auth_routes["Auth routes<br/>[auth.ts]"]
  node_users["User repository"]
  node_database[("SQLite database<br/>[db.ts]")]
  node_email["Email delivery<br/>[email.service.ts]"]
end

node_user(("Desktop user"))

node_user -.->|"opens"| node_electron
node_electron -.->|"hosts"| node_react
node_user -.->|"uses"| node_react
node_react -->|"routes"| node_dashboard
node_react -->|"routes"| node_taxui
node_react -->|"provides finance context"| node_financialapi
node_react -->|"routes"| node_importui
node_api -->|"mounts"| node_finance_routes
node_api -->|"mounts"| node_auth_routes
node_api -->|"mounts"| node_irpf_routes
node_api -->|"calls"| node_accounts
node_api -->|"calls"| node_categories
node_api -->|"calls"| node_history
node_api -->|"calls"| node_salary
node_api -->|"calls"| node_vehicle
node_api -->|"mounts"| node_financial_import
node_auth_routes -->|"dispatches"| node_auth
node_auth -->|"reads and writes"| node_users
node_users -->|"queries"| node_database
node_auth -->|"sends verification"| node_email
node_irpf_routes -->|"dispatches"| node_irpf_controller
node_irpf_controller -->|"delegates"| node_irpf_service
node_irpf_controller -->|"processes uploads"| node_file_processor
node_irpf_controller -->|"requests analysis"| node_assistant
node_irpf_service -->|"persists tax data"| node_tax_repository
node_irpf_service -->|"uses transactions"| node_database

click node_electron "https://github.com/ikaique26/mertilo/blob/main/resources/app/electron/main.cjs"
click node_react "https://github.com/ikaique26/mertilo/blob/main/resources/app/src/App.jsx"
click node_dashboard "https://github.com/ikaique26/mertilo/blob/main/resources/app/src/pages/Dashboard/index.jsx"
click node_taxui "https://github.com/ikaique26/mertilo/blob/main/resources/app/src/modules/irpf/pages/index.jsx"
click node_financialapi "https://github.com/ikaique26/mertilo/blob/main/resources/app/src/services/api/financial.ts"
click node_importui "https://github.com/ikaique26/mertilo/blob/main/resources/app/src/pages/ImportacaoFinanceira/index.jsx"
click node_api "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/app.ts"
click node_finance_routes "https://github.com/ikaique26/mertilo/tree/main/resources/app/api/src/modules"
click node_accounts "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/account.service.ts"
click node_categories "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/category.service.ts"
click node_history "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/history.service.ts"
click node_salary "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/salary.service.ts"
click node_vehicle "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/vehicle-expense.service.ts"
click node_financial_import "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/modules/financial-import.ts"
click node_auth "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/auth.service.ts"
click node_auth_routes "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/routes/auth.ts"
click node_users "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/repositories/users.repository.ts"
click node_database "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/database/db.ts"
click node_irpf_routes "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/modules/irpf/routes.ts"
click node_irpf_controller "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/controllers/irpf.controller.ts"
click node_irpf_service "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/irpf.service.ts"
click node_file_processor "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/file-processor.ts"
click node_assistant "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/irpf-assistant.ts"
click node_tax_repository "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/repositories/irpf.repository.ts"
click node_email "https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/email.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_electron,node_react,node_dashboard,node_taxui,node_financialapi,node_importui,node_user toneBlue
class node_api,node_finance_routes,node_accounts,node_categories,node_history,node_salary,node_vehicle,node_financial_import toneAmber
class node_irpf_routes,node_irpf_controller,node_irpf_service,node_file_processor,node_assistant,node_tax_repository toneMint
class node_auth,node_auth_routes,node_users,node_database,node_email toneRose
```

## Components

### Desktop interface

- [Electron host](https://github.com/ikaique26/mertilo/blob/main/resources/app/electron/main.cjs): `resources/app/electron/main.cjs`
- [React application](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/App.jsx): `resources/app/src/App.jsx`
- [Finance views](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/pages/Dashboard/index.jsx): `resources/app/src/pages/Dashboard/index.jsx`
- [Tax workflow UI](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/modules/irpf/pages/index.jsx): `resources/app/src/modules/irpf/pages/index.jsx`
- [Finance API client](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/services/api/financial.ts): `resources/app/src/services/api/financial.ts`
- [Import interface](https://github.com/ikaique26/mertilo/blob/main/resources/app/src/pages/ImportacaoFinanceira/index.jsx): `resources/app/src/pages/ImportacaoFinanceira/index.jsx`

### Finance API

- [HTTP application](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/app.ts): `resources/app/api/src/app.ts`
- [Finance routes](https://github.com/ikaique26/mertilo/tree/main/resources/app/api/src/modules): `resources/app/api/src/modules`
- [Accounts service](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/account.service.ts): `resources/app/api/src/services/account.service.ts`
- [Categories service](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/category.service.ts): `resources/app/api/src/services/category.service.ts`
- [History service](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/history.service.ts): `resources/app/api/src/services/history.service.ts`
- [Salary service](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/salary.service.ts): `resources/app/api/src/services/salary.service.ts`
- [Vehicle expenses](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/vehicle-expense.service.ts): `resources/app/api/src/services/vehicle-expense.service.ts`
- [Financial import](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/modules/financial-import.ts): `resources/app/api/src/modules/financial-import.ts`

### Tax preparation

- [Tax routes](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/modules/irpf/routes.ts): `resources/app/api/src/modules/irpf/routes.ts`
- [Tax controller](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/controllers/irpf.controller.ts): `resources/app/api/src/controllers/irpf.controller.ts`
- [Tax domain service](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/irpf.service.ts): `resources/app/api/src/services/irpf.service.ts`
- [Document processor](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/file-processor.ts): `resources/app/api/src/services/file-processor.ts`
- [Tax assistant](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/irpf-assistant.ts): `resources/app/api/src/services/irpf-assistant.ts`
- [Tax repositories](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/repositories/irpf.repository.ts): `resources/app/api/src/repositories/irpf.repository.ts`

### Identity and persistence

- [Authentication](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/auth.service.ts): `resources/app/api/src/services/auth.service.ts`
- [Auth routes](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/routes/auth.ts): `resources/app/api/src/routes/auth.ts`
- [User repository](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/repositories/users.repository.ts): `resources/app/api/src/repositories/users.repository.ts`
- [SQLite database](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/database/db.ts): `resources/app/api/src/database/db.ts`
- [Email delivery](https://github.com/ikaique26/mertilo/blob/main/resources/app/api/src/services/email.service.ts): `resources/app/api/src/services/email.service.ts`

### Other components

- **Desktop user**

## Connections

- Desktop user → Electron host: opens (evidence: `README.md`)
- Electron host → React application: hosts (evidence: `README.md`)
- Desktop user → React application: uses (evidence: `README.md`)
- React application → Finance views: routes (evidence: `resources/app/src/App.jsx`)
- React application → Tax workflow UI: routes (evidence: `resources/app/src/App.jsx`)
- React application → Finance API client: provides finance context (evidence: `resources/app/src/App.jsx`)
- React application → Import interface: routes (evidence: `resources/app/src/App.jsx`)
- HTTP application → Finance routes: mounts (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Auth routes: mounts (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Tax routes: mounts (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Accounts service: calls (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Categories service: calls (evidence: `resources/app/api/src/app.ts`)
- HTTP application → History service: calls (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Salary service: calls (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Vehicle expenses: calls (evidence: `resources/app/api/src/app.ts`)
- HTTP application → Financial import: mounts (evidence: `resources/app/api/src/app.ts`)
- Auth routes → Authentication: dispatches
- Authentication → User repository: reads and writes (evidence: `resources/app/api/src/services/auth.service.ts`)
- User repository → SQLite database: queries (evidence: `resources/app/api/src/repositories/users.repository.ts`)
- Authentication → Email delivery: sends verification (evidence: `resources/app/api/src/services/auth.service.ts`)
- Tax routes → Tax controller: dispatches (evidence: `resources/app/api/src/modules/irpf/routes.ts`)
- Tax controller → Tax domain service: delegates (evidence: `resources/app/api/src/controllers/irpf.controller.ts`)
- Tax controller → Document processor: processes uploads (evidence: `resources/app/api/src/controllers/irpf.controller.ts`)
- Tax controller → Tax assistant: requests analysis (evidence: `resources/app/api/src/controllers/irpf.controller.ts`)
- Tax domain service → Tax repositories: persists tax data (evidence: `resources/app/api/src/services/irpf.service.ts`)
- Tax domain service → SQLite database: uses transactions (evidence: `resources/app/api/src/services/irpf.service.ts`)
