mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 19:41:15 +00:00
b0fffa6d42
Phase A baseline outputs from /autodev (Steps 1-5): - Problem & solution docs (_docs/00_problem, _docs/01_solution) - Codebase documentation (_docs/02_document) incl. architecture, module-layout, glossary, system-flows, baseline compliance scan - Test specs (blackbox, performance, resilience, security, resource, traceability matrix) - Test task decomposition (_docs/02_tasks/todo): AZ-285..AZ-290 - Testability refactor (_docs/04_refactoring/01-testability-refactoring): - TC-01 Move DownloadedTileInfoV2 + new ExistingTileInfo to Common.DTO - TC-02 Replace dead ISatelliteDownloader API with real signatures - TC-03 GoogleMapsDownloaderV2 implements ISatelliteDownloader - TC-04 TileService depends on ISatelliteDownloader (mockable) - TC-05 DI + endpoints use ISatelliteDownloader - Test runner scripts (scripts/run-tests.sh, run-performance-tests.sh) - Autodev state pointer (_docs/_autodev_state.md) Prepares the codebase for AZ-285..AZ-290 unit/integration test work. Co-authored-by: Cursor <cursoragent@cursor.com>
141 lines
6.5 KiB
Markdown
141 lines
6.5 KiB
Markdown
# Module Layout
|
|
|
|
**Status**: derived-from-code
|
|
|
|
**Language**: csharp
|
|
**Layout Convention**: custom (flat service project, per-project component separation)
|
|
**Root**: ./
|
|
**Last Updated**: 2026-05-10
|
|
|
|
## Layout Rules
|
|
|
|
1. Each component owns ONE top-level project directory (`.csproj` boundary), except the Services project which hosts three logical components in a flat layout.
|
|
2. Shared code lives under `SatelliteProvider.Common/` — the foundation layer.
|
|
3. Cross-cutting concerns (DTOs, interfaces, configs, geo-math) all reside in Common.
|
|
4. Public API surface per component = `public` types in the namespace root. Everything marked `internal` or private is internal.
|
|
5. Tests live in separate projects: `SatelliteProvider.Tests/` (unit) and `SatelliteProvider.IntegrationTests/` (integration).
|
|
|
|
## Per-Component Mapping
|
|
|
|
### Component: Common
|
|
|
|
- **Directory**: `SatelliteProvider.Common/`
|
|
- **Public API**:
|
|
- `SatelliteProvider.Common/Configs/MapConfig.cs`
|
|
- `SatelliteProvider.Common/Configs/StorageConfig.cs`
|
|
- `SatelliteProvider.Common/Configs/ProcessingConfig.cs`
|
|
- `SatelliteProvider.Common/Configs/DatabaseConfig.cs`
|
|
- `SatelliteProvider.Common/DTO/*.cs` (all DTOs)
|
|
- `SatelliteProvider.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.cs`
|
|
- `SatelliteProvider.DataAccess/Models/RegionEntity.cs`
|
|
- `SatelliteProvider.DataAccess/Models/RouteEntity.cs`
|
|
- `SatelliteProvider.DataAccess/Models/RoutePointEntity.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/ITileRepository.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/IRegionRepository.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/IRouteRepository.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/TileRepository.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/RegionRepository.cs`
|
|
- `SatelliteProvider.DataAccess/Repositories/RouteRepository.cs`
|
|
- `SatelliteProvider.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/` (shared project)
|
|
- **Public API**:
|
|
- `SatelliteProvider.Services/GoogleMapsDownloaderV2.cs` (implements `ISatelliteDownloader`)
|
|
- `SatelliteProvider.Services/TileService.cs` (implements `ITileService`)
|
|
- **Internal**: (none — flat project, classes are public)
|
|
- **Owns**: `SatelliteProvider.Services/GoogleMapsDownloaderV2.cs`, `SatelliteProvider.Services/TileService.cs`
|
|
- **Imports from**: Common, DataAccess
|
|
- **Consumed by**: RegionProcessing, WebApi
|
|
|
|
### Component: RegionProcessing
|
|
|
|
- **Directory**: `SatelliteProvider.Services/` (shared project)
|
|
- **Public API**:
|
|
- `SatelliteProvider.Services/RegionService.cs` (implements `IRegionService`)
|
|
- `SatelliteProvider.Services/RegionProcessingService.cs` (background hosted service)
|
|
- `SatelliteProvider.Services/RegionRequestQueue.cs` (implements `IRegionRequestQueue`)
|
|
- **Internal**: (none)
|
|
- **Owns**: `SatelliteProvider.Services/RegionService.cs`, `SatelliteProvider.Services/RegionProcessingService.cs`, `SatelliteProvider.Services/RegionRequestQueue.cs`
|
|
- **Imports from**: Common, DataAccess, TileDownloader
|
|
- **Consumed by**: RouteManagement, WebApi
|
|
|
|
### Component: RouteManagement
|
|
|
|
- **Directory**: `SatelliteProvider.Services/` (shared project)
|
|
- **Public API**:
|
|
- `SatelliteProvider.Services/RouteService.cs` (implements `IRouteService`)
|
|
- `SatelliteProvider.Services/RouteProcessingService.cs` (background hosted service)
|
|
- **Internal**: (none)
|
|
- **Owns**: `SatelliteProvider.Services/RouteService.cs`, `SatelliteProvider.Services/RouteProcessingService.cs`
|
|
- **Imports from**: Common, DataAccess, 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 |
|
|
|-------|------------|-----------------|
|
|
| 4. API / Entry | WebApi | 1, 2, 3 |
|
|
| 3. Application (Orchestration) | RouteManagement | 1, 2, 3 (RegionProcessing only) |
|
|
| 3. Application (Processing) | RegionProcessing | 1, 2, 3 (TileDownloader only) |
|
|
| 2. Domain Services | TileDownloader | 1 |
|
|
| 1. Foundation | Common, DataAccess | Common: (none); DataAccess: (none) |
|
|
|
|
## Verification Needed
|
|
|
|
- **Shared Services project**: TileDownloader, RegionProcessing, and RouteManagement coexist in a single `SatelliteProvider.Services/` project. File-level ownership is used (not directory-level) which is unusual for .NET. A future refactor into separate projects per component would make ownership boundaries cleaner.
|
|
- **No detected cycles**: The dependency graph is a clean DAG.
|
|
- **DataAccess layer placement**: DataAccess is placed 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.
|