# joaorbfernandes/ciclopinhal architecture

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

- Interactive diagram: https://gitdiagram.com/joaorbfernandes/ciclopinhal
- Repository: https://github.com/joaorbfernandes/ciclopinhal

## Overview

This Django application provides product catalog browsing and administration, plus configurable homepage product slots. The main customer path is browsing a filtered, sorted, paginated product listing; catalog administration manages products and categories, including confirmation when deactivating a product assigned to a homepage slot. Homepage administration selects eligible products and manages slot assignments, which the homepage presents. The graph reflects the supplied source excerpts and SOURCE INDEX; web wiring and several services are not sampled, so those connections are omitted or marked unverified.

Main entry points: [`apps/catalog/application/services/product/confirmable_product_deactivation_service.py`](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/confirmable_product_deactivation_service.py) (Confirmed deactivation), [`apps/homepage/application/services/create_homepage_slot_service.py`](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/application/services/create_homepage_slot_service.py) (Slot management services), [`apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py`](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py) (Slot repository), [`apps/catalog/application/services/category/update_category_service.py`](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/category/update_category_service.py) (Category update)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog domain and services"]
  node_listing_service["Product listing service"]
  node_listing_query["Listing query"]
  node_catalog_entities["Product and category<br/>[product.py]"]
  node_category_update["Category update"]
  node_category_validation["Category deactivation validation"]
  node_product_update["Product update"]
  node_deactivation["Confirmed deactivation"]
end

subgraph group_catalog_io["Catalog interfaces and persistence"]
  node_catalog_web["Catalog web interface"]
  node_listing_read["Listing read repository"]
  node_catalog_models[("Catalog models<br/>[models.py]")]
  node_category_repo["Category repository"]
  node_product_repo["Product repository"]
  node_pending_store["Pending update store"]
  node_admin["Catalog administration"]
end

subgraph group_homepage["Homepage slots"]
  node_homepage_admin["Homepage administration"]
  node_slot_services["Slot management services"]
  node_slot_entity["Homepage slot entity"]
  node_slot_repo["Slot repository"]
  node_slot_models[("Homepage slot models<br/>[models.py]")]
  node_eligible_search["Eligible product search"]
  node_eligible_read["Eligible product reader"]
  node_homepage_web["Homepage web interface"]
end

subgraph group_shared["Shared application services"]
  node_transaction["Transaction manager"]
  node_search_result["Search result paging<br/>[search.py]"]
end

node_shopper(("Shopper"))

node_shopper -.->|"browses"| node_catalog_web
node_catalog_web -.->|"requests listings"| node_listing_service
node_listing_service -.->|"uses query"| node_listing_query
node_listing_service -.->|"reads listings"| node_listing_read
node_listing_read -->|"queries"| node_catalog_models
node_category_update -->|"validates deactivation"| node_category_validation
node_category_update -->|"loads and saves"| node_category_repo
node_category_update -->|"builds category"| node_catalog_entities
node_category_repo -->|"persists through"| node_catalog_models
node_product_update -->|"updates product"| node_product_repo
node_product_update -->|"uses entities"| node_catalog_entities
node_deactivation -->|"executes update"| node_product_update
node_deactivation -->|"checks product"| node_product_repo
node_deactivation -->|"stores pending update"| node_pending_store
node_deactivation -->|"runs atomically"| node_transaction
node_admin -.->|"confirms deactivation"| node_deactivation
node_homepage_admin -.->|"manages slots"| node_slot_services
node_slot_services -->|"creates slots"| node_slot_entity
node_slot_services -->|"saves slots"| node_slot_repo
node_slot_repo -->|"maps slots"| node_slot_entity
node_slot_repo -->|"persists slots"| node_slot_models
node_eligible_search -->|"searches through"| node_eligible_read
node_eligible_search -->|"returns page"| node_search_result
node_eligible_read -->|"reads products"| node_catalog_models
node_homepage_web -.->|"reads displayed slots"| node_slot_repo
node_deactivation -.->|"clears assigned slots"| node_slot_services

