# ggongon554684-rgb/wayplot architecture

> Architecture diagram of the GitHub repository ggongon554684-rgb/wayplot, 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/ggongon554684-rgb/wayplot
- Repository: https://github.com/ggongon554684-rgb/wayplot

## Overview

WayPlot is a multi-tenant real-estate CRM, with a WinForms client for managing parcels, contacts, and leads, plus an API that handles authentication. The main workflow is to sign in, work from the parcel map or list screens, capture contacts, attach them to parcels as leads, and advance leads through a guarded sales pipeline. Tenant-scoped services persist changes through repositories and dispatch domain events. The README is empty; unsampled features such as payments and business intelligence are represented only where the tree supports them, without inferred runtime connections.

Main entry points: [`WayPlot/Program.cs`](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Program.cs) (Desktop startup), [`WayPlot.domain/Services/DataCollection/LeadService.cs`](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/LeadService.cs) (Lead management), [`WayPlot/Presenters/ParcelMapPresenter.cs`](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/ParcelMapPresenter.cs) (Map presenter), [`WayPlot.domain/Services/DataCollection/ContactService.cs`](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/ContactService.cs) (Contact capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Desktop client"]
  node_desktop["Desktop startup<br/>[Program.cs]"]
  node_login["Login screen<br/>[LoginForm.cs]"]
  node_authclient["Auth client<br/>[AuthClient.cs]"]
  node_shell["Main shell<br/>[MainShell.cs]"]
  node_mapview["Parcel map view<br/>[ParcelMapView.cs]"]
  node_mapui["Map control"]
  node_mapresenter["Map presenter"]
  node_contactview["Contacts view<br/>[ContactsView.cs]"]
  node_contactpresenter["Contacts presenter"]
  node_leadview["Leads view<br/>[LeadsView.cs]"]
  node_leadpresenter["Leads presenter<br/>[LeadsPresenter.cs]"]
end

subgraph group_domain["CRM domain"]
  node_contacts["Contact capture<br/>[ContactService.cs]"]
  node_parcels["Parcel management<br/>[ParcelService.cs]"]
  node_leads["Lead management<br/>[LeadService.cs]"]
  node_pipeline["Pipeline rules<br/>[PipelineRules.cs]"]
  node_entities["CRM entities<br/>[DataCollection.cs]"]
  node_transactions["Deals and payments<br/>[DealsPayments.cs]"]
  node_features["Tenant features<br/>[TenantFeatures.cs]"]
  node_events["Domain events<br/>[Events.cs]"]
end

subgraph group_infra["Tenant infrastructure"]
  node_repositories["Repository contracts<br/>[Repositories.cs]"]
  node_efrepos["EF repositories<br/>[EfRepositories.cs]"]
  node_uow["Tenant unit of work"]
  node_tenantdb[("Tenant database<br/>[TenantDbContext.cs]")]
  node_session["Tenant session<br/>[TenantSession.cs]"]
  node_sessionstarter["Session starter<br/>[SessionStarter.cs]"]
  node_dispatcher["Event dispatcher"]
end

subgraph group_auth["Authentication"]
  node_api["Auth API<br/>[AuthController.cs]"]
  node_identity["Identity user<br/>[AppUser.cs]"]
  node_masterdb[("Master database<br/>[MasterDbContext.cs]")]
end

node_agent(("Staff user"))

node_agent -->|"starts client"| node_desktop
node_desktop -->|"opens"| node_login
node_desktop -->|"registers"| node_authclient
node_desktop -->|"builds after login"| node_shell
node_desktop -->|"creates"| node_mapview
node_desktop -->|"wires"| node_mapresenter
node_desktop -->|"creates"| node_contactview
node_desktop -->|"wires"| node_contactpresenter
node_desktop -->|"creates"| node_leadview
node_desktop -->|"wires"| node_leadpresenter
node_mapview -.->|"uses"| node_mapui
node_mapresenter -->|"uses"| node_parcels
node_mapresenter -->|"uses"| node_leads
node_mapresenter -->|"uses"| node_contacts
node_contactpresenter -.->|"uses"| node_contacts
node_leadpresenter -.->|"uses"| node_leads
node_contacts -->|"queries and saves"| node_repositories
node_parcels -->|"queries and saves"| node_repositories
node_leads -->|"queries and saves"| node_repositories
node_leads -->|"checks transitions"| node_pipeline
node_contacts -->|"dispatches inquiry"| node_events
node_leads -->|"dispatches lead events"| node_events
node_efrepos -->|"implements"| node_repositories
node_efrepos -->|"uses"| node_tenantdb
node_sessionstarter -.->|"sets session"| node_session
node_api -->|"uses"| node_identity
node_api -->|"queries"| node_masterdb
node_desktop -.->|"authenticates via HTTP"| node_api

click node_desktop "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Program.cs"
click node_login "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/LoginForm.cs"
click node_authclient "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/AuthClient.cs"
click node_shell "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/MainShell.cs"
click node_mapview "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/ParcelMapView.cs"
click node_mapui "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/UI/ParcelMapControl.cs"
click node_mapresenter "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/ParcelMapPresenter.cs"
click node_contactview "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/ContactsView.cs"
click node_contactpresenter "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/ContactsPresenter.cs"
click node_leadview "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/LeadsView.cs"
click node_leadpresenter "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/LeadsPresenter.cs"
click node_contacts "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/ContactService.cs"
click node_parcels "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/ParcelService.cs"
click node_leads "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/LeadService.cs"
click node_pipeline "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/MainTransaction/PipelineRules.cs"
click node_entities "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Entities/DataCollection.cs"
click node_transactions "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Entities/DealsPayments.cs"
click node_features "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/Admin/TenantFeatures.cs"
click node_events "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Events/Events.cs"
click node_repositories "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Repositories/Repositories.cs"
click node_efrepos "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Repositories/EfRepositories.cs"
click node_uow "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Repositories/TenantUnitOfWork.cs"
click node_tenantdb "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Data/TenantDbContext.cs"
click node_session "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Tenancy/TenantSession.cs"
click node_sessionstarter "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Tenancy/SessionStarter.cs"
click node_dispatcher "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Events/DomainEventDispatcher.cs"
click node_api "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.api/Controllers/AuthController.cs"
click node_identity "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Identity/AppUser.cs"
click node_masterdb "https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Data/MasterDbContext.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_desktop,node_login,node_authclient,node_shell,node_mapview,node_mapui,node_mapresenter,node_contactview,node_contactpresenter,node_leadview,node_leadpresenter,node_agent toneBlue
class node_contacts,node_parcels,node_leads,node_pipeline,node_entities,node_transactions,node_features,node_events toneAmber
class node_repositories,node_efrepos,node_uow,node_tenantdb,node_session,node_sessionstarter,node_dispatcher toneMint
class node_api,node_identity,node_masterdb toneRose
```

## Components

### Desktop client

- [Desktop startup](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Program.cs): `WayPlot/Program.cs`
- [Login screen](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/LoginForm.cs): `WayPlot/LoginForm.cs`
- [Auth client](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/AuthClient.cs): `WayPlot/AuthClient.cs`
- [Main shell](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/MainShell.cs): `WayPlot/Views/MainShell.cs`
- [Parcel map view](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/ParcelMapView.cs): `WayPlot/Views/ParcelMapView.cs`
- [Map control](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/UI/ParcelMapControl.cs): `WayPlot/UI/ParcelMapControl.cs`
- [Map presenter](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/ParcelMapPresenter.cs): `WayPlot/Presenters/ParcelMapPresenter.cs`
- [Contacts view](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/ContactsView.cs): `WayPlot/Views/ContactsView.cs`
- [Contacts presenter](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/ContactsPresenter.cs): `WayPlot/Presenters/ContactsPresenter.cs`
- [Leads view](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Views/LeadsView.cs): `WayPlot/Views/LeadsView.cs`
- [Leads presenter](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot/Presenters/LeadsPresenter.cs): `WayPlot/Presenters/LeadsPresenter.cs`

### CRM domain

- [Contact capture](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/ContactService.cs): `WayPlot.domain/Services/DataCollection/ContactService.cs`
- [Parcel management](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/ParcelService.cs): `WayPlot.domain/Services/DataCollection/ParcelService.cs`
- [Lead management](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/DataCollection/LeadService.cs): `WayPlot.domain/Services/DataCollection/LeadService.cs`
- [Pipeline rules](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/MainTransaction/PipelineRules.cs): `WayPlot.domain/Services/MainTransaction/PipelineRules.cs`
- [CRM entities](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Entities/DataCollection.cs): `WayPlot.domain/Entities/DataCollection.cs`
- [Deals and payments](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Entities/DealsPayments.cs): `WayPlot.domain/Entities/DealsPayments.cs`
- [Tenant features](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Services/Admin/TenantFeatures.cs): `WayPlot.domain/Services/Admin/TenantFeatures.cs`
- [Domain events](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Events/Events.cs): `WayPlot.domain/Events/Events.cs`

### Tenant infrastructure

- [Repository contracts](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.domain/Repositories/Repositories.cs): `WayPlot.domain/Repositories/Repositories.cs`
- [EF repositories](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Repositories/EfRepositories.cs): `WayPlot.infrastructure/Repositories/EfRepositories.cs`
- [Tenant unit of work](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Repositories/TenantUnitOfWork.cs): `WayPlot.infrastructure/Repositories/TenantUnitOfWork.cs`
- [Tenant database](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Data/TenantDbContext.cs): `WayPlot.infrastructure/Data/TenantDbContext.cs`
- [Tenant session](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Tenancy/TenantSession.cs): `WayPlot.infrastructure/Tenancy/TenantSession.cs`
- [Session starter](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Tenancy/SessionStarter.cs): `WayPlot.infrastructure/Tenancy/SessionStarter.cs`
- [Event dispatcher](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Events/DomainEventDispatcher.cs): `WayPlot.infrastructure/Events/DomainEventDispatcher.cs`

### Authentication

- [Auth API](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.api/Controllers/AuthController.cs): `WayPlot.api/Controllers/AuthController.cs`
- [Identity user](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Identity/AppUser.cs): `WayPlot.infrastructure/Identity/AppUser.cs`
- [Master database](https://github.com/ggongon554684-rgb/wayplot/blob/master/WayPlot.infrastructure/Data/MasterDbContext.cs): `WayPlot.infrastructure/Data/MasterDbContext.cs`

### Other components

- **Staff user**

## Connections

- Staff user → Desktop startup: starts client (evidence: `WayPlot/Program.cs`)
- Desktop startup → Login screen: opens (evidence: `WayPlot/Program.cs`)
- Desktop startup → Auth client: registers (evidence: `WayPlot/Program.cs`)
- Desktop startup → Main shell: builds after login (evidence: `WayPlot/Program.cs`)
- Desktop startup → Parcel map view: creates (evidence: `WayPlot/Program.cs`)
- Desktop startup → Map presenter: wires (evidence: `WayPlot/Program.cs`)
- Desktop startup → Contacts view: creates (evidence: `WayPlot/Program.cs`)
- Desktop startup → Contacts presenter: wires (evidence: `WayPlot/Program.cs`)
- Desktop startup → Leads view: creates (evidence: `WayPlot/Program.cs`)
- Desktop startup → Leads presenter: wires (evidence: `WayPlot/Program.cs`)
- Parcel map view → Map control: uses
- Map presenter → Parcel management: uses (evidence: `WayPlot/Presenters/ParcelMapPresenter.cs`)
- Map presenter → Lead management: uses (evidence: `WayPlot/Presenters/ParcelMapPresenter.cs`)
- Map presenter → Contact capture: uses (evidence: `WayPlot/Presenters/ParcelMapPresenter.cs`)
- Contacts presenter → Contact capture: uses
- Leads presenter → Lead management: uses
- Contact capture → Repository contracts: queries and saves (evidence: `WayPlot.domain/Services/DataCollection/ContactService.cs`)
- Parcel management → Repository contracts: queries and saves (evidence: `WayPlot.domain/Services/DataCollection/ParcelService.cs`)
- Lead management → Repository contracts: queries and saves (evidence: `WayPlot.domain/Services/DataCollection/LeadService.cs`)
- Lead management → Pipeline rules: checks transitions (evidence: `WayPlot.domain/Services/DataCollection/LeadService.cs`)
- Contact capture → Domain events: dispatches inquiry (evidence: `WayPlot.domain/Services/DataCollection/ContactService.cs`)
- Lead management → Domain events: dispatches lead events (evidence: `WayPlot.domain/Services/DataCollection/LeadService.cs`)
- EF repositories → Repository contracts: implements (evidence: `WayPlot.infrastructure/Repositories/EfRepositories.cs`)
- EF repositories → Tenant database: uses (evidence: `WayPlot.infrastructure/Repositories/EfRepositories.cs`)
- Session starter → Tenant session: sets session (evidence: `WayPlot.infrastructure/Tenancy/SessionStarter.cs`)
- Auth API → Identity user: uses (evidence: `WayPlot.api/Controllers/AuthController.cs`)
- Auth API → Master database: queries (evidence: `WayPlot.api/Controllers/AuthController.cs`)
- Desktop startup → Auth API: authenticates via HTTP
