# platypusjo/holidayplanning architecture

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

- Interactive diagram: https://gitdiagram.com/platypusjo/holidayplanning
- Repository: https://github.com/platypusjo/holidayplanning

## Overview

#### Назначение и запуск
HolidayPlanning — серверная система планирования мероприятий: праздники, участники, подрядчики, расходы, цели и справочники статусов/категорий. Основная точка запуска — ASP.NET API в `HolidayPlanningApi/Program.cs`; решение — `HolidayPlanningApi/HolidayPlanningApi.sln`. README упоминает TypeScript/CSS/Python, но дерево содержит реализованный .NET backend и пустой/неразвернутый `HolidayPlanningClient`.

#### HTTP boundary
Контроллеры предоставляют ресурсные API для доменов планирования и вызывают BLL-сервисы, изолируя HTTP от правил и хранения. Аутентификация выделена в `HolidayPlanningApi/Controllers/AuthController.cs`; ключевые ресурсы представлены `HolidayPlanningApi/Controllers/HolidayController.cs`, `HolidayPlanningApi/Controllers/ExpenseController.cs` и `HolidayPlanningApi/Controllers/MemberController.cs`.

#### Бизнес-слой и контрактные DTO
BLL определяет сервисные интерфейсы, CRUD-контракты и DTO, отделяющие API от persistence-entities. Общая сервисная база находится в `BLL/Abstract/BaseService.cs`; контракты — `BLL/Intefaces/ICrud.cs` и `BLL/Intefaces/IHolidayService.cs`; транспортные модели — `BLL/DTOs/HolidayDto.cs`, `BLL/DTOs/ExpenseDto.cs`, `BLL/DTOs/PatchGoalStatusDto.cs`. Patch DTO указывают на специализированные переходы статусов и оплаты, а не только полную замену ресурсов.

#### Предметные workflow
Центральный агрегат — праздник: `BLL/Services/HolidayService.cs` работает с участниками, расходами и планированием. Финансовый поток реализован через `BLL/Services/ExpenseService.cs` и `BLL/Services/HolidayExpenseService.cs`; подрядчики и их статусы — `BLL/Services/ContractorService.cs` и `BLL/Services/ContractorStatusService.cs`. Цели, участники, меню и категории оформлены как отдельные сервисы/справочники, что позволяет API независимо управлять каждым аспектом мероприятия.

#### Persistence boundary
DAL использует entity/repository/unit-of-work границу. EF-style контекст — `DAL/Entities/HolidayPlanningDbContext.cs`; транзакционная координация — `DAL/Repositories/UnitOfWork.cs` и `DAL/Interfaces/IUnitOfWork.cs`; базовые паттерны — `DAL/Abstract/BaseRepository.cs` и `DAL/Interfaces/IRepository.cs`. Репозитории специализированы для основных агрегатов, например `DAL/Repositories/HolidayRepository.cs` и `DAL/Repositories/ExpenseRepository.cs`.

#### Модели и преобразование данных
Реляционные сущности находятся в `DAL/Entities/Holiday.cs`, `DAL/Entities/Member.cs`, `DAL/Entities/Contractor.cs`, `DAL/Entities/Goal.cs` и `DAL/Entities/Expense.cs`. Конвертеры являются явной anti-corruption границей между entity и DTO: `DAL/Abstract/BaseConverter.cs`, `DAL/Converters/HolidayConverter.cs`, `DAL/Converters/MemberConverter.cs`. Статусы частично централизованы через enum/provider: `DAL/Enums/ContractorStatusEnum.cs` и `DAL/Providers/ContractorStatusProvider.cs`.

#### Runtime и инфраструктура
Материальный runtime — ASP.NET/.NET API с настройками окружений в `HolidayPlanningApi/appsettings.json` и `HolidayPlanningApi/appsettings.Development.json`. Внешняя инфраструктура непосредственно не раскрыта деревом; конфигурация подключения и сервисов должна происходить через эти settings и регистрацию в `HolidayPlanningApi/Program.cs`. Автотесты в основном проверяют конвертацию DAL-моделей, например `HolidayPlanningTests/HolidayConverterTests.cs`.

