# issaalbalushi/mizan architecture

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

## Overview

Mizan is an Islamic-finance tracker: signed-in users reach dashboards and manage accounts, transactions, investments, zakat, and halal products. The API exposes corresponding route modules, protects selected operations with Clerk authentication, and persists domain data through the shared database package. The graph also includes the separate mockup preview sandbox because it is a substantial listed runtime capability. Frontend-to-API request wiring is not established by the excerpts, so those links are omitted.

Main entry points: [`artifacts/api-server/src/routes/index.ts`](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/index.ts) (API route registry), [`artifacts/app/src/App.tsx`](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/App.tsx) (App routing), [`artifacts/api-server/src/routes/transactions.ts`](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/transactions.ts) (Transaction routes), [`artifacts/api-server/src/app.ts`](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/app.ts) (Express application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Finance application"]
  node_app["App routing<br/>[App.tsx]"]
  node_layout["Application layout<br/>[layout.tsx]"]
  node_dashboard_ui["Dashboard page<br/>[dashboard.tsx]"]
  node_accounts_ui["Accounts page<br/>[accounts.tsx]"]
  node_transactions_ui["Transactions page<br/>[transactions.tsx]"]
  node_investments_ui["Investments page<br/>[investments.tsx]"]
  node_zakat_ui["Zakat page<br/>[zakat.tsx]"]
  node_products_ui["Products page<br/>[products.tsx]"]
end

subgraph group_api["API services"]
  node_api_app["Express application<br/>[app.ts]"]
  node_api_router["API route registry<br/>[index.ts]"]
  node_health["Health routes<br/>[health.ts]"]
  node_dashboard_api["Dashboard routes<br/>[dashboard.ts]"]
  node_accounts_api["Account routes<br/>[accounts.ts]"]
  node_categories_api["Category routes<br/>[categories.ts]"]
  node_transactions_api["Transaction routes<br/>[transactions.ts]"]
  node_investments_api["Investment routes<br/>[investments.ts]"]
  node_zakat_api["Zakat routes<br/>[zakat.ts]"]
  node_products_api["Product routes<br/>[products.ts]"]
  node_auth["Authentication middleware<br/>[requireAuth.ts]"]
  node_seed["Reference data seeding<br/>[seed.ts]"]
end

subgraph group_data["Persistence"]
  node_database[("Domain database")]
end

subgraph group_preview["Mockup preview"]
  node_sandbox_app["Preview renderer<br/>[App.tsx]"]
  node_mockup_plugin["Component discovery"]
end

node_user(("Finance user"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_accounts_ui
node_app -->|"routes to"| node_transactions_ui
node_app -->|"routes to"| node_investments_ui
node_app -->|"routes to"| node_zakat_ui
node_app -->|"routes to"| node_products_ui
node_api_app -->|"mounts"| node_api_router
node_api_app -->|"starts seeding"| node_seed
node_api_router -->|"registers"| node_health
node_api_router -->|"registers"| node_dashboard_api
node_api_router -->|"registers"| node_accounts_api
node_api_router -->|"registers"| node_categories_api
node_api_router -->|"registers"| node_transactions_api
node_api_router -->|"registers"| node_investments_api
node_api_router -->|"registers"| node_zakat_api
node_api_router -->|"registers"| node_products_api
node_transactions_api -->|"guards"| node_auth
node_dashboard_api -->|"uses"| node_auth
node_transactions_api -->|"reads and writes"| node_database
node_seed -->|"seeds"| node_database
node_mockup_plugin -->|"generates loaders"| node_sandbox_app

click node_app "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/App.tsx"
click node_layout "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/components/layout.tsx"
click node_dashboard_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/dashboard.tsx"
click node_accounts_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/accounts.tsx"
click node_transactions_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/transactions.tsx"
click node_investments_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/investments.tsx"
click node_zakat_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/zakat.tsx"
click node_products_ui "https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/products.tsx"
click node_api_app "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/app.ts"
click node_api_router "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/index.ts"
click node_health "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/health.ts"
click node_dashboard_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/dashboard.ts"
click node_accounts_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/accounts.ts"
click node_categories_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/categories.ts"
click node_transactions_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/transactions.ts"
click node_investments_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/investments.ts"
click node_zakat_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/zakat.ts"
click node_products_api "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/products.ts"
click node_auth "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/middlewares/requireAuth.ts"
click node_seed "https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/seed.ts"
click node_database "https://github.com/issaalbalushi/mizan/tree/main/lib/db/src/schema"
click node_sandbox_app "https://github.com/issaalbalushi/mizan/blob/main/artifacts/mockup-sandbox/src/App.tsx"
click node_mockup_plugin "https://github.com/issaalbalushi/mizan/blob/main/artifacts/mockup-sandbox/mockupPreviewPlugin.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_app,node_layout,node_dashboard_ui,node_accounts_ui,node_transactions_ui,node_investments_ui,node_zakat_ui,node_products_ui,node_user toneBlue
class node_api_app,node_api_router,node_health,node_dashboard_api,node_accounts_api,node_categories_api,node_transactions_api,node_investments_api,node_zakat_api,node_products_api,node_auth,node_seed toneAmber
class node_database toneMint
class node_sandbox_app,node_mockup_plugin toneRose
```

## Components

### Finance application

- [App routing](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/App.tsx): `artifacts/app/src/App.tsx`
- [Application layout](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/components/layout.tsx): `artifacts/app/src/components/layout.tsx`
- [Dashboard page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/dashboard.tsx): `artifacts/app/src/pages/dashboard.tsx`
- [Accounts page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/accounts.tsx): `artifacts/app/src/pages/accounts.tsx`
- [Transactions page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/transactions.tsx): `artifacts/app/src/pages/transactions.tsx`
- [Investments page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/investments.tsx): `artifacts/app/src/pages/investments.tsx`
- [Zakat page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/zakat.tsx): `artifacts/app/src/pages/zakat.tsx`
- [Products page](https://github.com/issaalbalushi/mizan/blob/main/artifacts/app/src/pages/products.tsx): `artifacts/app/src/pages/products.tsx`

### API services

- [Express application](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/app.ts): `artifacts/api-server/src/app.ts`
- [API route registry](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/index.ts): `artifacts/api-server/src/routes/index.ts`
- [Health routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/health.ts): `artifacts/api-server/src/routes/health.ts`
- [Dashboard routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/dashboard.ts): `artifacts/api-server/src/routes/dashboard.ts`
- [Account routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/accounts.ts): `artifacts/api-server/src/routes/accounts.ts`
- [Category routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/categories.ts): `artifacts/api-server/src/routes/categories.ts`
- [Transaction routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/transactions.ts): `artifacts/api-server/src/routes/transactions.ts`
- [Investment routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/investments.ts): `artifacts/api-server/src/routes/investments.ts`
- [Zakat routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/zakat.ts): `artifacts/api-server/src/routes/zakat.ts`
- [Product routes](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/products.ts): `artifacts/api-server/src/routes/products.ts`
- [Authentication middleware](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/middlewares/requireAuth.ts): `artifacts/api-server/src/middlewares/requireAuth.ts`
- [Reference data seeding](https://github.com/issaalbalushi/mizan/blob/main/artifacts/api-server/src/routes/seed.ts): `artifacts/api-server/src/routes/seed.ts`

### Persistence

- [Domain database](https://github.com/issaalbalushi/mizan/tree/main/lib/db/src/schema): `lib/db/src/schema`

### Mockup preview

- [Preview renderer](https://github.com/issaalbalushi/mizan/blob/main/artifacts/mockup-sandbox/src/App.tsx): `artifacts/mockup-sandbox/src/App.tsx`
- [Component discovery](https://github.com/issaalbalushi/mizan/blob/main/artifacts/mockup-sandbox/mockupPreviewPlugin.ts): `artifacts/mockup-sandbox/mockupPreviewPlugin.ts`

### Other components

- **Finance user**

## Connections

- Finance user → App routing: opens (evidence: `artifacts/app/src/App.tsx`)
- App routing → Application layout: renders (evidence: `artifacts/app/src/App.tsx`)
- App routing → Dashboard page: routes to (evidence: `artifacts/app/src/App.tsx`)
- App routing → Accounts page: routes to (evidence: `artifacts/app/src/App.tsx`)
- App routing → Transactions page: routes to (evidence: `artifacts/app/src/App.tsx`)
- App routing → Investments page: routes to (evidence: `artifacts/app/src/App.tsx`)
- App routing → Zakat page: routes to (evidence: `artifacts/app/src/App.tsx`)
- App routing → Products page: routes to (evidence: `artifacts/app/src/App.tsx`)
- Express application → API route registry: mounts (evidence: `artifacts/api-server/src/app.ts`)
- Express application → Reference data seeding: starts seeding (evidence: `artifacts/api-server/src/app.ts`)
- API route registry → Health routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Dashboard routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Account routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Category routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Transaction routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Investment routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Zakat routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- API route registry → Product routes: registers (evidence: `artifacts/api-server/src/routes/index.ts`)
- Transaction routes → Authentication middleware: guards (evidence: `artifacts/api-server/src/routes/transactions.ts`)
- Dashboard routes → Authentication middleware: uses (evidence: `artifacts/api-server/src/routes/dashboard.ts`)
- Transaction routes → Domain database: reads and writes (evidence: `artifacts/api-server/src/routes/transactions.ts`)
- Reference data seeding → Domain database: seeds (evidence: `artifacts/api-server/src/routes/seed.ts`)
- Component discovery → Preview renderer: generates loaders (evidence: `artifacts/mockup-sandbox/mockupPreviewPlugin.ts`)
