# m7madi8/oday-os architecture

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

- Interactive diagram: https://gitdiagram.com/m7madi8/oday-os
- Repository: https://github.com/m7madi8/oday-os

## Overview

This is Invoice Ninja 5, customized for Oday Abu Doha Architects: a multi-tenant invoicing and business-management application with API, client-facing portal, and mobile/desktop clients. The documented core workflow validates an API request, saves an invoice through a repository, applies invoice-service actions, emits an event, then transforms the response. The graph also preserves major billing, document, import, reporting, and Oday backup capabilities. Source excerpts are partial, so unsampled subsystem links are omitted unless the README documents them.

Main entry points: [`app/Models/InvoiceInvitation.php`](https://github.com/m7madi8/oday-os/blob/main/app/Models/InvoiceInvitation.php) (Invoice records), [`app/Http/Controllers`](https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers) (Invoice controller), [`app/Services/Invoice`](https://github.com/m7madi8/oday-os/tree/main/app/Services/Invoice) (Invoice service), [`app/Services/Oday/Backup/BackupEngine.php`](https://github.com/m7madi8/oday-os/blob/main/app/Services/Oday/Backup/BackupEngine.php) (Oday backups)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflow"]
  node_api_request["API request"]
  node_validation["Request validation"]
  node_invoice_controller["Invoice controller"]
  node_invoice_repository["Invoice repository"]
  node_invoice_service["Invoice service"]
  node_invoice_events["Invoice events"]
  node_response_transform["API transformation<br/>[BaseController.php]"]
end

subgraph group_billing["Business operations"]
  node_invoice_data[("Invoice records")]
  node_client_portal["Client portal"]
  node_payments[("Payment operations<br/>[Payment.php]")]
  node_quotes_orders[("Quotes and orders<br/>[PurchaseOrder.php]")]
  node_expense_import["Expense intake"]
end

subgraph group_documents["Documents and messaging"]
  node_pdf_preview["PDF previews"]
  node_purchase_pdf["Order previews"]
  node_document_render["Document rendering<br/>[HtmlEngine.php]"]
  node_payment_email["Payment email"]
end

subgraph group_integrations["Imports and integrations"]
  node_csv_import["CSV imports<br/>[CSVIngest.php]"]
  node_accounting_sync["Accounting integrations<br/>[QuickbooksSync.php]"]
  node_reporting["Reports and exports"]
end

subgraph group_oday["Oday extensions"]
  node_backup_engine["Oday backups<br/>[BackupEngine.php]"]
  node_local_storage[("Local backup storage")]
  node_drive_storage[("Drive backup storage")]
end

node_user(("Business user"))

node_user -->|"submits"| node_api_request
node_api_request -->|"validates"| node_validation
node_validation -->|"passes request"| node_invoice_controller
node_invoice_controller -->|"saves invoice"| node_invoice_repository
node_invoice_repository -->|"returns invoice"| node_invoice_service
node_invoice_service -->|"fires event"| node_invoice_events
node_invoice_controller -->|"returns response"| node_response_transform
node_invoice_service -.->|"persists"| node_invoice_data
node_user -.->|"uses portal"| node_client_portal
node_user -->|"requests preview"| node_pdf_preview
node_pdf_preview -.->|"renders content"| node_document_render
node_user -->|"requests preview"| node_purchase_pdf
node_expense_import -.->|"parses documents"| node_invoice_data
node_csv_import -.->|"imports records"| node_invoice_data
node_user -.->|"imports data"| node_csv_import
node_invoice_data -.->|"exports data"| node_reporting
node_payments -->|"composes email"| node_payment_email
node_backup_engine -->|"writes backup"| node_local_storage
node_backup_engine -->|"uploads backup"| node_drive_storage

click node_api_request "https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers"
click node_validation "https://github.com/m7madi8/oday-os/tree/main/app/Http/Requests"
click node_invoice_controller "https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers"
click node_invoice_repository "https://github.com/m7madi8/oday-os/tree/main/app/Repositories"
click node_invoice_service "https://github.com/m7madi8/oday-os/tree/main/app/Services/Invoice"
click node_invoice_events "https://github.com/m7madi8/oday-os/tree/main/app/Events/Invoice"
click node_response_transform "https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/BaseController.php"
click node_invoice_data "https://github.com/m7madi8/oday-os/blob/main/app/Models/InvoiceInvitation.php"
click node_client_portal "https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers/ClientPortal"
click node_payments "https://github.com/m7madi8/oday-os/blob/main/app/Models/Payment.php"
click node_quotes_orders "https://github.com/m7madi8/oday-os/blob/main/app/Models/PurchaseOrder.php"
click node_expense_import "https://github.com/m7madi8/oday-os/blob/main/app/Services/InboundMail/InboundMailEngine.php"
click node_pdf_preview "https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/PreviewController.php"
click node_purchase_pdf "https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/PreviewPurchaseOrderController.php"
click node_document_render "https://github.com/m7madi8/oday-os/blob/main/app/Utils/HtmlEngine.php"
click node_payment_email "https://github.com/m7madi8/oday-os/blob/main/app/Mail/Engine/PaymentEmailEngine.php"
click node_csv_import "https://github.com/m7madi8/oday-os/blob/main/app/Jobs/Import/CSVIngest.php"
click node_accounting_sync "https://github.com/m7madi8/oday-os/blob/main/app/DataMapper/QuickbooksSync.php"
click node_reporting "https://github.com/m7madi8/oday-os/tree/main/app/Export/CSV"
click node_backup_engine "https://github.com/m7madi8/oday-os/blob/main/app/Services/Oday/Backup/BackupEngine.php"

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_api_request,node_validation,node_invoice_controller,node_invoice_repository,node_invoice_service,node_invoice_events,node_response_transform,node_user toneBlue
class node_invoice_data,node_client_portal,node_payments,node_quotes_orders,node_expense_import toneAmber
class node_pdf_preview,node_purchase_pdf,node_document_render,node_payment_email toneMint
class node_csv_import,node_accounting_sync,node_reporting toneRose
class node_backup_engine,node_local_storage,node_drive_storage toneIndigo
```

## Components

### API workflow

- [API request](https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Request validation](https://github.com/m7madi8/oday-os/tree/main/app/Http/Requests): `app/Http/Requests`
- [Invoice controller](https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers): `app/Http/Controllers`
- [Invoice repository](https://github.com/m7madi8/oday-os/tree/main/app/Repositories): `app/Repositories`
- [Invoice service](https://github.com/m7madi8/oday-os/tree/main/app/Services/Invoice): `app/Services/Invoice`
- [Invoice events](https://github.com/m7madi8/oday-os/tree/main/app/Events/Invoice): `app/Events/Invoice`
- [API transformation](https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/BaseController.php): `app/Http/Controllers/BaseController.php`

### Business operations

- [Invoice records](https://github.com/m7madi8/oday-os/blob/main/app/Models/InvoiceInvitation.php): `app/Models/InvoiceInvitation.php`
- [Client portal](https://github.com/m7madi8/oday-os/tree/main/app/Http/Controllers/ClientPortal): `app/Http/Controllers/ClientPortal`
- [Payment operations](https://github.com/m7madi8/oday-os/blob/main/app/Models/Payment.php): `app/Models/Payment.php`
- [Quotes and orders](https://github.com/m7madi8/oday-os/blob/main/app/Models/PurchaseOrder.php): `app/Models/PurchaseOrder.php`
- [Expense intake](https://github.com/m7madi8/oday-os/blob/main/app/Services/InboundMail/InboundMailEngine.php): `app/Services/InboundMail/InboundMailEngine.php`

### Documents and messaging

- [PDF previews](https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/PreviewController.php): `app/Http/Controllers/PreviewController.php`
- [Order previews](https://github.com/m7madi8/oday-os/blob/main/app/Http/Controllers/PreviewPurchaseOrderController.php): `app/Http/Controllers/PreviewPurchaseOrderController.php`
- [Document rendering](https://github.com/m7madi8/oday-os/blob/main/app/Utils/HtmlEngine.php): `app/Utils/HtmlEngine.php`
- [Payment email](https://github.com/m7madi8/oday-os/blob/main/app/Mail/Engine/PaymentEmailEngine.php): `app/Mail/Engine/PaymentEmailEngine.php`

### Imports and integrations

- [CSV imports](https://github.com/m7madi8/oday-os/blob/main/app/Jobs/Import/CSVIngest.php): `app/Jobs/Import/CSVIngest.php`
- [Accounting integrations](https://github.com/m7madi8/oday-os/blob/main/app/DataMapper/QuickbooksSync.php): `app/DataMapper/QuickbooksSync.php`
- [Reports and exports](https://github.com/m7madi8/oday-os/tree/main/app/Export/CSV): `app/Export/CSV`

### Oday extensions

- [Oday backups](https://github.com/m7madi8/oday-os/blob/main/app/Services/Oday/Backup/BackupEngine.php): `app/Services/Oday/Backup/BackupEngine.php`
- **Local backup storage**
- **Drive backup storage**

### Other components

- **Business user**

## Connections

- Business user → API request: submits (evidence: `README.md`)
- API request → Request validation: validates (evidence: `README.md`)
- Request validation → Invoice controller: passes request (evidence: `README.md`)
- Invoice controller → Invoice repository: saves invoice (evidence: `README.md`)
- Invoice repository → Invoice service: returns invoice (evidence: `README.md`)
- Invoice service → Invoice events: fires event (evidence: `README.md`)
- Invoice controller → API transformation: returns response (evidence: `README.md`)
- Invoice service → Invoice records: persists
- Business user → Client portal: uses portal (evidence: `README.md`)
- Business user → PDF previews: requests preview (evidence: `app/Http/Controllers/PreviewController.php`)
- PDF previews → Document rendering: renders content
- Business user → Order previews: requests preview (evidence: `app/Http/Controllers/PreviewPurchaseOrderController.php`)
- Expense intake → Invoice records: parses documents
- CSV imports → Invoice records: imports records
- Business user → CSV imports: imports data
- Invoice records → Reports and exports: exports data
- Payment operations → Payment email: composes email (evidence: `app/Mail/Engine/PaymentEmailEngine.php`)
- Oday backups → Local backup storage: writes backup (evidence: `app/Services/Oday/Backup/BackupEngine.php`)
- Oday backups → Drive backup storage: uploads backup (evidence: `app/Services/Oday/Backup/BackupEngine.php`)
