# dhanyaa10/daas-lab8 architecture

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

- Interactive diagram: https://gitdiagram.com/dhanyaa10/daas-lab8
- Repository: https://github.com/dhanyaa10/daas-lab8

## Overview

This repository provides a read-only Flask API for a seeded book catalog. A client requests book searches or individual records, or asks for health, genre summaries, and inventory statistics; the corresponding handlers query SQLite and return JSON. The seed script creates the books table, indexes, and sample records. The map reflects the supplied app and seed excerpts; the README is empty, and no separate database file appears in the tree.

Main entry points: [`seed_db.py`](https://github.com/dhanyaa10/daas-lab8/blob/main/seed_db.py) (SQLite catalog), [`app.py`](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py) (Book search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Catalog API"]
  node_book_search["Book search<br/>[app.py]"]
  node_book_lookup["Book lookup<br/>[app.py]"]
  node_health["Health check<br/>[app.py]"]
  node_genre_summary["Genre summary<br/>[app.py]"]
  node_inventory_stats["Inventory stats<br/>[app.py]"]
end

subgraph group_storage["Catalog Storage"]
  node_sqlite_catalog[("SQLite catalog<br/>[seed_db.py]")]
  node_catalog_seeder["Catalog seeder<br/>[seed_db.py]"]
end

node_client(("API client"))

node_client -->|"requests"| node_book_search
node_client -->|"requests"| node_book_lookup
node_client -->|"requests"| node_health
node_client -->|"requests"| node_genre_summary
node_client -->|"requests"| node_inventory_stats
node_book_search -->|"queries"| node_sqlite_catalog
node_book_lookup -->|"queries"| node_sqlite_catalog
node_health -->|"counts"| node_sqlite_catalog
node_genre_summary -->|"aggregates"| node_sqlite_catalog
node_inventory_stats -->|"aggregates"| node_sqlite_catalog
node_catalog_seeder -->|"creates and seeds"| node_sqlite_catalog

click node_book_search "https://github.com/dhanyaa10/daas-lab8/blob/main/app.py"
click node_book_lookup "https://github.com/dhanyaa10/daas-lab8/blob/main/app.py"
click node_health "https://github.com/dhanyaa10/daas-lab8/blob/main/app.py"
click node_genre_summary "https://github.com/dhanyaa10/daas-lab8/blob/main/app.py"
click node_inventory_stats "https://github.com/dhanyaa10/daas-lab8/blob/main/app.py"
click node_sqlite_catalog "https://github.com/dhanyaa10/daas-lab8/blob/main/seed_db.py"
click node_catalog_seeder "https://github.com/dhanyaa10/daas-lab8/blob/main/seed_db.py"

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_book_search,node_book_lookup,node_health,node_genre_summary,node_inventory_stats,node_client toneBlue
class node_sqlite_catalog,node_catalog_seeder toneAmber
```

## Components

### Catalog API

- [Book search](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py): `app.py`
- [Book lookup](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py): `app.py`
- [Health check](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py): `app.py`
- [Genre summary](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py): `app.py`
- [Inventory stats](https://github.com/dhanyaa10/daas-lab8/blob/main/app.py): `app.py`

### Catalog Storage

- [SQLite catalog](https://github.com/dhanyaa10/daas-lab8/blob/main/seed_db.py): `seed_db.py`
- [Catalog seeder](https://github.com/dhanyaa10/daas-lab8/blob/main/seed_db.py): `seed_db.py`

### Other components

- **API client**

## Connections

- API client → Book search: requests (evidence: `app.py`)
- API client → Book lookup: requests (evidence: `app.py`)
- API client → Health check: requests (evidence: `app.py`)
- API client → Genre summary: requests (evidence: `app.py`)
- API client → Inventory stats: requests (evidence: `app.py`)
- Book search → SQLite catalog: queries (evidence: `app.py`)
- Book lookup → SQLite catalog: queries (evidence: `app.py`)
- Health check → SQLite catalog: counts (evidence: `app.py`)
- Genre summary → SQLite catalog: aggregates (evidence: `app.py`)
- Inventory stats → SQLite catalog: aggregates (evidence: `app.py`)
- Catalog seeder → SQLite catalog: creates and seeds (evidence: `seed_db.py`)
