# abdiu34567/bible-api architecture

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

- Interactive diagram: https://gitdiagram.com/abdiu34567/bible-api
- Repository: https://github.com/abdiu34567/bible-api

## Overview

This is an Express Bible API for KJV, Oromo, and Amhara content. Clients request book IDs or metadata, retrieve a chapter or single verse, or search verse text; the router dispatches each request to an API handler, which delegates data access to models. The README documents all five capabilities, though the list-book and chapter-query model implementations were not excerpted. The graph shows the documented and indexed module relationships; it does not infer database wiring from the Mongoose dependency alone.

Main entry points: [`router.js`](https://github.com/abdiu34567/bible-api/blob/main/router.js) (API router), [`utils/model.js`](https://github.com/abdiu34567/bible-api/blob/main/utils/model.js) (Version selection), [`models/schema/schema.js`](https://github.com/abdiu34567/bible-api/blob/main/models/schema/schema.js) (Verse schema), [`api/listBookId.js`](https://github.com/abdiu34567/bible-api/blob/main/api/listBookId.js) (List book IDs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP routing"]
  node_server["Application server<br/>[index.js]"]
  node_router["API router<br/>[router.js]"]
end

subgraph group_handlers["Request handlers"]
  node_list_handler["List book IDs<br/>[listBookId.js]"]
  node_info_handler["Book information<br/>[bookInfo.js]"]
  node_chapter_handler["Chapter verses<br/>[sendverse.js]"]
  node_single_handler["Single verse<br/>[sendSingleVerse.js]"]
  node_search_handler["Verse search<br/>[searchforverses.js]"]
end

subgraph group_data["Bible data access"]
  node_list_model["Book ID model<br/>[listBook.js]"]
  node_info_model["Book metadata model<br/>[bookInfo.js]"]
  node_chapter_model["Chapter query model<br/>[commonModel.js]"]
  node_single_model["Single verse query<br/>[sendSingleVerse.js]"]
  node_search_model["Verse search query<br/>[searchForVerse.js]"]
  node_version_dispatch["Version selection<br/>[model.js]"]
end

subgraph group_versions["Version models"]
  node_shared_schema["Verse schema<br/>[schema.js]"]
  node_amhara_model["Amhara model<br/>[amharamodel.js]"]
  node_kjv_model["KJV model<br/>[kjvmodel.js]"]
  node_oromo_model["Oromo model<br/>[oromomodel.js]"]
end

node_client(("API client"))

node_client -->|"requests"| node_router
node_server -->|"mounts"| node_router
node_router -->|"routes to"| node_list_handler
node_router -->|"routes to"| node_info_handler
node_router -->|"routes to"| node_chapter_handler
node_router -->|"routes to"| node_single_handler
node_router -->|"routes to"| node_search_handler
node_list_handler -->|"queries"| node_list_model
node_info_handler -->|"queries"| node_info_model
node_chapter_handler -->|"queries"| node_chapter_model
node_single_handler -->|"queries"| node_single_model
node_search_handler -->|"queries"| node_search_model
node_chapter_model -->|"uses"| node_version_dispatch
node_single_model -->|"selects version"| node_version_dispatch
node_search_model -->|"selects version"| node_version_dispatch
node_version_dispatch -->|"selects"| node_amhara_model
node_version_dispatch -->|"selects"| node_kjv_model
node_version_dispatch -->|"selects"| node_oromo_model
node_amhara_model -->|"uses schema"| node_shared_schema
node_kjv_model -->|"uses schema"| node_shared_schema
node_oromo_model -->|"uses schema"| node_shared_schema

click node_server "https://github.com/abdiu34567/bible-api/blob/main/index.js"
click node_router "https://github.com/abdiu34567/bible-api/blob/main/router.js"
click node_list_handler "https://github.com/abdiu34567/bible-api/blob/main/api/listBookId.js"
click node_info_handler "https://github.com/abdiu34567/bible-api/blob/main/api/bookInfo.js"
click node_chapter_handler "https://github.com/abdiu34567/bible-api/blob/main/api/sendverse.js"
click node_single_handler "https://github.com/abdiu34567/bible-api/blob/main/api/sendSingleVerse.js"
click node_search_handler "https://github.com/abdiu34567/bible-api/blob/main/api/searchforverses.js"
click node_list_model "https://github.com/abdiu34567/bible-api/blob/main/models/listBook.js"
click node_info_model "https://github.com/abdiu34567/bible-api/blob/main/models/bookInfo.js"
click node_chapter_model "https://github.com/abdiu34567/bible-api/blob/main/models/commonModel.js"
click node_single_model "https://github.com/abdiu34567/bible-api/blob/main/models/sendSingleVerse.js"
click node_search_model "https://github.com/abdiu34567/bible-api/blob/main/models/searchForVerse.js"
click node_version_dispatch "https://github.com/abdiu34567/bible-api/blob/main/utils/model.js"
click node_shared_schema "https://github.com/abdiu34567/bible-api/blob/main/models/schema/schema.js"
click node_amhara_model "https://github.com/abdiu34567/bible-api/blob/main/models/schema/amharamodel.js"
click node_kjv_model "https://github.com/abdiu34567/bible-api/blob/main/models/schema/kjvmodel.js"
click node_oromo_model "https://github.com/abdiu34567/bible-api/blob/main/models/schema/oromomodel.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_server,node_router,node_client toneBlue
class node_list_handler,node_info_handler,node_chapter_handler,node_single_handler,node_search_handler toneAmber
class node_list_model,node_info_model,node_chapter_model,node_single_model,node_search_model,node_version_dispatch toneMint
class node_shared_schema,node_amhara_model,node_kjv_model,node_oromo_model toneRose
```

## Components

### HTTP routing

- [Application server](https://github.com/abdiu34567/bible-api/blob/main/index.js): `index.js`
- [API router](https://github.com/abdiu34567/bible-api/blob/main/router.js): `router.js`

### Request handlers

- [List book IDs](https://github.com/abdiu34567/bible-api/blob/main/api/listBookId.js): `api/listBookId.js`
- [Book information](https://github.com/abdiu34567/bible-api/blob/main/api/bookInfo.js): `api/bookInfo.js`
- [Chapter verses](https://github.com/abdiu34567/bible-api/blob/main/api/sendverse.js): `api/sendverse.js`
- [Single verse](https://github.com/abdiu34567/bible-api/blob/main/api/sendSingleVerse.js): `api/sendSingleVerse.js`
- [Verse search](https://github.com/abdiu34567/bible-api/blob/main/api/searchforverses.js): `api/searchforverses.js`

### Bible data access

- [Book ID model](https://github.com/abdiu34567/bible-api/blob/main/models/listBook.js): `models/listBook.js`
- [Book metadata model](https://github.com/abdiu34567/bible-api/blob/main/models/bookInfo.js): `models/bookInfo.js`
- [Chapter query model](https://github.com/abdiu34567/bible-api/blob/main/models/commonModel.js): `models/commonModel.js`
- [Single verse query](https://github.com/abdiu34567/bible-api/blob/main/models/sendSingleVerse.js): `models/sendSingleVerse.js`
- [Verse search query](https://github.com/abdiu34567/bible-api/blob/main/models/searchForVerse.js): `models/searchForVerse.js`
- [Version selection](https://github.com/abdiu34567/bible-api/blob/main/utils/model.js): `utils/model.js`

### Version models

- [Verse schema](https://github.com/abdiu34567/bible-api/blob/main/models/schema/schema.js): `models/schema/schema.js`
- [Amhara model](https://github.com/abdiu34567/bible-api/blob/main/models/schema/amharamodel.js): `models/schema/amharamodel.js`
- [KJV model](https://github.com/abdiu34567/bible-api/blob/main/models/schema/kjvmodel.js): `models/schema/kjvmodel.js`
- [Oromo model](https://github.com/abdiu34567/bible-api/blob/main/models/schema/oromomodel.js): `models/schema/oromomodel.js`

### Other components

- **API client**

## Connections

- API client → API router: requests (evidence: `README.md`)
- Application server → API router: mounts (evidence: `index.js`)
- API router → List book IDs: routes to (evidence: `router.js`)
- API router → Book information: routes to (evidence: `router.js`)
- API router → Chapter verses: routes to (evidence: `router.js`)
- API router → Single verse: routes to (evidence: `router.js`)
- API router → Verse search: routes to (evidence: `router.js`)
- List book IDs → Book ID model: queries (evidence: `api/listBookId.js`)
- Book information → Book metadata model: queries (evidence: `api/bookInfo.js`)
- Chapter verses → Chapter query model: queries (evidence: `api/sendverse.js`)
- Single verse → Single verse query: queries (evidence: `api/sendSingleVerse.js`)
- Verse search → Verse search query: queries (evidence: `api/searchforverses.js`)
- Chapter query model → Version selection: uses (evidence: `models/commonModel.js`)
- Single verse query → Version selection: selects version (evidence: `models/sendSingleVerse.js`)
- Verse search query → Version selection: selects version (evidence: `models/searchForVerse.js`)
- Version selection → Amhara model: selects (evidence: `utils/model.js`)
- Version selection → KJV model: selects (evidence: `utils/model.js`)
- Version selection → Oromo model: selects (evidence: `utils/model.js`)
- Amhara model → Verse schema: uses schema (evidence: `models/schema/amharamodel.js`)
- KJV model → Verse schema: uses schema (evidence: `models/schema/kjvmodel.js`)
- Oromo model → Verse schema: uses schema (evidence: `models/schema/oromomodel.js`)