Main entry points: [`BLL/Intefaces/ICrud.cs`](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Intefaces/ICrud.cs) (CRUD service contracts), [`BLL/Services/HolidayService.cs`](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/HolidayService.cs) (Holiday workflow), [`DAL/Repositories/UnitOfWork.cs`](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Repositories/UnitOfWork.cs) (Unit of work), [`HolidayPlanningApi/Program.cs`](https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Program.cs) (API bootstrap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["ASP.NET API"]
  node_program{{"API bootstrap<br/>ASP.NET entrypoint<br/>[Program.cs]"}}
  node_settings["Environment settings<br/>configuration<br/>[appsettings.json]"]
  node_auth["Authentication API<br/>controller<br/>[AuthController.cs]"]
  node_planning_api["Planning resource APIs<br/>controllers"]
end

subgraph group_bll["Business layer"]
  node_service_contracts["CRUD service contracts<br/>interfaces<br/>[ICrud.cs]"]
  node_holiday_contract["Holiday service contract<br/>interface<br/>[IHolidayService.cs]"]
  node_dto["Planning DTOs<br/>transport models<br/>[HolidayDto.cs]"]
  node_service_base["Service base<br/>service foundation<br/>[BaseService.cs]"]
  node_holiday_service["Holiday workflow<br/>[HolidayService.cs]"]
  node_expense_flow["Expense workflow<br/>services<br/>[ExpenseService.cs]"]
  node_contractor_flow["Contractor workflow<br/>services"]
end

subgraph group_dal["Persistence layer"]
  node_unit_of_work["Unit of work<br/>transaction boundary<br/>[UnitOfWork.cs]"]
  node_repository_base["Repository base<br/>repository foundation<br/>[BaseRepository.cs]"]
  node_aggregate_repos["Aggregate repositories"]
  node_converters["Entity–DTO converters<br/>mapping boundary"]
  node_entities[("Planning entities<br/>EF entities<br/>[Holiday.cs]")]
  node_db_context[("Planning DbContext<br/>EF context")]
  node_contractor_statuses["Contractor status provider"]
end

node_settings -.->|"configures"| node_program
node_program -->|"routes"| node_auth
node_program -->|"routes"| node_planning_api
node_planning_api -->|"uses"| node_holiday_contract
node_planning_api -->|"uses"| node_service_contracts
node_auth -->|"uses services"| node_service_contracts
node_holiday_contract -->|"implemented by"| node_holiday_service
node_service_contracts -->|"implemented by"| node_holiday_service
node_service_contracts -->|"implemented by"| node_expense_flow
node_service_contracts -->|"implemented by"| node_contractor_flow
node_holiday_service -->|"extends"| node_service_base
node_holiday_service -->|"exchanges"| node_dto
node_expense_flow -->|"exchanges"| node_dto
node_holiday_service -->|"persists through"| node_unit_of_work
node_expense_flow -->|"persists through"| node_unit_of_work
node_contractor_flow -->|"persists through"| node_unit_of_work
node_contractor_flow -->|"uses statuses"| node_contractor_statuses
node_unit_of_work -->|"coordinates"| node_aggregate_repos
node_aggregate_repos -->|"extends"| node_repository_base
node_aggregate_repos -->|"reads and writes"| node_entities
node_converters -->|"maps to"| node_dto
node_converters -->|"maps from"| node_entities
node_unit_of_work -->|"commits via"| node_db_context
node_db_context -->|"tracks"| node_entities

click node_program "https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Program.cs"
click node_settings "https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/appsettings.json"
click node_auth "https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Controllers/AuthController.cs"
click node_planning_api "https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Controllers/HolidayController.cs"
click node_service_contracts "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Intefaces/ICrud.cs"
click node_holiday_contract "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Intefaces/IHolidayService.cs"
click node_dto "https://github.com/platypusjo/holidayplanning/blob/main/BLL/DTOs/HolidayDto.cs"
click node_service_base "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Abstract/BaseService.cs"
click node_holiday_service "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/HolidayService.cs"
click node_expense_flow "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/ExpenseService.cs"
click node_contractor_flow "https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/ContractorService.cs"
click node_unit_of_work "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Repositories/UnitOfWork.cs"
click node_repository_base "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Abstract/BaseRepository.cs"
click node_aggregate_repos "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Repositories/HolidayRepository.cs"
click node_converters "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Converters/HolidayConverter.cs"
click node_entities "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Entities/Holiday.cs"
click node_db_context "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Entities/HolidayPlanningDbContext.cs"
click node_contractor_statuses "https://github.com/platypusjo/holidayplanning/blob/main/DAL/Providers/ContractorStatusProvider.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_program,node_settings,node_auth,node_planning_api toneBlue
class node_service_contracts,node_holiday_contract,node_dto,node_service_base,node_holiday_service,node_expense_flow,node_contractor_flow toneAmber
class node_unit_of_work,node_repository_base,node_aggregate_repos,node_converters,node_entities,node_db_context,node_contractor_statuses toneMint
```

## Components

### ASP.NET API

- [API bootstrap](https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Program.cs): ASP.NET entrypoint · Registers HTTP pipeline and application services. · `HolidayPlanningApi/Program.cs`
- [Environment settings](https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/appsettings.json): configuration · Provides connection and service configuration. · `HolidayPlanningApi/appsettings.json`
- [Authentication API](https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Controllers/AuthController.cs): controller · `HolidayPlanningApi/Controllers/AuthController.cs`
- [Planning resource APIs](https://github.com/platypusjo/holidayplanning/blob/main/HolidayPlanningApi/Controllers/HolidayController.cs): controllers · Holiday, expense, and member endpoints. · `HolidayPlanningApi/Controllers/HolidayController.cs`

### Business layer

- [CRUD service contracts](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Intefaces/ICrud.cs): interfaces · `BLL/Intefaces/ICrud.cs`
- [Holiday service contract](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Intefaces/IHolidayService.cs): interface · `BLL/Intefaces/IHolidayService.cs`
- [Planning DTOs](https://github.com/platypusjo/holidayplanning/blob/main/BLL/DTOs/HolidayDto.cs): transport models · Includes resource and status/payment patch models. · `BLL/DTOs/HolidayDto.cs`
- [Service base](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Abstract/BaseService.cs): service foundation · `BLL/Abstract/BaseService.cs`
- [Holiday workflow](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/HolidayService.cs): service · Coordinates event participants, expenses, and planning. · `BLL/Services/HolidayService.cs`
- [Expense workflow](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/ExpenseService.cs): services · Manages expenses and holiday-expense relations. · `BLL/Services/ExpenseService.cs`
- [Contractor workflow](https://github.com/platypusjo/holidayplanning/blob/main/BLL/Services/ContractorService.cs): services · Manages contractors and contractor statuses. · `BLL/Services/ContractorService.cs`

### Persistence layer

- [Unit of work](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Repositories/UnitOfWork.cs): transaction boundary · `DAL/Repositories/UnitOfWork.cs`
- [Repository base](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Abstract/BaseRepository.cs): repository foundation · `DAL/Abstract/BaseRepository.cs`
- [Aggregate repositories](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Repositories/HolidayRepository.cs): repositories · Holiday and expense persistence operations. · `DAL/Repositories/HolidayRepository.cs`
- [Entity–DTO converters](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Converters/HolidayConverter.cs): mapping boundary · Separates persistence entities from service DTOs. · `DAL/Converters/HolidayConverter.cs`
- [Planning entities](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Entities/Holiday.cs): EF entities · Holiday, member, contractor, goal, and expense records. · `DAL/Entities/Holiday.cs`
- [Planning DbContext](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Entities/HolidayPlanningDbContext.cs): EF context · `DAL/Entities/HolidayPlanningDbContext.cs`
- [Contractor status provider](https://github.com/platypusjo/holidayplanning/blob/main/DAL/Providers/ContractorStatusProvider.cs): status provider · Centralizes contractor status values. · `DAL/Providers/ContractorStatusProvider.cs`

## Connections

- Environment settings → API bootstrap: configures
- API bootstrap → Authentication API: routes
- API bootstrap → Planning resource APIs: routes
- Planning resource APIs → Holiday service contract: uses
- Planning resource APIs → CRUD service contracts: uses
- Authentication API → CRUD service contracts: uses services
- Holiday service contract → Holiday workflow: implemented by
- CRUD service contracts → Holiday workflow: implemented by
- CRUD service contracts → Expense workflow: implemented by
- CRUD service contracts → Contractor workflow: implemented by
- Holiday workflow → Service base: extends
- Holiday workflow → Planning DTOs: exchanges
- Expense workflow → Planning DTOs: exchanges
- Holiday workflow → Unit of work: persists through
- Expense workflow → Unit of work: persists through
- Contractor workflow → Unit of work: persists through
- Contractor workflow → Contractor status provider: uses statuses
- Unit of work → Aggregate repositories: coordinates
- Aggregate repositories → Repository base: extends
- Aggregate repositories → Planning entities: reads and writes
- Entity–DTO converters → Planning DTOs: maps to
- Entity–DTO converters → Planning entities: maps from
- Unit of work → Planning DbContext: commits via
- Planning DbContext → Planning entities: tracks
