# bellalinaoufel/catmash architecture

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

- Interactive diagram: https://gitdiagram.com/bellalinaoufel/catmash
- Repository: https://github.com/bellalinaoufel/catmash

## Overview

CatMash is a cat-voting and ranking application: users can compare two randomly selected cats, update scores, and view cats in a paged ranking. The Angular client calls a versioned ASP.NET API; its controller delegates domain operations to business logic, which uses a unit of work and EF-backed repositories. A reset operation also fetches initial cat data from an external API. The README identifies SQLite, but the sampled excerpts do not show its configuration. Some client component-to-service links are unverified, so those edges are dashed.

Main entry points: [`API/src/CatMash.Domain.Business/CatsBusiness.cs`](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Domain.Business/CatsBusiness.cs) (Cat operations), [`Client/src/app/app.component.ts`](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app.component.ts) (App shell), [`Client/src/app/services/cat.service.ts`](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/services/cat.service.ts) (Cat service), [`API/src/CatMash.Api/Controllers/V1.0/CatController.cs`](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Controllers/V1.0/CatController.cs) (Cat controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Angular client"]
  node_app["App shell<br/>[app.component.ts]"]
  node_appmodule["App module<br/>[app.module.ts]"]
  node_routing["App routing"]
  node_catlist["Cat ranking"]
  node_catvote["Cat voting"]
  node_catservice["Cat service<br/>[cat.service.ts]"]
  node_catmodel["Cat model<br/>[cat.ts]"]
end

subgraph group_api["HTTP API"]
  node_controller["Cat controller<br/>[CatController.cs]"]
  node_api_models["Cat API models<br/>[Models]"]
  node_startup["API startup<br/>[Startup.cs]"]
  node_service_registration["Service registration"]
end

subgraph group_domain["Cat domain"]
  node_business["Cat operations<br/>[CatsBusiness.cs]"]
  node_cat["Cat record<br/>[Cat.cs]"]
end

subgraph group_storage["Persistence"]
  node_unitofwork["Unit of work<br/>[UnitOfWork.cs]"]
  node_catrepo["Cat repository<br/>[CatRepository.cs]"]
  node_repository["Base repository<br/>[Repository.cs]"]
  node_dbcontext["EF context"]
  node_database[("SQLite database")]
end

subgraph group_integrations["External services"]
  node_cat_api["Cat data API"]
end

node_user(("CatMash user"))

node_user -->|"uses"| node_app
node_appmodule -->|"bootstraps"| node_app
node_appmodule -->|"imports"| node_routing
node_app -->|"routes to"| node_catvote
node_app -->|"routes to"| node_catlist
node_catlist -->|"requests data"| node_catservice
node_catvote -.->|"requests data"| node_catservice
node_catservice -->|"uses model"| node_catmodel
node_catservice -.->|"HTTP requests"| node_controller
node_controller -->|"maps requests"| node_api_models
node_controller -->|"delegates operations"| node_business
node_business -->|"uses"| node_unitofwork
node_business -->|"fetches seed data"| node_cat_api
node_business -->|"returns cat data"| node_cat
node_unitofwork -->|"provides repository"| node_catrepo
node_catrepo -->|"inherits"| node_repository
node_catrepo -->|"queries"| node_dbcontext
node_repository -.->|"uses context"| node_dbcontext
node_dbcontext -.->|"persists data"| node_database
node_startup -.->|"configures services"| node_service_registration
node_service_registration -->|"registers"| node_business

click node_app "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app.component.ts"
click node_appmodule "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app.module.ts"
click node_routing "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app-routing.module.ts"
click node_catlist "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/components/catlist/catlist.component.ts"
click node_catvote "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/components/catvote/catvote.component.ts"
click node_catservice "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/services/cat.service.ts"
click node_catmodel "https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/models/cat.ts"
click node_controller "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Controllers/V1.0/CatController.cs"
click node_api_models "https://github.com/bellalinaoufel/catmash/tree/master/API/src/CatMash.Api/Models"
click node_startup "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Startup.cs"
click node_service_registration "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Installers/ServicesInstaller.cs"
click node_business "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Domain.Business/CatsBusiness.cs"
click node_cat "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Domain.Entities/DTO/Cat.cs"
click node_unitofwork "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/UnitOfWork.cs"
click node_catrepo "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Repository/CatRepository.cs"
click node_repository "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Repository/Repository.cs"
click node_dbcontext "https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Context/CatMashDbContext.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_app,node_appmodule,node_routing,node_catlist,node_catvote,node_catservice,node_catmodel,node_user toneBlue
class node_controller,node_api_models,node_startup,node_service_registration toneAmber
class node_business,node_cat toneMint
class node_unitofwork,node_catrepo,node_repository,node_dbcontext,node_database toneRose
class node_cat_api toneIndigo
```

## Components

### Angular client

- [App shell](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app.component.ts): `Client/src/app/app.component.ts`
- [App module](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app.module.ts): `Client/src/app/app.module.ts`
- [App routing](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/app-routing.module.ts): `Client/src/app/app-routing.module.ts`
- [Cat ranking](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/components/catlist/catlist.component.ts): `Client/src/app/components/catlist/catlist.component.ts`
- [Cat voting](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/components/catvote/catvote.component.ts): `Client/src/app/components/catvote/catvote.component.ts`
- [Cat service](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/services/cat.service.ts): `Client/src/app/services/cat.service.ts`
- [Cat model](https://github.com/bellalinaoufel/catmash/blob/master/Client/src/app/models/cat.ts): `Client/src/app/models/cat.ts`

### HTTP API

- [Cat controller](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Controllers/V1.0/CatController.cs): `API/src/CatMash.Api/Controllers/V1.0/CatController.cs`
- [Cat API models](https://github.com/bellalinaoufel/catmash/tree/master/API/src/CatMash.Api/Models): `API/src/CatMash.Api/Models`
- [API startup](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Startup.cs): `API/src/CatMash.Api/Startup.cs`
- [Service registration](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Api/Installers/ServicesInstaller.cs): `API/src/CatMash.Api/Installers/ServicesInstaller.cs`

### Cat domain

- [Cat operations](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Domain.Business/CatsBusiness.cs): `API/src/CatMash.Domain.Business/CatsBusiness.cs`
- [Cat record](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Domain.Entities/DTO/Cat.cs): `API/src/CatMash.Domain.Entities/DTO/Cat.cs`

### Persistence

- [Unit of work](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/UnitOfWork.cs): `API/src/CatMash.Infrastructure.Data/UnitOfWork.cs`
- [Cat repository](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Repository/CatRepository.cs): `API/src/CatMash.Infrastructure.Data/Repository/CatRepository.cs`
- [Base repository](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Repository/Repository.cs): `API/src/CatMash.Infrastructure.Data/Repository/Repository.cs`
- [EF context](https://github.com/bellalinaoufel/catmash/blob/master/API/src/CatMash.Infrastructure.Data/Context/CatMashDbContext.cs): `API/src/CatMash.Infrastructure.Data/Context/CatMashDbContext.cs`
- **SQLite database**

### External services

- **Cat data API**

### Other components

- **CatMash user**

## Connections

- CatMash user → App shell: uses
- App module → App shell: bootstraps (evidence: `Client/src/app/app.module.ts`)
- App module → App routing: imports (evidence: `Client/src/app/app.module.ts`)
- App shell → Cat voting: routes to (evidence: `Client/src/app/app.component.ts`)
- App shell → Cat ranking: routes to (evidence: `Client/src/app/app.component.ts`)
- Cat ranking → Cat service: requests data (evidence: `Client/src/app/components/catlist/catlist.component.ts`)
- Cat voting → Cat service: requests data
- Cat service → Cat model: uses model (evidence: `Client/src/app/services/cat.service.ts`)
- Cat service → Cat controller: HTTP requests
- Cat controller → Cat API models: maps requests (evidence: `API/src/CatMash.Api/Controllers/V1.0/CatController.cs`)
- Cat controller → Cat operations: delegates operations (evidence: `API/src/CatMash.Api/Controllers/V1.0/CatController.cs`)
- Cat operations → Unit of work: uses (evidence: `API/src/CatMash.Domain.Business/CatsBusiness.cs`)
- Cat operations → Cat data API: fetches seed data (evidence: `API/src/CatMash.Domain.Business/CatsBusiness.cs`)
- Cat operations → Cat record: returns cat data (evidence: `API/src/CatMash.Domain.Business/CatsBusiness.cs`)
- Unit of work → Cat repository: provides repository (evidence: `API/src/CatMash.Infrastructure.Data/UnitOfWork.cs`)
- Cat repository → Base repository: inherits (evidence: `API/src/CatMash.Infrastructure.Data/Repository/CatRepository.cs`)
- Cat repository → EF context: queries (evidence: `API/src/CatMash.Infrastructure.Data/Repository/CatRepository.cs`)
- Base repository → EF context: uses context
- EF context → SQLite database: persists data
- API startup → Service registration: configures services
- Service registration → Cat operations: registers (evidence: `API/src/CatMash.Api/Installers/ServicesInstaller.cs`)
