# hard-rox/kathanika architecture

> Architecture diagram of the GitHub repository hard-rox/kathanika, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hard-rox/kathanika
- Repository: https://github.com/hard-rox/kathanika

## Overview

Kathanika is an integrated library system. A staff user works through the Angular application, which sends GraphQL requests to the .NET service; GraphQL exposes application operations, whose CQRS handlers use domain repositories backed by MongoDB. The tree shows cataloging, acquisition, patron, and circulation backend modules, while the sampled UI routes cover cataloging and purchase orders. Serials, reporting, discovery, notifications, and several patron-facing capabilities are README-documented but not represented by sampled implementation files; their wiring is therefore not inferred.

Main entry points: [`src/core/Kathanika.Application/Abstractions/Messaging/MediatRDispatcher.cs`](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Abstractions/Messaging/MediatRDispatcher.cs) (CQRS dispatcher), [`src/infrastructure/Kathanika.Infrastructure.Persistence/Repositories/BibRecordRepository.cs`](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Persistence/Repositories/BibRecordRepository.cs) (Mongo repositories), [`src/infrastructure/Kathanika.Infrastructure.Graphql/SchemaConfigurations.cs`](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/SchemaConfigurations.cs) (GraphQL schema), [`src/app-projects/ils-web/src/app/app.routes.ts`](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/app.routes.ts) (Feature routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["ILS web app<br/>[app.ts]"]
  node_routes["Feature routes<br/>[app.routes.ts]"]
  node_catalog_ui["Cataloging UI"]
  node_acq_ui["Purchase orders UI"]
  node_graphql_client["GraphQL client"]
end

subgraph group_api["GraphQL API"]
  node_web_service["Web service<br/>[Program.cs]"]
  node_graphql_schema["GraphQL schema"]
  node_bib_api["Catalog resolvers"]
  node_purchase_api["Acquisition resolvers"]
  node_patron_api["Patron resolvers<br/>[PatronQueries.cs]"]
end

subgraph group_application["Application logic"]
  node_dispatcher["CQRS dispatcher"]
  node_catalog_logic["Catalog operations"]
  node_circulation_logic["Circulation operations"]
  node_patron_logic["Patron operations"]
  node_acquisition_logic["Acquisition operations"]
  node_other_capabilities["Other documented capabilities"]
end

subgraph group_domain["Library domain"]
  node_domain_models["Domain aggregates<br/>[BibRecord.cs]"]
end

subgraph group_infrastructure["Infrastructure"]
  node_repositories["Mongo repositories"]
  node_workers["Background workers"]
  node_file_storage["File storage<br/>[DiskFileStore.cs]"]
end

node_staff(("Library staff"))
node_mongo[("MongoDB")]

node_staff -->|"uses"| node_webapp
node_webapp -->|"loads routes"| node_routes
node_routes -->|"routes to"| node_catalog_ui
node_routes -->|"routes to"| node_acq_ui
node_catalog_ui -->|"sends requests"| node_graphql_client
node_acq_ui -->|"sends requests"| node_graphql_client
node_graphql_client -->|"GraphQL requests"| node_web_service
node_web_service -->|"serves schema"| node_graphql_schema
node_graphql_schema -->|"exposes"| node_bib_api
node_graphql_schema -->|"exposes"| node_purchase_api
node_graphql_schema -->|"exposes"| node_patron_api
node_bib_api -->|"dispatches"| node_dispatcher
node_purchase_api -->|"dispatches"| node_dispatcher
node_patron_api -->|"dispatches"| node_dispatcher
node_dispatcher -->|"dispatches"| node_catalog_logic
node_dispatcher -->|"dispatches"| node_circulation_logic
node_dispatcher -->|"dispatches"| node_patron_logic
node_dispatcher -->|"dispatches"| node_acquisition_logic
node_catalog_logic -->|"reads via"| node_repositories
node_circulation_logic -->|"persists via"| node_repositories
node_patron_logic -->|"uses"| node_repositories
node_acquisition_logic -->|"uses"| node_repositories
node_repositories -->|"reads/writes"| node_mongo
node_workers -->|"processes outbox"| node_mongo

click node_webapp "https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/app.ts"
click node_routes "https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/app.routes.ts"
click node_catalog_ui "https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/features/cataloging/cataloging.routes.ts"
click node_acq_ui "https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/features/purchase-order/purchase-order.route.ts"
click node_graphql_client "https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/graphql/graphql.provider.ts"
click node_web_service "https://github.com/hard-rox/kathanika/blob/main/src/services/Kathanika.Web/Program.cs"
click node_graphql_schema "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/SchemaConfigurations.cs"
click node_bib_api "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/BibRecordGraph/BibRecordQueries.cs"
click node_purchase_api "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PurchaseOrderGraph/PurchaseOrderQueries.cs"
click node_patron_api "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PatronGraph/PatronQueries.cs"
click node_dispatcher "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Abstractions/Messaging/MediatRDispatcher.cs"
click node_catalog_logic "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/BibRecords/Queries/GetBibRecordsQueryHandler.cs"
click node_circulation_logic "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/BibItems/Commands/CheckOutBibItemCommandHandler.cs"
click node_patron_logic "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/Patrons/Queries/GetPatronsQueryHandler.cs"
click node_acquisition_logic "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/PurchaseOrders/Queries/GetPurchaseOrdersQueryHandler.cs"
click node_domain_models "https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Domain/Aggregates/BibRecordAggregate/BibRecord.cs"
click node_repositories "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Persistence/Repositories/BibRecordRepository.cs"
click node_workers "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Workers/Jobs/ProcessOutboxMessagesJob.cs"
click node_file_storage "https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Persistence/FileStorage/DiskFileStore.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_webapp,node_routes,node_catalog_ui,node_acq_ui,node_graphql_client toneBlue
class node_web_service,node_graphql_schema,node_bib_api,node_purchase_api,node_patron_api,node_mongo toneAmber
class node_dispatcher,node_catalog_logic,node_circulation_logic,node_patron_logic,node_acquisition_logic,node_other_capabilities toneMint
class node_domain_models toneRose
class node_repositories,node_workers,node_file_storage,node_staff toneIndigo
```

## Components

### Web client

- [ILS web app](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/app.ts): `src/app-projects/ils-web/src/app/app.ts`
- [Feature routes](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/app.routes.ts): `src/app-projects/ils-web/src/app/app.routes.ts`
- [Cataloging UI](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/features/cataloging/cataloging.routes.ts): `src/app-projects/ils-web/src/app/features/cataloging/cataloging.routes.ts`
- [Purchase orders UI](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/features/purchase-order/purchase-order.route.ts): `src/app-projects/ils-web/src/app/features/purchase-order/purchase-order.route.ts`
- [GraphQL client](https://github.com/hard-rox/kathanika/blob/main/src/app-projects/ils-web/src/app/graphql/graphql.provider.ts): `src/app-projects/ils-web/src/app/graphql/graphql.provider.ts`

### GraphQL API

- [Web service](https://github.com/hard-rox/kathanika/blob/main/src/services/Kathanika.Web/Program.cs): `src/services/Kathanika.Web/Program.cs`
- [GraphQL schema](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/SchemaConfigurations.cs): `src/infrastructure/Kathanika.Infrastructure.Graphql/SchemaConfigurations.cs`
- [Catalog resolvers](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/BibRecordGraph/BibRecordQueries.cs): `src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/BibRecordGraph/BibRecordQueries.cs`
- [Acquisition resolvers](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PurchaseOrderGraph/PurchaseOrderQueries.cs): `src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PurchaseOrderGraph/PurchaseOrderQueries.cs`
- [Patron resolvers](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PatronGraph/PatronQueries.cs): `src/infrastructure/Kathanika.Infrastructure.Graphql/Schema/PatronGraph/PatronQueries.cs`

### Application logic

- [CQRS dispatcher](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Abstractions/Messaging/MediatRDispatcher.cs): `src/core/Kathanika.Application/Abstractions/Messaging/MediatRDispatcher.cs`
- [Catalog operations](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/BibRecords/Queries/GetBibRecordsQueryHandler.cs): `src/core/Kathanika.Application/Features/BibRecords/Queries/GetBibRecordsQueryHandler.cs`
- [Circulation operations](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/BibItems/Commands/CheckOutBibItemCommandHandler.cs): `src/core/Kathanika.Application/Features/BibItems/Commands/CheckOutBibItemCommandHandler.cs`
- [Patron operations](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/Patrons/Queries/GetPatronsQueryHandler.cs): `src/core/Kathanika.Application/Features/Patrons/Queries/GetPatronsQueryHandler.cs`
- [Acquisition operations](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Application/Features/PurchaseOrders/Queries/GetPurchaseOrdersQueryHandler.cs): `src/core/Kathanika.Application/Features/PurchaseOrders/Queries/GetPurchaseOrdersQueryHandler.cs`
- **Other documented capabilities**

### Library domain

- [Domain aggregates](https://github.com/hard-rox/kathanika/blob/main/src/core/Kathanika.Domain/Aggregates/BibRecordAggregate/BibRecord.cs): `src/core/Kathanika.Domain/Aggregates/BibRecordAggregate/BibRecord.cs`

### Infrastructure

- [Mongo repositories](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Persistence/Repositories/BibRecordRepository.cs): `src/infrastructure/Kathanika.Infrastructure.Persistence/Repositories/BibRecordRepository.cs`
- [Background workers](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Workers/Jobs/ProcessOutboxMessagesJob.cs): `src/infrastructure/Kathanika.Infrastructure.Workers/Jobs/ProcessOutboxMessagesJob.cs`
- [File storage](https://github.com/hard-rox/kathanika/blob/main/src/infrastructure/Kathanika.Infrastructure.Persistence/FileStorage/DiskFileStore.cs): `src/infrastructure/Kathanika.Infrastructure.Persistence/FileStorage/DiskFileStore.cs`

### Other components

- **Library staff**
- **MongoDB**

## Connections

- Library staff → ILS web app: uses
- ILS web app → Feature routes: loads routes
- Feature routes → Cataloging UI: routes to
- Feature routes → Purchase orders UI: routes to
- Cataloging UI → GraphQL client: sends requests
- Purchase orders UI → GraphQL client: sends requests
- GraphQL client → Web service: GraphQL requests
- Web service → GraphQL schema: serves schema
- GraphQL schema → Catalog resolvers: exposes
- GraphQL schema → Acquisition resolvers: exposes
- GraphQL schema → Patron resolvers: exposes
- Catalog resolvers → CQRS dispatcher: dispatches
- Acquisition resolvers → CQRS dispatcher: dispatches
- Patron resolvers → CQRS dispatcher: dispatches
- CQRS dispatcher → Catalog operations: dispatches
- CQRS dispatcher → Circulation operations: dispatches
- CQRS dispatcher → Patron operations: dispatches
- CQRS dispatcher → Acquisition operations: dispatches
- Catalog operations → Mongo repositories: reads via
- Circulation operations → Mongo repositories: persists via
- Patron operations → Mongo repositories: uses
- Acquisition operations → Mongo repositories: uses
- Mongo repositories → MongoDB: reads/writes
- Background workers → MongoDB: processes outbox
