# ronaldmaciel/bookstore architecture

> Architecture diagram of the GitHub repository ronaldmaciel/bookstore, 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/ronaldmaciel/bookstore
- Repository: https://github.com/ronaldmaciel/bookstore

## Overview

BookStore is an iOS catalog for iOS books backed by Google Books. The main user journey is browsing and searching a book list, loading more results, opening a selected book’s details, and optionally following its purchase link. Favorites form a separate persisted-and-browsable branch. MVVM view models coordinate screen behavior; Alamofire handles networking and Kingfisher supplies book imagery. The README documents these capabilities, while the sampled source and index provide only partial call-flow evidence, so several documented links are dashed.

Main entry points: [`BookStore/BookStore/Screens/BookList/BooksTableViewController.swift`](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/BooksTableViewController.swift) (Book List Screen), [`BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift`](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift) (Book Details), [`BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift`](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift) (Favorites Screen), [`BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift`](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift) (Image Cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Book Catalog"]
  node_book_list["Book List Screen"]
  node_book_list_vm["Catalog View Model"]
  node_book_cell["Book Row<br/>[BookCell.swift]"]
  node_book_detail["Book Details"]
  node_detail_vm["Details View Model"]
end

subgraph group_favorites["Favorites"]
  node_favorite_screen["Favorites Screen"]
  node_favorite_vm["Favorites View Model"]
  node_favorite_cell["Favorite Row"]
  node_defaults[("Favorites Persistence")]
end

subgraph group_services["Data Services"]
  node_book_model["Book Data Model<br/>[BookModel.swift]"]
  node_book_response["API Response Model"]
  node_networking["Book Networking<br/>[Networking.swift]"]
  node_endpoint["Book Endpoint<br/>[BookEndpoint.swift]"]
end

subgraph group_dependencies["Image and Network Libraries"]
  node_alamofire["Alamofire Runtime"]
  node_kingfisher_api["Kingfisher Image API<br/>[Kingfisher.swift]"]
  node_kingfisher_manager["Image Retrieval"]
  node_image_cache[("Image Cache<br/>[ImageCache.swift]")]
  node_disk_storage[("Disk Storage<br/>[DiskStorage.swift]")]
  node_memory_storage[("Memory Storage")]
  node_image_processor["Image Processing"]
end

node_reader(("Reader"))
node_google_books{{"Google Books API"}}
node_buy_web{{"Book Purchase Page"}}

node_reader -->|"browses"| node_book_list
node_book_list -->|"loads catalog"| node_book_list_vm
node_book_list -->|"renders rows"| node_book_cell
node_book_list -->|"opens selection"| node_book_detail
node_book_list_vm -.->|"requests data"| node_alamofire
node_networking -->|"performs requests"| node_alamofire
node_networking -->|"decodes response"| node_book_response
node_book_response -->|"contains books"| node_book_model
node_networking -.->|"uses endpoint"| node_endpoint
node_alamofire -.->|"sends requests"| node_google_books
node_book_detail -->|"shows details"| node_detail_vm
node_book_detail -->|"opens purchase link"| node_buy_web
node_book_detail -.->|"loads cover"| node_kingfisher_api
node_reader -->|"views favorites"| node_favorite_screen
node_favorite_screen -->|"loads favorites"| node_favorite_vm
node_favorite_screen -->|"renders rows"| node_favorite_cell
node_favorite_screen -->|"reads favorites"| node_defaults
node_detail_vm -->|"saves favorites"| node_defaults
node_book_cell -->|"loads cover"| node_kingfisher_api
node_kingfisher_api -.->|"delegates retrieval"| node_kingfisher_manager
node_kingfisher_manager -->|"checks cache"| node_image_cache
node_image_cache -->|"uses memory store"| node_memory_storage
node_image_cache -->|"uses disk store"| node_disk_storage
node_image_cache -->|"processes images"| node_image_processor

click node_book_list "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/BooksTableViewController.swift"
click node_book_list_vm "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/BooksViewModel.swift"
click node_book_cell "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/Subviews/BookCell.swift"
click node_book_detail "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift"
click node_detail_vm "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookDetail/BookDetailViewModel.swift"
click node_book_model "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Model/BookModel.swift"
click node_book_response "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Model/BookListResponse.swift"
click node_networking "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Networking/Networking.swift"
click node_endpoint "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Networking/BookEndpoint.swift"
click node_favorite_screen "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift"
click node_favorite_vm "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewModel.swift"
click node_favorite_cell "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/Subviews/FavoriteBooksCell.swift"
click node_defaults "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Extensions/UserDefaults%2BExtension.swift"
click node_alamofire "https://github.com/ronaldmaciel/bookstore/tree/main/BookStore/Pods/Alamofire/Source"
click node_kingfisher_api "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/General/Kingfisher.swift"
click node_kingfisher_manager "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/General/KingfisherManager.swift"
click node_image_cache "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift"
click node_disk_storage "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/DiskStorage.swift"
click node_memory_storage "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift"
click node_image_processor "https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Image/ImageProcessor.swift"

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_list,node_book_list_vm,node_book_cell,node_book_detail,node_detail_vm toneBlue
class node_favorite_screen,node_favorite_vm,node_favorite_cell,node_defaults toneAmber
class node_book_model,node_book_response,node_networking,node_endpoint,node_google_books toneMint
class node_alamofire,node_kingfisher_api,node_kingfisher_manager,node_image_cache,node_disk_storage,node_memory_storage,node_image_processor toneRose
class node_reader,node_buy_web toneIndigo
```

## Components

### Book Catalog

- [Book List Screen](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/BooksTableViewController.swift): `BookStore/BookStore/Screens/BookList/BooksTableViewController.swift`
- [Catalog View Model](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/BooksViewModel.swift): `BookStore/BookStore/Screens/BookList/BooksViewModel.swift`
- [Book Row](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookList/Subviews/BookCell.swift): `BookStore/BookStore/Screens/BookList/Subviews/BookCell.swift`
- [Book Details](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift): `BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift`
- [Details View Model](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/BookDetail/BookDetailViewModel.swift): `BookStore/BookStore/Screens/BookDetail/BookDetailViewModel.swift`

### Favorites

- [Favorites Screen](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift): `BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift`
- [Favorites View Model](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewModel.swift): `BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewModel.swift`
- [Favorite Row](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Screens/FavoriteBooks/Subviews/FavoriteBooksCell.swift): `BookStore/BookStore/Screens/FavoriteBooks/Subviews/FavoriteBooksCell.swift`
- [Favorites Persistence](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Extensions/UserDefaults%2BExtension.swift): `BookStore/BookStore/Extensions/UserDefaults+Extension.swift`

### Data Services

- [Book Data Model](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Model/BookModel.swift): `BookStore/BookStore/Model/BookModel.swift`
- [API Response Model](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Model/BookListResponse.swift): `BookStore/BookStore/Model/BookListResponse.swift`
- [Book Networking](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Networking/Networking.swift): `BookStore/BookStore/Networking/Networking.swift`
- [Book Endpoint](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/BookStore/Networking/BookEndpoint.swift): `BookStore/BookStore/Networking/BookEndpoint.swift`

### Image and Network Libraries

- [Alamofire Runtime](https://github.com/ronaldmaciel/bookstore/tree/main/BookStore/Pods/Alamofire/Source): `BookStore/Pods/Alamofire/Source`
- [Kingfisher Image API](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/General/Kingfisher.swift): `BookStore/Pods/Kingfisher/Sources/General/Kingfisher.swift`
- [Image Retrieval](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/General/KingfisherManager.swift): `BookStore/Pods/Kingfisher/Sources/General/KingfisherManager.swift`
- [Image Cache](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift): `BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift`
- [Disk Storage](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/DiskStorage.swift): `BookStore/Pods/Kingfisher/Sources/Cache/DiskStorage.swift`
- [Memory Storage](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift): `BookStore/Pods/Kingfisher/Sources/Cache/MemoryStorage.swift`
- [Image Processing](https://github.com/ronaldmaciel/bookstore/blob/main/BookStore/Pods/Kingfisher/Sources/Image/ImageProcessor.swift): `BookStore/Pods/Kingfisher/Sources/Image/ImageProcessor.swift`

### Other components

- **Reader**
- **Google Books API**
- **Book Purchase Page**

## Connections

- Reader → Book List Screen: browses
- Book List Screen → Catalog View Model: loads catalog (evidence: `BookStore/BookStore/Screens/BookList/BooksTableViewController.swift`)
- Book List Screen → Book Row: renders rows (evidence: `BookStore/BookStore/Screens/BookList/BooksTableViewController.swift`)
- Book List Screen → Book Details: opens selection (evidence: `BookStore/BookStore/Screens/BookList/BooksTableViewController.swift`)
- Catalog View Model → Alamofire Runtime: requests data (evidence: `BookStore/BookStore/Screens/BookList/BooksViewModel.swift`)
- Book Networking → Alamofire Runtime: performs requests (evidence: `BookStore/BookStore/Networking/Networking.swift`)
- Book Networking → API Response Model: decodes response (evidence: `BookStore/BookStore/Networking/Networking.swift`)
- API Response Model → Book Data Model: contains books (evidence: `BookStore/BookStore/Model/BookListResponse.swift`)
- Book Networking → Book Endpoint: uses endpoint
- Alamofire Runtime → Google Books API: sends requests
- Book Details → Details View Model: shows details (evidence: `BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift`)
- Book Details → Book Purchase Page: opens purchase link (evidence: `BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift`)
- Book Details → Kingfisher Image API: loads cover (evidence: `BookStore/BookStore/Screens/BookDetail/BookDetailViewController.swift`)
- Reader → Favorites Screen: views favorites
- Favorites Screen → Favorites View Model: loads favorites (evidence: `BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift`)
- Favorites Screen → Favorite Row: renders rows (evidence: `BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift`)
- Favorites Screen → Favorites Persistence: reads favorites (evidence: `BookStore/BookStore/Screens/FavoriteBooks/FavoriteBooksViewController.swift`)
- Details View Model → Favorites Persistence: saves favorites
- Book Row → Kingfisher Image API: loads cover (evidence: `BookStore/BookStore/Screens/BookList/Subviews/BookCell.swift`)
- Kingfisher Image API → Image Retrieval: delegates retrieval (evidence: `BookStore/Pods/Kingfisher/Sources/General/KingfisherManager.swift`)
- Image Retrieval → Image Cache: checks cache (evidence: `BookStore/Pods/Kingfisher/Sources/General/KingfisherManager.swift`)
- Image Cache → Memory Storage: uses memory store (evidence: `BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift`)
- Image Cache → Disk Storage: uses disk store (evidence: `BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift`)
- Image Cache → Image Processing: processes images (evidence: `BookStore/Pods/Kingfisher/Sources/Cache/ImageCache.swift`)
