# bilalpiaic/easy-books architecture

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

- Interactive diagram: https://gitdiagram.com/bilalpiaic/easy-books
- Repository: https://github.com/bilalpiaic/easy-books

## Overview

Easy-Books is a multi-tenant accounting SaaS with installable operational, industry, statutory, and intelligence add-ons. The principal workflow is users creating invoices or bills, calculating document taxes, posting balanced vouchers to the general ledger, and reviewing live financial or operational reports. The README documents the accounting and reporting contracts; the sampled sources show API startup, authentication, tenant-scoped shared dependencies, module management, and report-engine behavior. Several domain-router connections are documented product capabilities rather than inspected call paths.

Main entry points: [`backend/routers/invoices.py`](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/invoices.py) (Invoices and bills), [`backend/services/posting.py`](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/posting.py) (Voucher posting), [`backend/models.py`](https://github.com/bilalpiaic/easy-books/blob/main/backend/models.py) (General ledger), [`frontend/src/app/(dashboard)`](https://github.com/bilalpiaic/easy-books/tree/main/frontend/src/app/(dashboard)) (Web workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_frontend["Web workspace"]
end

subgraph group_platform["Platform foundation"]
  node_api["FastAPI application<br/>[main.py]"]
  node_auth["Identity and tenants<br/>[auth.py]"]
  node_shared["Request dependencies<br/>[common.py]"]
  node_modules["Add-on management<br/>[modules.py]"]
  node_database[("Tenant data<br/>[db.py]")]
end

subgraph group_accounting["Accounting workflow"]
  node_documents["Invoices and bills<br/>[invoices.py]"]
  node_tax["Tax calculation<br/>[tax_engine.py]"]
  node_posting["Voucher posting<br/>[posting.py]"]
  node_payments["Payment allocation<br/>[payments.py]"]
  node_ledger[("General ledger<br/>[models.py]")]
end

subgraph group_operations["Operations and industries"]
  node_inventory["Inventory operations<br/>[inventory.py]"]
  node_purchases["Purchasing and stock<br/>[purchase_orders.py]"]
  node_industry["Industry add-ons"]
end

subgraph group_insight["Reports and integrations"]
  node_reporting["Live reports<br/>[reports.py]"]
  node_report_builder["Report builder<br/>[report_engine.py]"]
  node_banking["Bank reconciliation<br/>[reconciliations.py]"]
  node_compliance["E-invoice compliance<br/>[peppol.py]"]
end

node_user(("Tenant user"))

node_user -->|"uses"| node_frontend
node_frontend -.->|"submits requests"| node_api
node_api -->|"routes requests"| node_auth
node_auth -->|"authenticates"| node_shared
node_shared -->|"loads tenant data"| node_database
node_user -->|"installs add-ons"| node_modules
node_modules -->|"stores module state"| node_database
node_user -->|"creates documents"| node_documents
node_documents -->|"calculates tax"| node_tax
node_documents -->|"posts vouchers"| node_posting
node_user -->|"allocates payments"| node_payments
node_payments -.->|"posts settlements"| node_posting
node_posting -->|"writes entries"| node_ledger
node_user -->|"manages purchasing"| node_purchases
node_purchases -.->|"tracks stock"| node_inventory
node_user -->|"uses add-ons"| node_industry
node_user -->|"views reports"| node_reporting
node_reporting -->|"reads live balances"| node_ledger
node_user -->|"builds reports"| node_report_builder
node_report_builder -->|"queries tenant data"| node_ledger
node_user -->|"reconciles accounts"| node_banking
node_user -->|"uses e-invoicing"| node_compliance

click node_frontend "https://github.com/bilalpiaic/easy-books/tree/main/frontend/src/app/(dashboard)"
click node_api "https://github.com/bilalpiaic/easy-books/blob/main/backend/main.py"
click node_auth "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/auth.py"
click node_shared "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/common.py"
click node_modules "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/modules.py"
click node_database "https://github.com/bilalpiaic/easy-books/blob/main/backend/db.py"
click node_documents "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/invoices.py"
click node_tax "https://github.com/bilalpiaic/easy-books/blob/main/backend/services/tax_engine.py"
click node_posting "https://github.com/bilalpiaic/easy-books/blob/main/backend/services/posting.py"
click node_payments "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/payments.py"
click node_inventory "https://github.com/bilalpiaic/easy-books/blob/main/backend/services/inventory.py"
click node_purchases "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/purchase_orders.py"
click node_industry "https://github.com/bilalpiaic/easy-books/tree/main/backend/routers"
click node_ledger "https://github.com/bilalpiaic/easy-books/blob/main/backend/models.py"
click node_reporting "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/reports.py"
click node_report_builder "https://github.com/bilalpiaic/easy-books/blob/main/backend/services/report_engine.py"
click node_banking "https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/reconciliations.py"
click node_compliance "https://github.com/bilalpiaic/easy-books/blob/main/backend/services/peppol.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_frontend,node_user toneBlue
class node_api,node_auth,node_shared,node_modules,node_database toneAmber
class node_documents,node_tax,node_posting,node_payments,node_ledger toneMint
class node_inventory,node_purchases,node_industry toneRose
class node_reporting,node_report_builder,node_banking,node_compliance toneIndigo
```

## Components

### User experience

- [Web workspace](https://github.com/bilalpiaic/easy-books/tree/main/frontend/src/app/(dashboard)): `frontend/src/app/(dashboard)`

### Platform foundation

- [FastAPI application](https://github.com/bilalpiaic/easy-books/blob/main/backend/main.py): `backend/main.py`
- [Identity and tenants](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/auth.py): `backend/routers/auth.py`
- [Request dependencies](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/common.py): `backend/routers/common.py`
- [Add-on management](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/modules.py): `backend/routers/modules.py`
- [Tenant data](https://github.com/bilalpiaic/easy-books/blob/main/backend/db.py): `backend/db.py`

### Accounting workflow

- [Invoices and bills](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/invoices.py): `backend/routers/invoices.py`
- [Tax calculation](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/tax_engine.py): `backend/services/tax_engine.py`
- [Voucher posting](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/posting.py): `backend/services/posting.py`
- [Payment allocation](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/payments.py): `backend/routers/payments.py`
- [General ledger](https://github.com/bilalpiaic/easy-books/blob/main/backend/models.py): `backend/models.py`

### Operations and industries

- [Inventory operations](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/inventory.py): `backend/services/inventory.py`
- [Purchasing and stock](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/purchase_orders.py): `backend/routers/purchase_orders.py`
- [Industry add-ons](https://github.com/bilalpiaic/easy-books/tree/main/backend/routers): `backend/routers`

### Reports and integrations

- [Live reports](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/reports.py): `backend/routers/reports.py`
- [Report builder](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/report_engine.py): `backend/services/report_engine.py`
- [Bank reconciliation](https://github.com/bilalpiaic/easy-books/blob/main/backend/routers/reconciliations.py): `backend/routers/reconciliations.py`
- [E-invoice compliance](https://github.com/bilalpiaic/easy-books/blob/main/backend/services/peppol.py): `backend/services/peppol.py`

### Other components

- **Tenant user**

## Connections

- Tenant user → Web workspace: uses
- Web workspace → FastAPI application: submits requests
- FastAPI application → Identity and tenants: routes requests (evidence: `backend/main.py`)
- Identity and tenants → Request dependencies: authenticates (evidence: `backend/routers/auth.py`)
- Request dependencies → Tenant data: loads tenant data (evidence: `backend/routers/common.py`)
- Tenant user → Add-on management: installs add-ons (evidence: `backend/routers/modules.py`)
- Add-on management → Tenant data: stores module state (evidence: `backend/routers/modules.py`)
- Tenant user → Invoices and bills: creates documents
- Invoices and bills → Tax calculation: calculates tax (evidence: `backend/services/tax_engine.py`)
- Invoices and bills → Voucher posting: posts vouchers
- Tenant user → Payment allocation: allocates payments
- Payment allocation → Voucher posting: posts settlements
- Voucher posting → General ledger: writes entries
- Tenant user → Purchasing and stock: manages purchasing
- Purchasing and stock → Inventory operations: tracks stock
- Tenant user → Industry add-ons: uses add-ons
- Tenant user → Live reports: views reports
- Live reports → General ledger: reads live balances
- Tenant user → Report builder: builds reports
- Report builder → General ledger: queries tenant data (evidence: `backend/services/report_engine.py`)
- Tenant user → Bank reconciliation: reconciles accounts
- Tenant user → E-invoice compliance: uses e-invoicing
