# walebant/company-verify architecture

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

- Interactive diagram: https://gitdiagram.com/walebant/company-verify
- Repository: https://github.com/walebant/company-verify

## Overview

company-verify is a small Node.js library for searching Nigeria’s Corporate Affairs Commission (CAC) company records and Federal Inland Revenue Service (FIRS) taxpayer details. Consumers call the exported search functions; each controller contacts its respective government service and returns the response data. The source shows these two independent flows, not a shared storage layer. Note: the FIRS criteria condition appears to reject every value, so its documented lookup flow may not reach the request. The map is based on the README and the indexed, excerpted source files.

Main entry points: [`src/controllers/cac_search.js`](https://github.com/walebant/company-verify/blob/master/src/controllers/cac_search.js) (Company search), [`src/controllers/firs_search.js`](https://github.com/walebant/company-verify/blob/master/src/controllers/firs_search.js) (Taxpayer search), [`index.js`](https://github.com/walebant/company-verify/blob/master/index.js) (Exports)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Public API"]
  node_entry["Exports<br/>[index.js]"]
end

subgraph group_cac["CAC Search"]
  node_cac_search["Company search<br/>[cac_search.js]"]
  node_cac_service["CAC service"]
end

subgraph group_firs["FIRS Lookup"]
  node_firs_search["Taxpayer search<br/>[firs_search.js]"]
  node_firs_service["FIRS service"]
end

node_consumer(("Package consumer"))

node_consumer -->|"imports and calls"| node_entry
node_entry -->|"exports"| node_cac_search
node_entry -->|"exports"| node_firs_search
node_cac_search -->|"POSTs search"| node_cac_service
node_cac_service -->|"returns JSON"| node_cac_search
node_cac_search -->|"returns results"| node_consumer
node_firs_search -->|"POSTs lookup"| node_firs_service
node_firs_service -->|"returns HTML"| node_firs_search
node_firs_search -->|"returns details"| node_consumer

click node_entry "https://github.com/walebant/company-verify/blob/master/index.js"
click node_cac_search "https://github.com/walebant/company-verify/blob/master/src/controllers/cac_search.js"
click node_firs_search "https://github.com/walebant/company-verify/blob/master/src/controllers/firs_search.js"

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_entry toneBlue
class node_cac_search,node_cac_service toneAmber
class node_firs_search,node_firs_service toneMint
class node_consumer toneIndigo
```

## Components

### Public API

- [Exports](https://github.com/walebant/company-verify/blob/master/index.js): `index.js`

### CAC Search

- [Company search](https://github.com/walebant/company-verify/blob/master/src/controllers/cac_search.js): `src/controllers/cac_search.js`
- **CAC service**

### FIRS Lookup

- [Taxpayer search](https://github.com/walebant/company-verify/blob/master/src/controllers/firs_search.js): `src/controllers/firs_search.js`
- **FIRS service**

### Other components

- **Package consumer**

## Connections

- Package consumer → Exports: imports and calls (evidence: `README.md`)
- Exports → Company search: exports (evidence: `index.js`)
- Exports → Taxpayer search: exports (evidence: `index.js`)
- Company search → CAC service: POSTs search (evidence: `src/controllers/cac_search.js`)
- CAC service → Company search: returns JSON (evidence: `src/controllers/cac_search.js`)
- Company search → Package consumer: returns results (evidence: `README.md`)
- Taxpayer search → FIRS service: POSTs lookup (evidence: `src/controllers/firs_search.js`)
- FIRS service → Taxpayer search: returns HTML (evidence: `src/controllers/firs_search.js`)
- Taxpayer search → Package consumer: returns details (evidence: `README.md`)
