# kk666679/halalchain_platform architecture

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

- Interactive diagram: https://gitdiagram.com/kk666679/halalchain_platform
- Repository: https://github.com/kk666679/halalchain_platform

## Overview

HalalChain is an AI-assisted halal commerce and compliance platform: supplier and product workflows collect evidence, apply deterministic policy decisions, and expose catalog and vendor capabilities through web clients and APIs. The map also preserves documented storage, agent evaluation, MCP, automation, blockchain, and data-ingestion branches. Edges use README architecture statements or shown references/calls; unsampled modules are represented only at supported directory paths, and their internal wiring is left out where evidence is unavailable.

Main entry points: [`HalalChain.Platform.Api`](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api) (Platform API), [`HalalChain.DataFlow/DataFlowPipeline.cs`](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.DataFlow/DataFlowPipeline.cs) (Data-flow pipeline), [`HalalChain.Platform.Http`](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Http) (Typed API client), [`HalalChain.Application/Agentic/Handlers/RunSupplierOnboardingHandler.cs`](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Application/Agentic/Handlers/RunSupplierOnboardingHandler.cs) (Supplier onboarding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Clients and access"]
  node_web["Customer web<br/>[HalalChain.Web]"]
  node_marketplace["Vendor marketplace"]
  node_cli["HalalChain CLI"]
  node_http["Typed API client"]
end

subgraph group_core["Commerce and compliance"]
  node_api["Platform API"]
  node_catalog["Catalog workflows<br/>[Handlers]"]
  node_vendors["Vendor workflows<br/>[Handlers]"]
  node_halal["Halal compliance<br/>[Halal]"]
  node_domain["Commerce domain<br/>[HalalChain.Domain]"]
end

subgraph group_evidence["Evidence and decisions"]
  node_agents["Supplier onboarding"]
  node_agent_runtime["Agent runtime<br/>[Runtime]"]
  node_agent_eval["Trace evaluation<br/>[Eval]"]
  node_decision["Deterministic decisions"]
  node_storage[("Evidence storage<br/>[HalalChain.Storage]")]
end

subgraph group_platform["Platform capabilities"]
  node_ai["AI inference<br/>[AI]"]
  node_ipfs["IPFS storage<br/>[Ipfs]"]
  node_blockchain["Blockchain<br/>[Blockchain]"]
  node_mcp["MCP server<br/>[HalalChain.Mcp]"]
end

subgraph group_operations["Automation and ingestion"]
  node_automation["Scheduled jobs<br/>[Jobs]"]
  node_scheduler["Job scheduler<br/>[JobScheduler.cs]"]
  node_dataflow["Data-flow pipeline"]
  node_source["Data source<br/>[Source]"]
  node_transform["Record transforms<br/>[Transform]"]
  node_validation["Record validation<br/>[Validation]"]
  node_destination["Data destination<br/>[Destination]"]
end

node_customer(("Customer"))
node_vendor(("Vendor"))

node_customer -->|"uses"| node_web
node_vendor -->|"uses"| node_marketplace
node_web -->|"calls"| node_http
node_marketplace -->|"calls"| node_http
node_http -->|"requests"| node_api
node_cli -->|"calls"| node_api
node_api -->|"dispatches"| node_catalog
node_api -->|"dispatches"| node_vendors
node_catalog -->|"uses"| node_domain
node_api -->|"orchestrates"| node_halal
node_agents -.->|"uses"| node_agent_runtime
node_agent_runtime -->|"reads evidence"| node_storage
node_agent_eval -.->|"loads traces"| node_storage
node_agents -->|"proposes evidence"| node_decision
node_decision -->|"returns verdict"| node_halal
node_api -->|"configures client"| node_ai
node_api -.->|"hosts services"| node_ipfs
node_api -.->|"hosts module"| node_blockchain
node_mcp -->|"reads via application"| node_api
node_scheduler -->|"runs jobs"| node_automation
node_dataflow -->|"extracts batches"| node_source
node_dataflow -->|"transforms records"| node_transform
node_dataflow -->|"validates records"| node_validation
node_dataflow -->|"loads batches"| node_destination

click node_web "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Web"
click node_marketplace "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Marketplace"
click node_cli "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain-Cli/src"
click node_api "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api"
click node_catalog "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Catalog/Handlers"
click node_vendors "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Vendors/Handlers"
click node_halal "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Halal"
click node_domain "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Domain"
click node_agents "https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Application/Agentic/Handlers/RunSupplierOnboardingHandler.cs"
click node_agent_runtime "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Agents/Runtime"
click node_agent_eval "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Agents/Eval"
click node_decision "https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Application/Decision/DeterministicComplianceDecisionEngine.cs"
click node_storage "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Storage"
click node_ai "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/AI"
click node_ipfs "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/Modules/Ipfs"
click node_blockchain "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/Modules/Blockchain"
click node_mcp "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Mcp"
click node_automation "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Automation/Jobs"
click node_scheduler "https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Automation/Scheduling/JobScheduler.cs"
click node_dataflow "https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.DataFlow/DataFlowPipeline.cs"
click node_source "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Source"
click node_transform "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Transform"
click node_validation "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Validation"
click node_destination "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Destination"
click node_http "https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Http"

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_web,node_marketplace,node_cli,node_http toneBlue
class node_api,node_catalog,node_vendors,node_halal,node_domain toneAmber
class node_agents,node_agent_runtime,node_agent_eval,node_decision,node_storage toneMint
class node_ai,node_ipfs,node_blockchain,node_mcp toneRose
class node_automation,node_scheduler,node_dataflow,node_source,node_transform,node_validation,node_destination,node_customer,node_vendor toneIndigo
```

## Components

### Clients and access

- [Customer web](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Web): `HalalChain.Web`
- [Vendor marketplace](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Marketplace): `HalalChain.Marketplace`
- [HalalChain CLI](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain-Cli/src): `HalalChain-Cli/src`
- [Typed API client](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Http): `HalalChain.Platform.Http`

### Commerce and compliance

- [Platform API](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api): `HalalChain.Platform.Api`
- [Catalog workflows](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Catalog/Handlers): `HalalChain.Application/Catalog/Handlers`
- [Vendor workflows](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Vendors/Handlers): `HalalChain.Application/Vendors/Handlers`
- [Halal compliance](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Application/Halal): `HalalChain.Application/Halal`
- [Commerce domain](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Domain): `HalalChain.Domain`

### Evidence and decisions

- [Supplier onboarding](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Application/Agentic/Handlers/RunSupplierOnboardingHandler.cs): `HalalChain.Application/Agentic/Handlers/RunSupplierOnboardingHandler.cs`
- [Agent runtime](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Agents/Runtime): `HalalChain.Agents/Runtime`
- [Trace evaluation](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Agents/Eval): `HalalChain.Agents/Eval`
- [Deterministic decisions](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Application/Decision/DeterministicComplianceDecisionEngine.cs): `HalalChain.Application/Decision/DeterministicComplianceDecisionEngine.cs`
- [Evidence storage](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Storage): `HalalChain.Storage`

### Platform capabilities

- [AI inference](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/AI): `HalalChain.Platform.Api/AI`
- [IPFS storage](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/Modules/Ipfs): `HalalChain.Platform.Api/Modules/Ipfs`
- [Blockchain](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Platform.Api/Modules/Blockchain): `HalalChain.Platform.Api/Modules/Blockchain`
- [MCP server](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Mcp): `HalalChain.Mcp`

### Automation and ingestion

- [Scheduled jobs](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.Automation/Jobs): `HalalChain.Automation/Jobs`
- [Job scheduler](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.Automation/Scheduling/JobScheduler.cs): `HalalChain.Automation/Scheduling/JobScheduler.cs`
- [Data-flow pipeline](https://github.com/kk666679/halalchain_platform/blob/main/HalalChain.DataFlow/DataFlowPipeline.cs): `HalalChain.DataFlow/DataFlowPipeline.cs`
- [Data source](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Source): `HalalChain.DataFlow/Source`
- [Record transforms](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Transform): `HalalChain.DataFlow/Transform`
- [Record validation](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Validation): `HalalChain.DataFlow/Validation`
- [Data destination](https://github.com/kk666679/halalchain_platform/tree/main/HalalChain.DataFlow/Destination): `HalalChain.DataFlow/Destination`

### Other components

- **Customer**
- **Vendor**

## Connections

- Customer → Customer web: uses
- Vendor → Vendor marketplace: uses
- Customer web → Typed API client: calls (evidence: `HalalChain.Web/Program.cs`)
- Vendor marketplace → Typed API client: calls (evidence: `HalalChain.Marketplace/Program.cs`)
- Typed API client → Platform API: requests
- HalalChain CLI → Platform API: calls (evidence: `HalalChain-Cli/src/commands/server.ts`)
- Platform API → Catalog workflows: dispatches (evidence: `HalalChain.Platform.Api/Program.cs`)
- Platform API → Vendor workflows: dispatches (evidence: `HalalChain.Platform.Api/Program.cs`)
- Catalog workflows → Commerce domain: uses
- Platform API → Halal compliance: orchestrates (evidence: `HalalChain.Platform.Api/Program.cs`)
- Supplier onboarding → Agent runtime: uses
- Agent runtime → Evidence storage: reads evidence
- Trace evaluation → Evidence storage: loads traces
- Supplier onboarding → Deterministic decisions: proposes evidence
- Deterministic decisions → Halal compliance: returns verdict
- Platform API → AI inference: configures client (evidence: `HalalChain.Platform.Api/Program.cs`)
- Platform API → IPFS storage: hosts services (evidence: `HalalChain.Platform.Api/Modules/Ipfs/PinataStorageService.cs`)
- Platform API → Blockchain: hosts module (evidence: `HalalChain.Platform.Api/Program.cs`)
- MCP server → Platform API: reads via application
- Job scheduler → Scheduled jobs: runs jobs (evidence: `HalalChain.Automation/Program.cs`)
- Data-flow pipeline → Data source: extracts batches (evidence: `HalalChain.DataFlow/DataFlowPipeline.cs`)
- Data-flow pipeline → Record transforms: transforms records (evidence: `HalalChain.DataFlow/DataFlowPipeline.cs`)
- Data-flow pipeline → Record validation: validates records (evidence: `HalalChain.DataFlow/DataFlowPipeline.cs`)
- Data-flow pipeline → Data destination: loads batches (evidence: `HalalChain.DataFlow/DataFlowPipeline.cs`)
