# migypractice/financial-management-system-core architecture

> Architecture diagram of the GitHub repository migypractice/financial-management-system-core, 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/migypractice/financial-management-system-core
- Repository: https://github.com/migypractice/financial-management-system-core

## Overview

This is the Transaction Core of a financial management system: external systems ingest transactions, the rule-based risk service evaluates them, authorized staff approve or reject them, and approvals post to the ledger with an audit trail. The React SPA exposes that workflow alongside dashboard, simulator, and audit views. The README documents several connections not visible in sampled excerpts; those are cited to it. Other finance modules are placeholders, not implemented product subsystems.

Main entry points: [`frontend-react/src/App.tsx`](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/App.tsx) (SPA navigation), [`backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php`](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php) (Approval API), [`backend-laravel/routes/api.php`](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/routes/api.php) (API routes), [`backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php`](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php) (Integration intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion and Risk"]
  node_integration["Integration intake"]
  node_risk["Rule-based risk engine<br/>[AIService.php]"]
  node_txstore[("Transaction records")]
  node_auditstore[("AI audit logs")]
end

subgraph group_workflow["Approval and Ledger"]
  node_transaction["Transaction model<br/>[Transaction.php]"]
  node_approvalapi["Approval API"]
  node_policy["Maker-checker policy"]
  node_financial["Posting service"]
  node_journal["Journal entries<br/>[JournalEntry.php]"]
  node_ledgerapi["Ledger API"]
  node_auditapi["Audit-log API"]
end

subgraph group_backend["API and Identity"]
  node_authapi["Authentication API<br/>[AuthController.php]"]
  node_user["User and roles<br/>[User.php]"]
  node_routes["API routes<br/>[api.php]"]
end

subgraph group_frontend["React Console"]
  node_app["SPA navigation<br/>[App.tsx]"]
  node_authctx["Session context<br/>[AuthContext.tsx]"]
  node_apiclient["API client<br/>[apiClient.ts]"]
  node_approvalsui["Approvals view<br/>[ApprovalsPage.tsx]"]
  node_ledgerui["Ledger view"]
  node_auditui["Audit trail view<br/>[AuditLogPage.tsx]"]
  node_dashboard["Dashboard view<br/>[DashboardPage.tsx]"]
  node_simulator["Transaction simulator<br/>[SimulatorPage.tsx]"]
  node_placeholders["Other finance placeholders"]
end

node_external(("External subsystem"))

node_external -->|"submits transactions"| node_integration
node_integration -->|"evaluates transaction"| node_risk
node_integration -->|"checks and persists"| node_txstore
node_integration -->|"writes evaluation"| node_auditstore
node_risk -->|"evaluates model"| node_transaction
node_approvalapi -->|"lists transactions"| node_transaction
node_approvalapi -->|"authorizes action"| node_policy
node_approvalapi -->|"delegates approve or reject"| node_financial
node_financial -->|"posts journal entry"| node_journal
node_financial -->|"updates posting status"| node_transaction
node_ledgerapi -->|"queries posted entries"| node_journal
node_auditapi -->|"queries evaluations"| node_auditstore
node_authapi -->|"authenticates user"| node_user
node_routes -->|"routes requests"| node_integration
node_routes -->|"routes requests"| node_approvalapi
node_routes -->|"routes requests"| node_ledgerapi
node_routes -->|"routes requests"| node_auditapi
node_routes -->|"routes requests"| node_authapi
node_app -->|"checks session"| node_authctx
node_app -->|"renders route"| node_approvalsui
node_app -->|"renders route"| node_ledgerui
node_app -->|"renders route"| node_auditui
node_app -->|"renders route"| node_dashboard
node_app -->|"renders route"| node_simulator
node_app -->|"renders placeholder routes"| node_placeholders
node_approvalsui -->|"requests API"| node_apiclient
node_ledgerui -->|"requests API"| node_apiclient
node_apiclient -.->|"calls approval endpoints"| node_approvalapi
node_apiclient -.->|"calls ledger endpoint"| node_ledgerapi
node_dashboard -.->|"fetches transactions"| node_approvalapi
node_auditui -.->|"fetches audit trail"| node_auditapi

click node_integration "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php"
click node_risk "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Services/AIService/AIService.php"
click node_transaction "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/Transaction.php"
click node_approvalapi "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php"
click node_policy "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Policies/TransactionPolicy.php"
click node_financial "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Services/FinancialService/FinancialService.php"
click node_journal "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/JournalEntry.php"
click node_ledgerapi "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/GeneralLedgerController.php"
click node_auditapi "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/AuditLogController.php"
click node_authapi "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/AuthController.php"
click node_user "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/User.php"
click node_routes "https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/routes/api.php"
click node_app "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/App.tsx"
click node_authctx "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/context/AuthContext.tsx"
click node_apiclient "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/services/apiClient.ts"
click node_approvalsui "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Approvals/ApprovalsPage.tsx"
click node_ledgerui "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/GeneralLedger/GeneralLedgerPage.tsx"
click node_auditui "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/AuditLog/AuditLogPage.tsx"
click node_dashboard "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Dashboard/DashboardPage.tsx"
click node_simulator "https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Simulator/SimulatorPage.tsx"
click node_placeholders "https://github.com/migypractice/financial-management-system-core/tree/main/frontend-react/src/pages"

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_integration,node_risk,node_txstore,node_auditstore toneBlue
class node_transaction,node_approvalapi,node_policy,node_financial,node_journal,node_ledgerapi,node_auditapi toneAmber
class node_authapi,node_user,node_routes toneMint
class node_app,node_authctx,node_apiclient,node_approvalsui,node_ledgerui,node_auditui,node_dashboard,node_simulator,node_placeholders toneRose
class node_external toneIndigo
```

## Components

### Ingestion and Risk

- [Integration intake](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php): `backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php`
- [Rule-based risk engine](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Services/AIService/AIService.php): `backend-laravel/app/Services/AIService/AIService.php`
- **Transaction records**
- **AI audit logs**

### Approval and Ledger

- [Transaction model](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/Transaction.php): `backend-laravel/app/Models/Transaction.php`
- [Approval API](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php): `backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php`
- [Maker-checker policy](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Policies/TransactionPolicy.php): `backend-laravel/app/Policies/TransactionPolicy.php`
- [Posting service](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Services/FinancialService/FinancialService.php): `backend-laravel/app/Services/FinancialService/FinancialService.php`
- [Journal entries](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/JournalEntry.php): `backend-laravel/app/Models/JournalEntry.php`
- [Ledger API](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/GeneralLedgerController.php): `backend-laravel/app/Http/Controllers/API/Dashboard/GeneralLedgerController.php`
- [Audit-log API](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/Dashboard/AuditLogController.php): `backend-laravel/app/Http/Controllers/API/Dashboard/AuditLogController.php`

### API and Identity

- [Authentication API](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Http/Controllers/API/AuthController.php): `backend-laravel/app/Http/Controllers/API/AuthController.php`
- [User and roles](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/app/Models/User.php): `backend-laravel/app/Models/User.php`
- [API routes](https://github.com/migypractice/financial-management-system-core/blob/main/backend-laravel/routes/api.php): `backend-laravel/routes/api.php`

### React Console

- [SPA navigation](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/App.tsx): `frontend-react/src/App.tsx`
- [Session context](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/context/AuthContext.tsx): `frontend-react/src/context/AuthContext.tsx`
- [API client](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/services/apiClient.ts): `frontend-react/src/services/apiClient.ts`
- [Approvals view](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Approvals/ApprovalsPage.tsx): `frontend-react/src/pages/Approvals/ApprovalsPage.tsx`
- [Ledger view](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/GeneralLedger/GeneralLedgerPage.tsx): `frontend-react/src/pages/GeneralLedger/GeneralLedgerPage.tsx`
- [Audit trail view](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/AuditLog/AuditLogPage.tsx): `frontend-react/src/pages/AuditLog/AuditLogPage.tsx`
- [Dashboard view](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Dashboard/DashboardPage.tsx): `frontend-react/src/pages/Dashboard/DashboardPage.tsx`
- [Transaction simulator](https://github.com/migypractice/financial-management-system-core/blob/main/frontend-react/src/pages/Simulator/SimulatorPage.tsx): `frontend-react/src/pages/Simulator/SimulatorPage.tsx`
- [Other finance placeholders](https://github.com/migypractice/financial-management-system-core/tree/main/frontend-react/src/pages): `frontend-react/src/pages`

### Other components

- **External subsystem**

## Connections

- External subsystem → Integration intake: submits transactions (evidence: `README.md`)
- Integration intake → Rule-based risk engine: evaluates transaction (evidence: `backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php`)
- Integration intake → Transaction records: checks and persists (evidence: `backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php`)
- Integration intake → AI audit logs: writes evaluation (evidence: `backend-laravel/app/Http/Controllers/API/Integration/IntegrationController.php`)
- Rule-based risk engine → Transaction model: evaluates model (evidence: `backend-laravel/app/Services/AIService/AIService.php`)
- Approval API → Transaction model: lists transactions (evidence: `backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php`)
- Approval API → Maker-checker policy: authorizes action (evidence: `backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php`)
- Approval API → Posting service: delegates approve or reject (evidence: `backend-laravel/app/Http/Controllers/API/Dashboard/TransactionController.php`)
- Posting service → Journal entries: posts journal entry (evidence: `README.md`)
- Posting service → Transaction model: updates posting status (evidence: `README.md`)
- Ledger API → Journal entries: queries posted entries (evidence: `backend-laravel/app/Http/Controllers/API/Dashboard/GeneralLedgerController.php`)
- Audit-log API → AI audit logs: queries evaluations (evidence: `README.md`)
- Authentication API → User and roles: authenticates user (evidence: `backend-laravel/app/Http/Controllers/API/AuthController.php`)
- API routes → Integration intake: routes requests (evidence: `backend-laravel/routes/api.php`)
- API routes → Approval API: routes requests (evidence: `backend-laravel/routes/api.php`)
- API routes → Ledger API: routes requests (evidence: `backend-laravel/routes/api.php`)
- API routes → Audit-log API: routes requests (evidence: `backend-laravel/routes/api.php`)
- API routes → Authentication API: routes requests (evidence: `backend-laravel/routes/api.php`)
- SPA navigation → Session context: checks session (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Approvals view: renders route (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Ledger view: renders route (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Audit trail view: renders route (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Dashboard view: renders route (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Transaction simulator: renders route (evidence: `frontend-react/src/App.tsx`)
- SPA navigation → Other finance placeholders: renders placeholder routes (evidence: `frontend-react/src/App.tsx`)
- Approvals view → API client: requests API (evidence: `frontend-react/src/pages/Approvals/ApprovalsPage.tsx`)
- Ledger view → API client: requests API (evidence: `frontend-react/src/pages/GeneralLedger/GeneralLedgerPage.tsx`)
- API client → Approval API: calls approval endpoints
- API client → Ledger API: calls ledger endpoint
- Dashboard view → Approval API: fetches transactions (evidence: `README.md`)
- Audit trail view → Audit-log API: fetches audit trail (evidence: `README.md`)
