|
| 1 | +# Implementation Plan: Project Structure and Scaffolding |
| 2 | + |
| 3 | +**Branch**: `001-project-scaffold` | **Date**: 2026-03-11 | **Spec**: [spec.md](spec.md) |
| 4 | +**Input**: Feature specification from `/specs/001-project-scaffold/spec.md` |
| 5 | + |
| 6 | +## Summary |
| 7 | + |
| 8 | +Create a well-structured, multi-project .NET solution that demonstrates modern development practices for a bike tracking application. The solution must be buildable, runnable, and include a basic working hello screen on the frontend and a callable API. This establishes the foundation for all future development with clear separation of concerns and proper orchestration using .NET Aspire. |
| 9 | + |
| 10 | +## Technical Context |
| 11 | + |
| 12 | +**Language/Version**: .NET 10+ (specified in global.json) |
| 13 | +**Primary Dependencies**: |
| 14 | + - .NET Aspire (service orchestration) |
| 15 | + - ASP.NET Core (API framework) |
| 16 | + - Vue + TypeScript + Vite (frontend framework) |
| 17 | + - F# (domain logic layer) |
| 18 | + |
| 19 | +**Storage**: N/A (no database in this phase - out of scope) |
| 20 | +**Testing**: Not included in scaffolding phase |
| 21 | +**Target Platform**: Windows, macOS, Linux (multi-platform support) |
| 22 | +**Project Type**: Multi-project monorepo (Web service + Frontend + Orchestration) |
| 23 | +**Performance Goals**: Pages load in <5 seconds, API responds in <2 seconds |
| 24 | +**Constraints**: |
| 25 | + - No database setup or ORM configuration |
| 26 | + - No authentication/authorization implementation |
| 27 | + - Only scaffold structure, no feature implementation |
| 28 | + - Hello screen must be simple (static or minimal interactivity) |
| 29 | + |
| 30 | +**Scale/Scope**: 5 core projects, buildable solution, single developer can run entire stack locally |
| 31 | + |
| 32 | +## Project Structure |
| 33 | + |
| 34 | +### Documentation (this feature) |
| 35 | + |
| 36 | +```text |
| 37 | +specs/001-project-scaffold/ |
| 38 | +├── plan.md # This file |
| 39 | +├── spec.md # Feature specification |
| 40 | +├── checklists/ |
| 41 | +│ └── requirements.md # Spec quality validation |
| 42 | +└── tasks.md # Phase breakdown (generated by /speckit.tasks) |
| 43 | +``` |
| 44 | + |
| 45 | +### Source Code (repository root) |
| 46 | + |
| 47 | +```text |
| 48 | +src/ |
| 49 | +├── BikeTracking.Api/ # ASP.NET Core REST API |
| 50 | +│ ├── Program.cs # Minimal API configuration |
| 51 | +│ ├── appsettings.json # Configuration |
| 52 | +│ └── Properties/ |
| 53 | +│ └── launchSettings.json # Launch profiles |
| 54 | +│ |
| 55 | +├── BikeTracking.Frontend/ # Vue + TypeScript + Vite SPA |
| 56 | +│ ├── src/ |
| 57 | +│ │ ├── index.html # Hello screen entry point |
| 58 | +│ │ ├── main.ts # App initialization |
| 59 | +│ │ ├── my-app.ts # Main component |
| 60 | +│ │ └── my-app.html # Template |
| 61 | +│ ├── package.json # Dependencies |
| 62 | +│ ├── vite.config.ts # Vite configuration |
| 63 | +│ └── tsconfig.json # TypeScript configuration |
| 64 | +│ |
| 65 | +├── BikeTracking.Domain.FSharp/ # F# domain logic |
| 66 | +│ ├── Library.fs # Domain definitions |
| 67 | +│ └── BikeTracking.Domain.FSharp.fsproj |
| 68 | +│ |
| 69 | +├── BikeTracking.AppHost/ # .NET Aspire orchestration |
| 70 | +│ ├── AppHost.cs # Service orchestration |
| 71 | +│ └── Properties/ |
| 72 | +│ └── launchSettings.json # Launch profiles |
| 73 | +│ |
| 74 | +└── BikeTracking.ServiceDefaults/ # Shared service configuration |
| 75 | + ├── Extensions.cs # Common extension methods |
| 76 | + └── BikeTracking.ServiceDefaults.csproj |
| 77 | +
|
| 78 | +BikeTracking.slnx # Solution file (uncontrolled format) |
| 79 | +global.json # .NET version constraint |
| 80 | +README.md # Setup and running documentation |
| 81 | +
|
| 82 | +.aspire/ # Aspire configuration cache |
| 83 | +.vscode/ # VS Code workspace settings |
| 84 | +.specify/ # SpecKit configuration and templates |
| 85 | +``` |
| 86 | + |
| 87 | +**Structure Decision**: Multi-project monorepo with clear layered architecture: |
| 88 | +1. **API Layer** (BikeTracking.Api) - HTTP endpoints and request handling |
| 89 | +2. **Frontend Layer** (BikeTracking.Frontend) - User interface |
| 90 | +3. **Domain Layer** (BikeTracking.Domain.FSharp) - Core business logic (F# for type safety) |
| 91 | +4. **Infrastructure Layer** (BikeTracking.ServiceDefaults) - Shared configurations |
| 92 | +5. **Orchestration** (BikeTracking.AppHost) - Service wiring and local development environment |
| 93 | + |
| 94 | +This structure provides: |
| 95 | +- Clear separation of concerns |
| 96 | +- Ability to develop frontend/backend independently |
| 97 | +- Use of F# for type-safe domain modeling |
| 98 | +- Unified orchestration for local development with Aspire |
| 99 | + |
| 100 | +## Design Decisions |
| 101 | + |
| 102 | +### 1. .NET Aspire for Orchestration |
| 103 | +**Decision**: Use .NET Aspire for service orchestration and configuration |
| 104 | +**Rationale**: |
| 105 | +- Built-in tooling for .NET multi-project applications |
| 106 | +- Enables local development with realistic multi-process setup |
| 107 | +- Reduces configuration friction |
| 108 | +- Standard for modern .NET applications |
| 109 | + |
| 110 | +### 2. Minimal APIs |
| 111 | +**Decision**: Use minimal APIs pattern for API endpoints (no controllers) |
| 112 | +**Rationale**: |
| 113 | +- Modern .NET approach with less boilerplate |
| 114 | +- Lightweight and easy to understand |
| 115 | +- Better for small services and verification endpoints |
| 116 | +- Aligns with Aspire best practices |
| 117 | + |
| 118 | +### 3. Vue + Vite for Frontend |
| 119 | +**Decision**: Continue with existing Vue + Vite + TypeScript setup |
| 120 | +**Rationale**: |
| 121 | +- Already configured in existing project |
| 122 | +- Modern development experience with hot reload |
| 123 | +- Type safety with TypeScript |
| 124 | +- Good ecosystem and community support |
| 125 | + |
| 126 | +### 4. F# for Domain Logic |
| 127 | +**Decision**: Include F# project for domain logic |
| 128 | +**Rationale**: |
| 129 | +- Type-driven development benefits for core business logic |
| 130 | +- Immutability by default reduces bugs |
| 131 | +- Pattern matching for complex domain modeling |
| 132 | +- Already present in project structure |
| 133 | + |
| 134 | +### 5. No Database in Phase 1 |
| 135 | +**Decision**: Exclude database, ORM, and data persistence |
| 136 | +**Rationale**: |
| 137 | +- Specified as out of scope |
| 138 | +- Allows focus on project structure and integration |
| 139 | +- Can be added in subsequent phases |
| 140 | +- Simpler to verify correct scaffolding |
| 141 | + |
| 142 | +## Implementation Phases |
| 143 | + |
| 144 | +### Phase 1: Setup & Foundation |
| 145 | +- Verify and document project structure |
| 146 | +- Configure solution file to include all projects |
| 147 | +- Set up shared service defaults |
| 148 | +- Create README with setup instructions |
| 149 | + |
| 150 | +### Phase 2: API Project |
| 151 | +- Configure minimal APIs in Program.cs |
| 152 | +- Add health check endpoint |
| 153 | +- Configure routing and middleware |
| 154 | +- Enable hot reload and logging |
| 155 | + |
| 156 | +### Phase 3: Frontend Project |
| 157 | +- Create hello screen component |
| 158 | +- Configure development server |
| 159 | +- Enable hot reload |
| 160 | +- Add basic styling |
| 161 | + |
| 162 | +### Phase 4: Orchestration & Integration |
| 163 | +- Configure AppHost to orchestrate API and Frontend |
| 164 | +- Set up service discovery |
| 165 | +- Configure environment-specific settings |
| 166 | +- Test end-to-end integration |
| 167 | + |
| 168 | +### Phase 5: Documentation & Polish |
| 169 | +- Complete README with running instructions |
| 170 | +- Document API endpoints |
| 171 | +- Add troubleshooting guide |
| 172 | +- Verify all success criteria met |
| 173 | + |
| 174 | +## Dependencies & Integration Points |
| 175 | + |
| 176 | +``` |
| 177 | +BikeTracking.Frontend |
| 178 | + ├─> API calls to BikeTracking.Api |
| 179 | + └─> Vite build system (npm/yarn) |
| 180 | +
|
| 181 | +BikeTracking.Api |
| 182 | + ├─> BikeTracking.ServiceDefaults (extensions) |
| 183 | + ├─> BikeTracking.Domain.FSharp (business logic) |
| 184 | + └─> .NET Aspire hosting |
| 185 | +
|
| 186 | +BikeTracking.AppHost |
| 187 | + ├─> BikeTracking.Api (orchestrates) |
| 188 | + ├─> BikeTracking.Frontend (orchestrates) |
| 189 | + └─> BikeTracking.ServiceDefaults (configuration) |
| 190 | +
|
| 191 | +BikeTracking.Domain.FSharp |
| 192 | + └─> (no external project dependencies) |
| 193 | +
|
| 194 | +BikeTracking.ServiceDefaults |
| 195 | + └─> (infrastructure only, no feature dependencies) |
| 196 | +``` |
| 197 | + |
| 198 | +## Success Metrics |
| 199 | + |
| 200 | +All items from spec.md Success Criteria must be met: |
| 201 | + |
| 202 | +1. **SC-001**: New developer setup in <10 minutes with README guidance |
| 203 | +2. **SC-002**: `dotnet build` completes without errors |
| 204 | +3. **SC-003**: AppHost orchestrates services without crashes |
| 205 | +4. **SC-004**: Frontend displays hello screen in <5 seconds |
| 206 | +5. **SC-005**: API health endpoint responds in <2 seconds |
| 207 | +6. **SC-006**: 5+ projects documented in README |
| 208 | +7. **SC-007**: 90% developer success rate on first attempt |
| 209 | +8. **SC-008**: Uses modern .NET tooling (Aspire, .NET 10+, minimal APIs) |
| 210 | + |
| 211 | +## Complexity Tracking |
| 212 | + |
| 213 | +| Item | Rationale | |
| 214 | +|------|-----------| |
| 215 | +| 5 Projects | Clear separation: API, Frontend, Domain, Defaults, Orchestration. Simpler structure (3 projects) inadequate for demonstrating multi-tier architecture | |
| 216 | +| F# Project | Type-driven domain modeling. Direct C# insufficient for showcasing functional patterns | |
| 217 | +| Aspire Usage | Enterprise-grade orchestration. Manual configuration inadequate for complex multi-service setup | |
| 218 | +| Vue Frontend | Modern SPA framework required. Plain HTML insufficient for demonstrating hot reload and component patterns | |
| 219 | + |
| 220 | +## File Locations & Artifacts |
| 221 | + |
| 222 | +| Artifact | Location | Purpose | |
| 223 | +|----------|----------|---------| |
| 224 | +| Solution File | `BikeTracking.slnx` | Include all 5 projects | |
| 225 | +| Global Config | `global.json` | Enforce .NET 10+ | |
| 226 | +| README | `README.md` | Setup, running, structure documentation | |
| 227 | +| API Program | `src/BikeTracking.Api/Program.cs` | Minimal API endpoints | |
| 228 | +| Frontend Entry | `src/BikeTracking.Frontend/src/main.ts` | App initialization | |
| 229 | +| Hello Screen | `src/BikeTracking.Frontend/src/my-app.html` | Hello screen template | |
| 230 | +| AppHost | `src/BikeTracking.AppHost/AppHost.cs` | Service orchestration | |
| 231 | +| Service Defaults | `src/BikeTracking.ServiceDefaults/Extensions.cs` | Shared configuration | |
0 commit comments