# marzaq99/tarif architecture

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

- Interactive diagram: https://gitdiagram.com/marzaq99/tarif
- Repository: https://github.com/marzaq99/tarif
- Video tour (about a minute): https://gitdiagram.com/marzaq99/tarif/video

## Overview

TARIF SCHEDULE turns a commodity code into a structured tariff report, with keyword/code suggestions as an alternate way to find a code. The sampled source shows a Netlify relay validating requests and fetching commodity data or suggestions from external services. The README describes report details and user actions, but the frontend files were not sampled, so their internal behavior and connections to the relay cannot be verified here.

Main entry points: [`public/index.html`](https://github.com/marzaq99/tarif/blob/main/public/index.html) (Search and report), [`netlify/functions/tariff.mjs`](https://github.com/marzaq99/tarif/blob/main/netlify/functions/tariff.mjs) (Netlify API relay), [`tariff.mjs`](https://github.com/marzaq99/tarif/blob/main/tariff.mjs) (Tariff API relay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Report interface"]
  node_web["Search and report<br/>[index.html]"]
end

subgraph group_relay["Tariff relay"]
  node_root_proxy["Tariff API relay<br/>[tariff.mjs]"]
  node_netlify_proxy["Netlify API relay<br/>[tariff.mjs]"]
end

node_user(("Commodity-code user"))
node_tariff_api["UK XI tariff API"]
node_suggest_api["Tariffnumber suggestions"]

node_user -->|"searches and reads"| node_web
node_web -->|"presents report"| node_user
node_web -.->|"requests data"| node_netlify_proxy
node_netlify_proxy -->|"fetches commodity"| node_tariff_api
node_netlify_proxy -->|"fetches suggestions"| node_suggest_api
node_root_proxy -->|"fetches commodity"| node_tariff_api
node_root_proxy -->|"fetches suggestions"| node_suggest_api

click node_web "https://github.com/marzaq99/tarif/blob/main/public/index.html"
click node_root_proxy "https://github.com/marzaq99/tarif/blob/main/tariff.mjs"
click node_netlify_proxy "https://github.com/marzaq99/tarif/blob/main/netlify/functions/tariff.mjs"

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_user toneBlue
class node_root_proxy,node_netlify_proxy toneAmber
class node_tariff_api toneMint
class node_suggest_api toneIndigo
```

## Components

### Report interface

- [Search and report](https://github.com/marzaq99/tarif/blob/main/public/index.html): `public/index.html`

### Tariff relay

- [Tariff API relay](https://github.com/marzaq99/tarif/blob/main/tariff.mjs): `tariff.mjs`
- [Netlify API relay](https://github.com/marzaq99/tarif/blob/main/netlify/functions/tariff.mjs): `netlify/functions/tariff.mjs`

### Other components

- **Commodity-code user**
- **UK XI tariff API**
- **Tariffnumber suggestions**

## Connections

- Commodity-code user → Search and report: searches and reads (evidence: `README.md`)
- Search and report → Commodity-code user: presents report (evidence: `README.md`)
- Search and report → Netlify API relay: requests data
- Netlify API relay → UK XI tariff API: fetches commodity (evidence: `netlify/functions/tariff.mjs`)
- Netlify API relay → Tariffnumber suggestions: fetches suggestions (evidence: `netlify/functions/tariff.mjs`)
- Tariff API relay → UK XI tariff API: fetches commodity (evidence: `tariff.mjs`)
- Tariff API relay → Tariffnumber suggestions: fetches suggestions (evidence: `tariff.mjs`)
