mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 17:11:15 +00:00
6b373082c8
Phase C of architecture coupling refactor (epic AZ-309). Closes the
last baseline finding (F5 — DataAccess incorrectly documented as
importing Common) and synchronizes the rest of _docs/02_document/
with the post-split project layout from AZ-312/313/314:
- module-layout.md: per-component sections for the three new csprojs
with explicit ProjectReferences and the no-cross-sibling-reference
invariant the split enforces.
- architecture.md: components and internal-communication tables
updated to show calls flow through Common interfaces.
- architecture_compliance_baseline.md: F1..F5 marked Resolved with
task IDs and commit refs; baseline summary now 0 findings.
- diagrams/components.md, components/03_tile_downloader/description.md,
modules/{common_interfaces,services_tile_service,
services_google_maps_downloader,tests_unit}.md updated for the
split, RateLimitException relocation, and new ITileService methods.
Documentation-only batch — no code, no tests, no build changes.
Epic AZ-309 complete (6 tasks across 3 batches).
Co-authored-by: Cursor <cursoragent@cursor.com>
8.6 KiB
8.6 KiB
Module Layout
Status: derived-from-code
Language: csharp Layout Convention: custom (per-component .csproj per logical component) Root: ./ Last Updated: 2026-05-10 (post AZ-309 coupling refactor)
Layout Rules
- Each component owns ONE top-level project directory (
.csprojboundary). The previous sharedSatelliteProvider.Servicesproject was split into three per-component csprojs in epic AZ-309. - Shared code lives under
SatelliteProvider.Common/— the foundation layer. - Cross-cutting concerns (DTOs, interfaces, configs, geo-math, common exceptions) all reside in Common.
- Public API surface per component =
publictypes in the namespace root. Everything markedinternalor private is internal. - Tests live in separate projects:
SatelliteProvider.Tests/(unit) andSatelliteProvider.IntegrationTests/(integration). - DI registration per component lives in a
<Component>ServiceCollectionExtensions.csadjacent to the component's classes (e.g.TileDownloaderServiceCollectionExtensions.AddTileDownloader()).
Per-Component Mapping
Component: Common
- Directory:
SatelliteProvider.Common/ - Public API:
SatelliteProvider.Common/Configs/MapConfig.csSatelliteProvider.Common/Configs/StorageConfig.csSatelliteProvider.Common/Configs/ProcessingConfig.csSatelliteProvider.Common/Configs/DatabaseConfig.csSatelliteProvider.Common/DTO/*.cs(all DTOs)SatelliteProvider.Common/Exceptions/RateLimitException.csSatelliteProvider.Common/Interfaces/*.cs(all service interfaces)SatelliteProvider.Common/Utils/GeoUtils.cs
- Internal: (none — all types are public, shared across components)
- Owns:
SatelliteProvider.Common/** - Imports from: (none)
- Consumed by: DataAccess, TileDownloader, RegionProcessing, RouteManagement, WebApi
Component: DataAccess
- Directory:
SatelliteProvider.DataAccess/ - Public API:
SatelliteProvider.DataAccess/Models/TileEntity.csSatelliteProvider.DataAccess/Models/RegionEntity.csSatelliteProvider.DataAccess/Models/RouteEntity.csSatelliteProvider.DataAccess/Models/RoutePointEntity.csSatelliteProvider.DataAccess/Repositories/ITileRepository.csSatelliteProvider.DataAccess/Repositories/IRegionRepository.csSatelliteProvider.DataAccess/Repositories/IRouteRepository.csSatelliteProvider.DataAccess/Repositories/TileRepository.csSatelliteProvider.DataAccess/Repositories/RegionRepository.csSatelliteProvider.DataAccess/Repositories/RouteRepository.csSatelliteProvider.DataAccess/DatabaseMigrator.cs
- Internal: (none — all repository types are public for DI registration)
- Owns:
SatelliteProvider.DataAccess/** - Imports from: (none — fully self-contained, no project references)
- Consumed by: TileDownloader, RegionProcessing, RouteManagement, WebApi
Component: TileDownloader
- Directory:
SatelliteProvider.Services.TileDownloader/ - csproj:
SatelliteProvider.Services.TileDownloader/SatelliteProvider.Services.TileDownloader.csproj - Public API:
SatelliteProvider.Services.TileDownloader/GoogleMapsDownloaderV2.cs(implementsISatelliteDownloader)SatelliteProvider.Services.TileDownloader/TileService.cs(implementsITileService)SatelliteProvider.Services.TileDownloader/TileDownloaderServiceCollectionExtensions.cs(DI:AddTileDownloader())
- Internal: (none)
- Owns:
SatelliteProvider.Services.TileDownloader/** - ProjectReferences:
SatelliteProvider.Common,SatelliteProvider.DataAccess - Imports from: Common, DataAccess
- Consumed by: RegionProcessing (via
ITileServicefrom Common; no direct ProjectReference), WebApi
Component: RegionProcessing
- Directory:
SatelliteProvider.Services.RegionProcessing/ - csproj:
SatelliteProvider.Services.RegionProcessing/SatelliteProvider.Services.RegionProcessing.csproj - Public API:
SatelliteProvider.Services.RegionProcessing/RegionService.cs(implementsIRegionService)SatelliteProvider.Services.RegionProcessing/RegionProcessingService.cs(background hosted service)SatelliteProvider.Services.RegionProcessing/RegionRequestQueue.cs(implementsIRegionRequestQueue)SatelliteProvider.Services.RegionProcessing/RegionProcessingServiceCollectionExtensions.cs(DI:AddRegionProcessing())
- Internal: (none)
- Owns:
SatelliteProvider.Services.RegionProcessing/** - ProjectReferences:
SatelliteProvider.Common,SatelliteProvider.DataAccess - Imports from: Common, DataAccess (uses
ITileServicefrom Common — no compile-time dependency on TileDownloader) - Consumed by: RouteManagement (via
IRegionServiceandIRegionRequestQueuefrom Common; no direct ProjectReference), WebApi
Component: RouteManagement
- Directory:
SatelliteProvider.Services.RouteManagement/ - csproj:
SatelliteProvider.Services.RouteManagement/SatelliteProvider.Services.RouteManagement.csproj - Public API:
SatelliteProvider.Services.RouteManagement/RouteService.cs(implementsIRouteService)SatelliteProvider.Services.RouteManagement/RouteProcessingService.cs(background hosted service)SatelliteProvider.Services.RouteManagement/RouteManagementServiceCollectionExtensions.cs(DI:AddRouteManagement())
- Internal: (none)
- Owns:
SatelliteProvider.Services.RouteManagement/** - ProjectReferences:
SatelliteProvider.Common,SatelliteProvider.DataAccess - Imports from: Common, DataAccess (uses
IRegionService/IRegionRequestQueuefrom Common — no compile-time dependency on RegionProcessing) - Consumed by: WebApi
Component: WebApi
- Directory:
SatelliteProvider.Api/ - Public API:
SatelliteProvider.Api/Program.cs(minimal API endpoints, DI setup)
- Internal: (none)
- Owns:
SatelliteProvider.Api/** - Imports from: Common, DataAccess, TileDownloader, RegionProcessing, RouteManagement
- Consumed by: (none — top-level entry point)
Shared / Cross-Cutting
Common/Configs
- Directory:
SatelliteProvider.Common/Configs/ - Purpose: Strongly-typed configuration POCOs bound via
IOptions<T> - Consumed by: all components
Common/DTO
- Directory:
SatelliteProvider.Common/DTO/ - Purpose: Data transfer objects shared across layers (request/response models, value types)
- Consumed by: all components
Common/Interfaces
- Directory:
SatelliteProvider.Common/Interfaces/ - Purpose: Service contracts enabling DI and testability
- Consumed by: all components (services implement, API and consumers depend on)
Common/Utils
- Directory:
SatelliteProvider.Common/Utils/ - Purpose: Stateless geospatial utility functions (coordinate math, distance, bearing)
- Consumed by: TileDownloader, RegionProcessing, RouteManagement
Allowed Dependencies (layering)
| Layer | Components | May import from (compile-time ProjectReferences) |
|---|---|---|
| 4. API / Entry | WebApi | Common, DataAccess, TileDownloader, RegionProcessing, RouteManagement |
| 3. Application | TileDownloader, RegionProcessing, RouteManagement | Common, DataAccess only — siblings communicate through interfaces in Common, never through direct ProjectReferences |
| 1. Foundation | Common, DataAccess | Common: (none); DataAccess: (none) |
Key constraint enforced by the AZ-309 split: the three Layer-3 components are compile-time siblings. Any cross-sibling call (e.g. RegionProcessing invoking tile download) MUST go through an interface defined in SatelliteProvider.Common.Interfaces and resolved via DI — adding a ProjectReference between siblings is now structurally impossible without re-introducing the coupling the refactor removed.
Verification
- No detected cycles: The dependency graph is a clean DAG.
- No cross-sibling ProjectReferences: TileDownloader, RegionProcessing, and RouteManagement each reference only Common + DataAccess. Verified by inspecting all three csproj files.
- DataAccess layer placement: DataAccess sits at Layer 1 (Foundation) alongside Common because it is consumed uniformly by all service components. An alternative layering could place it at Layer 2, but the current code treats repositories as infrastructure, not domain logic.
- DataAccess has no ProjectReference to Common: confirmed by inspecting
SatelliteProvider.DataAccess.csproj. DataAccess models and repositories are self-contained (do not use any types from Common). This contradicts an earlier baseline assumption (compliance baseline F5).