# inkithai/bookwise architecture

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

- Interactive diagram: https://gitdiagram.com/inkithai/bookwise
- Repository: https://github.com/inkithai/bookwise

## Overview

BookWise is a multi-tenant accounting and bookkeeping SaaS. Users authenticate, verify email, and work within an organisation; they can then manage invoices, books, banking, expenses, and bills, with financial statements reporting posted ledger activity. The README documents the ledger integrations and tenant boundary; sampled source confirms authentication setup, tenant middleware, and custom CRM handling. Several README-described modules are represented at their directory level because their implementation was not sampled.

Main entry points: [`be/Modules/Accounting`](https://github.com/inkithai/bookwise/tree/main/be/Modules/Accounting) (General ledger), [`be/Modules/User/Services/AuthService.php`](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Services/AuthService.php) (Auth service), [`be/Modules/User/Http/Controllers/API/AuthController.php`](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Controllers/API/AuthController.php) (Authentication), [`be/app/Http/Middleware/ResolveTenant.php`](https://github.com/inkithai/bookwise/blob/main/be/app/Http/Middleware/ResolveTenant.php) (Tenant boundary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity &amp; tenancy"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_auth_service["Auth service<br/>[AuthService.php]"]
  node_tenant["Tenant boundary<br/>[ResolveTenant.php]"]
  node_tenant_model[("Organisation<br/>[Host.php]")]
  node_user_model[("User profile<br/>[User.php]")]
  node_user_resource["User response<br/>[UserResource.php]"]
  node_roles["Roles &amp; permissions<br/>[RoleController.php]"]
  node_subscriptions["Subscriptions"]
end

subgraph group_finance["Books &amp; reporting"]
  node_ledger[("General ledger")]
  node_banking["Banking"]
  node_expenses["Expenses"]
  node_payables["Accounts payable"]
  node_statements["Financial statements"]
end

subgraph group_operations["Business operations"]
  node_invoice["Invoicing"]
end

subgraph group_workspace["Workspace features"]
  node_crm["Custom CRM"]
  node_analytics["Analytics"]
  node_admin_analytics["Admin analytics"]
  node_frontend["Accounting workspace<br/>[page.tsx]"]
end

node_user(("User"))

node_user -->|"authenticates"| node_auth
node_auth -->|"delegates to"| node_auth_service
node_auth_service -->|"creates organisation"| node_tenant_model
node_auth_service -->|"links user"| node_user_model
node_auth_service -->|"returns profile"| node_user_resource
node_user -.->|"uses workspace"| node_frontend
node_frontend -->|"requests accounting"| node_ledger
node_ledger -->|"scopes records"| node_tenant
node_tenant -->|"resolves tenant"| node_tenant_model
node_invoice -->|"posts invoices"| node_ledger
node_banking -->|"posts movements"| node_ledger
node_payables -.->|"posts payments"| node_ledger
node_expenses -.->|"captures overhead"| node_ledger
node_ledger -->|"computes reports"| node_statements
node_user -->|"manages records"| node_crm
node_user -.->|"views analytics"| node_analytics
node_user -.->|"views admin metrics"| node_admin_analytics
node_user -.->|"manages access"| node_roles
node_user -.->|"manages plan"| node_subscriptions

click node_auth "https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Controllers/API/AuthController.php"
click node_auth_service "https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Services/AuthService.php"
click node_tenant "https://github.com/inkithai/bookwise/blob/main/be/app/Http/Middleware/ResolveTenant.php"
click node_tenant_model "https://github.com/inkithai/bookwise/blob/main/be/app/Models/Host.php"
click node_user_model "https://github.com/inkithai/bookwise/blob/main/be/app/Models/User.php"
click node_user_resource "https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Resources/UserResource.php"
click node_invoice "https://github.com/inkithai/bookwise/blob/main/be/Modules/Invoice/Http/Controllers/API/InvoiceController.php"
click node_ledger "https://github.com/inkithai/bookwise/tree/main/be/Modules/Accounting"
click node_banking "https://github.com/inkithai/bookwise/tree/main/be/Modules/Banking"
click node_expenses "https://github.com/inkithai/bookwise/tree/main/be/Modules/Expenses"
click node_payables "https://github.com/inkithai/bookwise/tree/main/be/Modules/Purchases"
click node_statements "https://github.com/inkithai/bookwise/blob/main/be/Modules/Accounting/Services/FinancialStatementService.php"
click node_crm "https://github.com/inkithai/bookwise/blob/main/be/Modules/CustomCRM/Http/Controllers/API/CustomTableController.php"
click node_analytics "https://github.com/inkithai/bookwise/tree/main/be/Modules/Analytics"
click node_admin_analytics "https://github.com/inkithai/bookwise/tree/main/be/Modules/AdminAnalytics"
click node_roles "https://github.com/inkithai/bookwise/blob/main/be/Modules/Role/Http/Controllers/API/RoleController.php"
click node_subscriptions "https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Controllers/API/UserSubscriptionController.php"
click node_frontend "https://github.com/inkithai/bookwise/blob/main/fe/src/app/accounting/page.tsx"

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_auth,node_auth_service,node_tenant,node_tenant_model,node_user_model,node_user_resource,node_roles,node_subscriptions,node_user toneBlue
class node_ledger,node_banking,node_expenses,node_payables,node_statements toneAmber
class node_invoice toneMint
class node_crm,node_analytics,node_admin_analytics,node_frontend toneRose
```

## Components

### Identity & tenancy

- [Authentication](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Controllers/API/AuthController.php): `be/Modules/User/Http/Controllers/API/AuthController.php`
- [Auth service](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Services/AuthService.php): `be/Modules/User/Services/AuthService.php`
- [Tenant boundary](https://github.com/inkithai/bookwise/blob/main/be/app/Http/Middleware/ResolveTenant.php): `be/app/Http/Middleware/ResolveTenant.php`
- [Organisation](https://github.com/inkithai/bookwise/blob/main/be/app/Models/Host.php): `be/app/Models/Host.php`
- [User profile](https://github.com/inkithai/bookwise/blob/main/be/app/Models/User.php): `be/app/Models/User.php`
- [User response](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Resources/UserResource.php): `be/Modules/User/Http/Resources/UserResource.php`
- [Roles & permissions](https://github.com/inkithai/bookwise/blob/main/be/Modules/Role/Http/Controllers/API/RoleController.php): `be/Modules/Role/Http/Controllers/API/RoleController.php`
- [Subscriptions](https://github.com/inkithai/bookwise/blob/main/be/Modules/User/Http/Controllers/API/UserSubscriptionController.php): `be/Modules/User/Http/Controllers/API/UserSubscriptionController.php`

### Books & reporting

- [General ledger](https://github.com/inkithai/bookwise/tree/main/be/Modules/Accounting): `be/Modules/Accounting`
- [Banking](https://github.com/inkithai/bookwise/tree/main/be/Modules/Banking): `be/Modules/Banking`
- [Expenses](https://github.com/inkithai/bookwise/tree/main/be/Modules/Expenses): `be/Modules/Expenses`
- [Accounts payable](https://github.com/inkithai/bookwise/tree/main/be/Modules/Purchases): `be/Modules/Purchases`
- [Financial statements](https://github.com/inkithai/bookwise/blob/main/be/Modules/Accounting/Services/FinancialStatementService.php): `be/Modules/Accounting/Services/FinancialStatementService.php`

### Business operations

- [Invoicing](https://github.com/inkithai/bookwise/blob/main/be/Modules/Invoice/Http/Controllers/API/InvoiceController.php): `be/Modules/Invoice/Http/Controllers/API/InvoiceController.php`

### Workspace features

- [Custom CRM](https://github.com/inkithai/bookwise/blob/main/be/Modules/CustomCRM/Http/Controllers/API/CustomTableController.php): `be/Modules/CustomCRM/Http/Controllers/API/CustomTableController.php`
- [Analytics](https://github.com/inkithai/bookwise/tree/main/be/Modules/Analytics): `be/Modules/Analytics`
- [Admin analytics](https://github.com/inkithai/bookwise/tree/main/be/Modules/AdminAnalytics): `be/Modules/AdminAnalytics`
- [Accounting workspace](https://github.com/inkithai/bookwise/blob/main/fe/src/app/accounting/page.tsx): `fe/src/app/accounting/page.tsx`

### Other components

- **User**

## Connections

- User → Authentication: authenticates (evidence: `be/Modules/User/Http/Controllers/API/AuthController.php`)
- Authentication → Auth service: delegates to (evidence: `be/Modules/User/Http/Controllers/API/AuthController.php`)
- Auth service → Organisation: creates organisation (evidence: `be/Modules/User/Services/AuthService.php`)
- Auth service → User profile: links user (evidence: `be/Modules/User/Services/AuthService.php`)
- Auth service → User response: returns profile (evidence: `be/Modules/User/Services/AuthService.php`)
- User → Accounting workspace: uses workspace (evidence: `README.md`)
- Accounting workspace → General ledger: requests accounting (evidence: `README.md`)
- General ledger → Tenant boundary: scopes records (evidence: `README.md`)
- Tenant boundary → Organisation: resolves tenant (evidence: `be/app/Models/Host.php`)
- Invoicing → General ledger: posts invoices (evidence: `README.md`)
- Banking → General ledger: posts movements (evidence: `README.md`)
- Accounts payable → General ledger: posts payments (evidence: `README.md`)
- Expenses → General ledger: captures overhead (evidence: `README.md`)
- General ledger → Financial statements: computes reports (evidence: `README.md`)
- User → Custom CRM: manages records (evidence: `be/Modules/CustomCRM/Http/Controllers/API/CustomTableController.php`)
- User → Analytics: views analytics (evidence: `README.md`)
- User → Admin analytics: views admin metrics (evidence: `README.md`)
- User → Roles & permissions: manages access (evidence: `README.md`)
- User → Subscriptions: manages plan (evidence: `README.md`)
