# kanusoft/bet-kanu architecture

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

- Interactive diagram: https://gitdiagram.com/kanusoft/bet-kanu
- Repository: https://github.com/kanusoft/bet-kanu

## Overview

BET KANU is an ASP.NET website for presenting products and services, including a book-reader API, product pages, and email contact. The visible reader workflow reaches a controller, uses a unit of work to access book and bundle data, and returns reader-oriented bundle records. The source index supports the repository and model relationships shown below; several product-area controllers and integrations are listed but not sampled, so their internal behavior is not inferred.

Main entry points: [`BetKanu.Data/BKdbContext.cs`](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/BKdbContext.cs) (EF data context), [`BetKanu.Data/UnitOfWork.cs`](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/UnitOfWork.cs) (Unit of work), [`BetKanu.Data/Repositories/BookBundleDAO.cs`](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/BookBundleDAO.cs) (Book bundles), [`BET KANU/Controllers/BKReaderServiceController.cs`](https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/BKReaderServiceController.cs) (Reader service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_products["Product pages"]
  node_siteareas["Site sections"]
end

subgraph group_reader["Book Reader"]
  node_readerapi["Reader service"]
  node_readerbundle["Reader bundle<br/>[BKRBundle.cs]"]
end

subgraph group_data["Catalog Data"]
  node_uow["Unit of work<br/>[UnitOfWork.cs]"]
  node_bookrepo["Book bundles<br/>[BookBundleDAO.cs]"]
  node_productrepo["Product repository<br/>[ProductDAO.cs]"]
  node_managerrepo["Manager repository<br/>[MangerRepo.cs]"]
  node_dbcontext[("EF data context<br/>[BKdbContext.cs]")]
  node_productmodel["Product model<br/>[Product.cs]"]
  node_episode["Product episodes<br/>[ProductEpisode.cs]"]
  node_category["Product categories<br/>[Category.cs]"]
  node_target["Audience targets<br/>[Target.cs]"]
  node_bookmodel["Book model<br/>[Book.cs]"]
  node_bundlemodel["Bundle model<br/>[Bundle.cs]"]
end

subgraph group_messaging["Messaging"]
  node_emailcontroller["Email endpoint"]
  node_emailservice["Email service<br/>[EmailService.cs]"]
end

node_visitor(("Site visitor"))
node_smtp{{"SMTP server"}}

node_visitor -.->|"requests pages"| node_products
node_visitor -.->|"requests sections"| node_siteareas
node_visitor -.->|"requests reader data"| node_readerapi
node_visitor -.->|"submits contact"| node_emailcontroller
node_readerapi -->|"uses data access"| node_uow
node_uow -->|"creates repository"| node_bookrepo
node_uow -->|"creates repository"| node_productrepo
node_uow -->|"creates repository"| node_managerrepo
node_bookrepo -->|"queries"| node_dbcontext
node_bookrepo -->|"projects results"| node_readerbundle
node_dbcontext -->|"maps entity"| node_productmodel
node_dbcontext -->|"maps entity"| node_episode
node_dbcontext -->|"maps entity"| node_bookmodel
node_dbcontext -->|"maps entity"| node_bundlemodel
node_emailcontroller -->|"calls"| node_emailservice
node_emailservice -->|"sends mail"| node_smtp

click node_products "https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/ProductsController.cs"
click node_siteareas "https://github.com/kanusoft/bet-kanu/tree/master/BET%20KANU/Controllers"
click node_readerapi "https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/BKReaderServiceController.cs"
click node_uow "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/UnitOfWork.cs"
click node_bookrepo "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/BookBundleDAO.cs"
click node_productrepo "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/ProductDAO.cs"
click node_managerrepo "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/MangerRepo.cs"
click node_dbcontext "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/BKdbContext.cs"
click node_productmodel "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Product.cs"
click node_episode "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/ProductEpisode.cs"
click node_category "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Common/Category.cs"
click node_target "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Common/Target.cs"
click node_bookmodel "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Book.cs"
click node_bundlemodel "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Bundle.cs"
click node_readerbundle "https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/BKRBundle.cs"
click node_emailcontroller "https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/EmailServiceController.cs"
click node_emailservice "https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Services/EmailService.cs"

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_products,node_siteareas toneBlue
class node_readerapi,node_readerbundle toneAmber
class node_uow,node_bookrepo,node_productrepo,node_managerrepo,node_dbcontext,node_productmodel,node_episode,node_category,node_target,node_bookmodel,node_bundlemodel,node_smtp toneMint
class node_emailcontroller,node_emailservice toneRose
class node_visitor toneIndigo
```

## Components

### Web Experience

- [Product pages](https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/ProductsController.cs): `BET KANU/Controllers/ProductsController.cs`
- [Site sections](https://github.com/kanusoft/bet-kanu/tree/master/BET%20KANU/Controllers): `BET KANU/Controllers`

### Book Reader

- [Reader service](https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/BKReaderServiceController.cs): `BET KANU/Controllers/BKReaderServiceController.cs`
- [Reader bundle](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/BKRBundle.cs): `BetKanu.Models/BKRBundle.cs`

### Catalog Data

- [Unit of work](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/UnitOfWork.cs): `BetKanu.Data/UnitOfWork.cs`
- [Book bundles](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/BookBundleDAO.cs): `BetKanu.Data/Repositories/BookBundleDAO.cs`
- [Product repository](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/ProductDAO.cs): `BetKanu.Data/Repositories/ProductDAO.cs`
- [Manager repository](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/Repositories/MangerRepo.cs): `BetKanu.Data/Repositories/MangerRepo.cs`
- [EF data context](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Data/BKdbContext.cs): `BetKanu.Data/BKdbContext.cs`
- [Product model](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Product.cs): `BetKanu.Models/Product.cs`
- [Product episodes](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/ProductEpisode.cs): `BetKanu.Models/ProductEpisode.cs`
- [Product categories](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Common/Category.cs): `BetKanu.Models/Common/Category.cs`
- [Audience targets](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Common/Target.cs): `BetKanu.Models/Common/Target.cs`
- [Book model](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Book.cs): `BetKanu.Models/Book.cs`
- [Bundle model](https://github.com/kanusoft/bet-kanu/blob/master/BetKanu.Models/Bundle.cs): `BetKanu.Models/Bundle.cs`

### Messaging

- [Email endpoint](https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Controllers/EmailServiceController.cs): `BET KANU/Controllers/EmailServiceController.cs`
- [Email service](https://github.com/kanusoft/bet-kanu/blob/master/BET%20KANU/Services/EmailService.cs): `BET KANU/Services/EmailService.cs`

### Other components

- **Site visitor**
- **SMTP server**

## Connections

- Site visitor → Product pages: requests pages
- Site visitor → Site sections: requests sections
- Site visitor → Reader service: requests reader data
- Site visitor → Email endpoint: submits contact
- Reader service → Unit of work: uses data access (evidence: `BET KANU/Controllers/BKReaderServiceController.cs`)
- Unit of work → Book bundles: creates repository (evidence: `BetKanu.Data/UnitOfWork.cs`)
- Unit of work → Product repository: creates repository (evidence: `BetKanu.Data/UnitOfWork.cs`)
- Unit of work → Manager repository: creates repository (evidence: `BetKanu.Data/UnitOfWork.cs`)
- Book bundles → EF data context: queries (evidence: `BetKanu.Data/Repositories/BookBundleDAO.cs`)
- Book bundles → Reader bundle: projects results (evidence: `BetKanu.Data/Repositories/BookBundleDAO.cs`)
- EF data context → Product model: maps entity (evidence: `BetKanu.Data/BKdbContext.cs`)
- EF data context → Product episodes: maps entity (evidence: `BetKanu.Data/BKdbContext.cs`)
- EF data context → Book model: maps entity (evidence: `BetKanu.Data/BKdbContext.cs`)
- EF data context → Bundle model: maps entity (evidence: `BetKanu.Data/BKdbContext.cs`)
- Email endpoint → Email service: calls (evidence: `BET KANU/Controllers/EmailServiceController.cs`)
- Email service → SMTP server: sends mail (evidence: `BET KANU/Services/EmailService.cs`)