click node_catalog_web "https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/catalog/interfaces/web"
click node_listing_service "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/get_product_listing_page_service.py"
click node_listing_query "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/queries/product_listing_query.py"
click node_listing_read "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/product/django_product_listing_read_repository.py"
click node_catalog_models "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/models.py"
click node_catalog_entities "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/domain/entities/product.py"
click node_category_update "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/category/update_category_service.py"
click node_category_validation "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/category/validate_category_deactivation.py"
click node_category_repo "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/category/django_category_repository.py"
click node_product_update "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/update_product_service.py"
click node_product_repo "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/product/django_product_repository.py"
click node_deactivation "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/confirmable_product_deactivation_service.py"
click node_pending_store "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/interfaces/admin/session_pending_product_update_store.py"
click node_admin "https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/catalog/interfaces/admin"
click node_homepage_admin "https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/homepage/interfaces/admin"
click node_slot_services "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/application/services/create_homepage_slot_service.py"
click node_slot_entity "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/domain/entities/homepage_product_slot.py"
click node_slot_repo "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py"
click node_slot_models "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/models.py"
click node_eligible_search "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/application/services/search_eligible_homepage_products_service.py"
click node_eligible_read "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/repositories/django_eligible_homepage_product_read_repository.py"
click node_homepage_web "https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/homepage/interfaces/web"
click node_transaction "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/shared/infrastructure/django_transaction_manager.py"
click node_search_result "https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/shared/application/search.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_listing_service,node_listing_query,node_catalog_entities,node_category_update,node_category_validation,node_product_update,node_deactivation toneBlue
class node_catalog_web,node_listing_read,node_catalog_models,node_category_repo,node_product_repo,node_pending_store,node_admin toneAmber
class node_homepage_admin,node_slot_services,node_slot_entity,node_slot_repo,node_slot_models,node_eligible_search,node_eligible_read,node_homepage_web toneMint
class node_transaction,node_search_result toneRose
class node_shopper toneIndigo
```

## Components

### Catalog domain and services

- [Product listing service](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/get_product_listing_page_service.py): `apps/catalog/application/services/product/get_product_listing_page_service.py`
- [Listing query](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/queries/product_listing_query.py): `apps/catalog/application/queries/product_listing_query.py`
- [Product and category](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/domain/entities/product.py): `apps/catalog/domain/entities/product.py`
- [Category update](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/category/update_category_service.py): `apps/catalog/application/services/category/update_category_service.py`
- [Category deactivation validation](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/category/validate_category_deactivation.py): `apps/catalog/application/services/category/validate_category_deactivation.py`
- [Product update](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/update_product_service.py): `apps/catalog/application/services/product/update_product_service.py`
- [Confirmed deactivation](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/application/services/product/confirmable_product_deactivation_service.py): `apps/catalog/application/services/product/confirmable_product_deactivation_service.py`

### Catalog interfaces and persistence

- [Catalog web interface](https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/catalog/interfaces/web): `apps/catalog/interfaces/web`
- [Listing read repository](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/product/django_product_listing_read_repository.py): `apps/catalog/infrastructure/repositories/product/django_product_listing_read_repository.py`
- [Catalog models](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/models.py): `apps/catalog/infrastructure/models.py`
- [Category repository](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/category/django_category_repository.py): `apps/catalog/infrastructure/repositories/category/django_category_repository.py`
- [Product repository](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/infrastructure/repositories/product/django_product_repository.py): `apps/catalog/infrastructure/repositories/product/django_product_repository.py`
- [Pending update store](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/catalog/interfaces/admin/session_pending_product_update_store.py): `apps/catalog/interfaces/admin/session_pending_product_update_store.py`
- [Catalog administration](https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/catalog/interfaces/admin): `apps/catalog/interfaces/admin`

### Homepage slots

- [Homepage administration](https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/homepage/interfaces/admin): `apps/homepage/interfaces/admin`
- [Slot management services](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/application/services/create_homepage_slot_service.py): `apps/homepage/application/services/create_homepage_slot_service.py`
- [Homepage slot entity](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/domain/entities/homepage_product_slot.py): `apps/homepage/domain/entities/homepage_product_slot.py`
- [Slot repository](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py): `apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py`
- [Homepage slot models](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/models.py): `apps/homepage/infrastructure/models.py`
- [Eligible product search](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/application/services/search_eligible_homepage_products_service.py): `apps/homepage/application/services/search_eligible_homepage_products_service.py`
- [Eligible product reader](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/homepage/infrastructure/repositories/django_eligible_homepage_product_read_repository.py): `apps/homepage/infrastructure/repositories/django_eligible_homepage_product_read_repository.py`
- [Homepage web interface](https://github.com/joaorbfernandes/ciclopinhal/tree/main/apps/homepage/interfaces/web): `apps/homepage/interfaces/web`

### Shared application services

- [Transaction manager](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/shared/infrastructure/django_transaction_manager.py): `apps/shared/infrastructure/django_transaction_manager.py`
- [Search result paging](https://github.com/joaorbfernandes/ciclopinhal/blob/main/apps/shared/application/search.py): `apps/shared/application/search.py`

### Other components

- **Shopper**

## Connections

- Shopper → Catalog web interface: browses
- Catalog web interface → Product listing service: requests listings
- Product listing service → Listing query: uses query
- Product listing service → Listing read repository: reads listings
- Listing read repository → Catalog models: queries (evidence: `apps/catalog/infrastructure/repositories/product/django_product_listing_read_repository.py`)
- Category update → Category deactivation validation: validates deactivation (evidence: `apps/catalog/application/services/category/update_category_service.py`)
- Category update → Category repository: loads and saves (evidence: `apps/catalog/application/services/category/update_category_service.py`)
- Category update → Product and category: builds category (evidence: `apps/catalog/application/services/category/update_category_service.py`)
- Category repository → Catalog models: persists through (evidence: `apps/catalog/infrastructure/repositories/category/django_category_repository.py`)
- Product update → Product repository: updates product (evidence: `apps/catalog/application/services/product/update_product_service.py`)
- Product update → Product and category: uses entities (evidence: `apps/catalog/application/services/product/update_product_service.py`)
- Confirmed deactivation → Product update: executes update (evidence: `apps/catalog/application/services/product/confirmable_product_deactivation_service.py`)
- Confirmed deactivation → Product repository: checks product (evidence: `apps/catalog/application/services/product/confirmable_product_deactivation_service.py`)
- Confirmed deactivation → Pending update store: stores pending update (evidence: `apps/catalog/application/services/product/confirmable_product_deactivation_service.py`)
- Confirmed deactivation → Transaction manager: runs atomically (evidence: `apps/catalog/application/services/product/confirmable_product_deactivation_service.py`)
- Catalog administration → Confirmed deactivation: confirms deactivation
- Homepage administration → Slot management services: manages slots
- Slot management services → Homepage slot entity: creates slots (evidence: `apps/homepage/application/services/create_homepage_slot_service.py`)
- Slot management services → Slot repository: saves slots (evidence: `apps/homepage/application/services/create_homepage_slot_service.py`)
- Slot repository → Homepage slot entity: maps slots (evidence: `apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py`)
- Slot repository → Homepage slot models: persists slots (evidence: `apps/homepage/infrastructure/repositories/django_homepage_product_slot_repository.py`)
- Eligible product search → Eligible product reader: searches through (evidence: `apps/homepage/application/services/search_eligible_homepage_products_service.py`)
- Eligible product search → Search result paging: returns page (evidence: `apps/homepage/application/services/search_eligible_homepage_products_service.py`)
- Eligible product reader → Catalog models: reads products (evidence: `apps/homepage/infrastructure/repositories/django_eligible_homepage_product_read_repository.py`)
- Homepage web interface → Slot repository: reads displayed slots
- Confirmed deactivation → Slot management services: clears assigned slots
