โโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโ โโโ โโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโ โโโโ โโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโ โโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโ โโโ โโโโโโโ โโโโโโโโโโโโ โโโ โโโโโโโ
โโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโ
โโโโโโ โโโโโโ โโโโโโ โโโโโโโโโโ โโโโโโ โโโโโโ โโโโ
โโโโโโ โโโโโโโโโโโโโ โโโโโโโโโ โโโโโโโโโโโโโ โโโ
โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โโโโโโโโโโโ โโโโโ โโโโโโโ โโโโโโโโโโโ โโโโโ โโโโโโโ
๐ฎ CASE OPENED: X-Ray a Legacy Codebase & Extract the Blueprint ๐ฌ
MISSION BRIEFING ๐ก
You've been assigned to investigate the TransFleet Logistics application โ a complex corporate fleet management system with decades of accumulated business logic, technical debt, and architectural mysteries. Your task: use Spec2Cloud to reverse-engineer this beast, extract API contracts, map data flows, document business rules, and create a comprehensive modernization blueprint.
This isn't your typical greenfield development. This is digital archaeology ๐๏ธ. You're diving into:
- ๐ฅ 150+ database tables of vehicle tracking madness
- ๐ 1200-line service classes with nested business rules
- ๐ป WCF services haunting the integration layer
- ๐งฉ Entity Framework EDMX with implicit relationships everywhere
- โก Quartz.NET job chains triggering like dominos
- ๐ก SignalR hubs broadcasting real-time vehicle positions
THE TWIST: Unlike surface-level analysis, Spec2Cloud performs deep code forensics to extract the hidden architecture, buried contracts, and undocumented business rules that make this application tick.
๐ต๏ธ INVESTIGATION TECHNIQUES
- โ Perform deep static analysis of complex enterprise codebases
- โ Extract API contracts from legacy Web API controllers & WCF services
- โ Reverse-engineer data models from Entity Framework EDMX & migrations
- โ Identify and catalog business rules embedded in service layer code
- โ Map integration points and external system dependencies
- โ Generate bounded context maps for microservice boundary discovery
- โ Create a complete modernization blueprint from extracted specs
๐ก DETECTIVE SKILLS ACQUIRED
- ๐ Code pattern recognition for specification extraction
- ๐ Dependency mapping and architecture visualization
- ๐งฉ Domain model reconstruction from scattered entities
- ๐ฏ Bounded context identification from code organization
- ๐ Technical debt documentation and migration planning
๐ CLEARANCE LEVEL REQUIRED
- ๐ C# & .NET Experience โ You can read C# code without a decoder ring
- ๐๏ธ Enterprise Patterns Knowledge โ Repository, Specification, Domain Services don't scare you
- ๐ Spec2Cloud Basics โ Complete the Spec2Cloud Introduction Lab first (recommended)
- ๐ป Visual Studio 2022 โ With .NET Framework 4.7.2 support installed
- ๐ Git & GitHub โ For cloning the evidence and pushing your findings
๐ฎ OPTIONAL POWER-UPS
- ๐ง Understanding of WCF services (legacy integration tech)
- ๐๏ธ SQL Server knowledge (for schema analysis)
- ๐ Azure familiarity (for modernization target understanding)
๐จ CASE ACTIVATION SEQUENCE
# ๐ Step 1: Clone the crime scene
git clone https://github.com/EmeaAppGbb/appmodlab-reverse-engineering-legacy-apps-with-spec2cloud.git
cd appmodlab-reverse-engineering-legacy-apps-with-spec2cloud
# ๐ Step 2: Checkout the legacy branch (the original codebase)
git checkout legacy
# ๐ง Step 3: Open the solution in Visual Studio
start TransFleet.sln
# ๐๏ธ Step 4: Build the project (compile the evidence)
# In Visual Studio: Build > Build Solution (Ctrl+Shift+B)
# ๐ฏ Step 5: Launch investigation mode
gh copilot-cli
# Then: "Let's analyze this codebase with Spec2Cloud!"๐ฌ EXPECTED OUTCOME:
You'll have the TransFleet application running locally, ready for deep analysis. Time to put on your detective hat! ๐ฉ๐
๐๏ธ EVIDENCE LOCKER LAYOUT
appmodlab-reverse-engineering-legacy-apps-with-spec2cloud/
โ
โโโ ๐ APPMODLAB.md # Complete lab walkthrough & instructions
โโโ ๐ README.md # You are here! ๐
โโโ ๐ง .github/workflows/ # CI/CD pipelines for legacy build validation
โ
โโโ ๐๏ธ TransFleet/ # THE LEGACY APPLICATION (branch: legacy)
โ โโโ TransFleet.sln # Main solution file
โ โโโ TransFleet.WebApi/ # 25+ API controllers (HTTP endpoints)
โ โโโ TransFleet.Core/ # Service layer (1200-line classes ๐ฑ)
โ โโโ TransFleet.Data/ # EF6 EDMX with 150+ entities
โ โโโ TransFleet.WcfServices/ # WCF service contracts (legacy integrations)
โ โโโ TransFleet.Jobs/ # Quartz.NET background jobs
โ โโโ TransFleet.Tests/ # 300+ unit tests (mostly green โ
)
โ
โโโ ๐ SpecAnalysis/ # Spec2Cloud output (branch: solution)
โ โโโ architecture-overview.md # Dependency maps & system diagrams
โ โโโ api-contracts/ # OpenAPI specs extracted from controllers
โ โโโ data-model/ # Reverse-engineered entity relationships
โ โโโ business-rules/ # Cataloged business logic
โ โโโ integration-specs/ # WCF & external system contracts
โ โโโ modernization-blueprint/ # Migration recommendations & strategy
โ
โโโ ๐ฏ BoundedContexts/ # Discovered microservice boundaries
โโโ VehicleManagement/ # Partial implementation from specs
โโโ MaintenanceScheduling/ # Spec-driven microservice design
โโโ ComplianceReporting/ # DOT HOS compliance domain
๐ณ BRANCH STRUCTURE (Investigation Checkpoints)
| Branch | Purpose | Emoji | Status |
|---|---|---|---|
main |
Complete lab with documentation | โ | Final Report |
legacy |
TransFleet application (as-is) | ๐๏ธ | Crime Scene |
solution |
Generated specs + partial implementation | ๐ | Case Solved |
step-1-static-analysis |
Code structure analysis output | ๐ฌ | Evidence #1 |
step-2-api-extraction |
API contracts & data contracts | ๐ก | Evidence #2 |
step-3-data-modeling |
Data model from EDMX & migrations | ๐๏ธ | Evidence #3 |
step-4-business-rules |
Extracted business rule specs | ๐ | Evidence #4 |
step-5-integration-mapping |
WCF & integration specifications | ๐ | Evidence #5 |
step-6-modernization-blueprint |
Complete modernization suite | ๐ฏ | Final Blueprint |
โ๏ธ TECHNOLOGY FOUND AT THE CRIME SCENE
The TransFleet application is built on a classic enterprise .NET stack from the mid-2010s era:
- ๐ ASP.NET Web API 2 on .NET Framework 4.7.2 (not .NET Core!)
- ๐๏ธ Entity Framework 6 with Database-First (EDMX files everywhere)
- ๐ก WCF Services for telematics device communication
- ๐ SQL Server 2014 with 150+ tables (some with 100M+ rows)
- ๐ Hangfire โ Background job processing
- ๐ป SignalR โ Real-time vehicle tracking updates
- ๐ AutoFac โ Dependency injection container
- โฐ Quartz.NET โ Scheduled maintenance alerts
- ๐ SSRS โ SQL Server Reporting Services for compliance reports
- ๐๏ธ Repository pattern over EF6
- ๐ Specification pattern for business rules
- ๐ฏ Domain services with complex orchestration
- ๐ Adapter pattern for external integrations
- ๐ Hub pattern for SignalR real-time messaging
- 1200-line
VehicleService.cswith deeply nested logic ๐คฏ - Business rules scattered across 60+ domain entities
- 200+ Entity Framework migrations (evolution history)
- Federal DOT regulations hardcoded in
ComplianceService.cs - Geofencing rules engine with spatial calculations
๐ MODERNIZATION DESTINATION
After reverse-engineering with Spec2Cloud, you'll have a complete modernization blueprint guiding the transformation:
- โ๏ธ .NET 9 Microservices on Azure Container Apps
- ๐ Bounded Contexts discovered from legacy codebase analysis
- ๐ Clean API Contracts extracted and refined
- ๐๏ธ Modern Data Models based on reverse-engineered entities
- ๐ Documented Business Rules ready for reimplementation
- ๐๏ธ Architecture Overview โ System diagrams & dependency maps
- ๐ก API Contracts โ OpenAPI 3.0 specs for all endpoints
- ๐๏ธ Data Model Specs โ Entity relationships & schema documentation
- ๐ Business Rules Catalog โ Extracted logic in readable format
- ๐ Integration Specs โ External system contracts & protocols
- ๐ฏ Bounded Context Map โ Recommended microservice boundaries
- ๐ Migration Blueprint โ Step-by-step modernization strategy
๐ THE GOAL:
Quality and completeness of reverse-engineered specifications โ the blueprint that makes modernization predictable, plannable, and successful! ๐
๐ INVESTIGATION PHASES
This lab uses GitHub Copilot CLI in agent mode to perform the reverse engineering. You'll work interactively with Copilot to analyze the codebase and extract specifications.
# EVIDENCE FOUND: Understanding the domain
@github copilot "Analyze the TransFleet solution structure and summarize the main components"
@github copilot "What business domain does this application serve? List the key workflows"# INTEL GATHERED: Code structure & dependencies
@github copilot "Use Spec2Cloud to analyze the code structure and generate a dependency map"
@github copilot "Identify the layers, patterns, and architectural style used in TransFleet"# MYSTERY SOLVED: API endpoints documented
@github copilot "Extract OpenAPI specifications from all Web API controllers"
@github copilot "Document the WCF service contracts in the WcfServices project"# BLUEPRINT ACQUIRED: Database schema mapped
@github copilot "Analyze the EDMX file and extract entity relationships"
@github copilot "Map the migration history to understand database evolution"# RULES OF ENGAGEMENT: Logic cataloged
@github copilot "Extract business rules from VehicleService, MaintenanceService, and ComplianceService"
@github copilot "Document the DOT Hours of Service compliance calculations"# EXTERNAL CONNECTIONS: Integration specs documented
@github copilot "Catalog all WCF service dependencies and external system integrations"
@github copilot "Document the telematics device communication protocol"# CONTEXT MAPPING: Microservice boundaries discovered
@github copilot "Analyze the codebase and suggest bounded context boundaries for microservices"
@github copilot "Group the entities and services into logical domains"# HUMAN INSIGHT: Spec validation & enhancement
@github copilot "Review the generated specifications for accuracy and completeness"
@github copilot "Add domain knowledge and correct any misinterpretations in the specs"# CASE CLOSED: Complete specification suite assembled
@github copilot "Generate a comprehensive modernization blueprint with migration recommendations"
@github copilot "Prioritize the bounded contexts for implementation order"๐ DETAILED INSTRUCTIONS:
See APPMODLAB.md for the complete step-by-step walkthrough with screenshots, sample outputs, and troubleshooting tips! ๐
๐ฏ ESTIMATED INVESTIGATION TIME
- โก Quick Scan: 3 hours (core analysis only)
- ๐ Full Investigation: 5โ7 hours (complete spec extraction)
- ๐ Deep Dive: 8+ hours (with refinement & validation)
โฐ BREAKDOWN:
| Phase | Time | Description |
|---|---|---|
| ๐ต๏ธ Explore Codebase | 45 min | Build, run, understand domain |
| ๐ฌ Static Analysis | 1 hour | Dependency mapping & architecture |
| ๐ก API Extraction | 1.5 hours | OpenAPI specs from controllers & WCF |
| ๐๏ธ Data Modeling | 1.5 hours | EDMX analysis & entity relationships |
| ๐ Business Rules | 2 hours | Service layer logic extraction |
| ๐ Integration Mapping | 1 hour | External system documentation |
| ๐ฏ Bounded Contexts | 1 hour | Microservice boundary discovery |
| ๐ง Review & Refine | 1 hour | Spec validation & enhancement |
| ๐ Blueprint Assembly | 30 min | Final modernization strategy |
๐ก PRO TIP: Take breaks between phases! This is an investigation marathon, not a sprint. Your brain needs time to process the architecture patterns. ๐ง โ
๐ INTEL LINKS & REFERENCES
- ๐ Spec2Cloud Official Docs โ Tool capabilities & usage
- ๐ฏ GitHub Copilot CLI Guide โ Agent mode instructions
- ๐๏ธ Modernization Patterns โ Azure architecture guidance
- ๐ Spec2Cloud Introduction Lab โ Learn the basics first!
- ๐ Legacy to Modern Migration Lab โ Next step after specs
- โ๏ธ Azure Container Apps Deployment โ Deploy your microservices
- ๐ป Visual Studio 2022 โ IDE for .NET development
- ๐ GitHub CLI โ GitHub Copilot CLI integration
- ๐๏ธ SQL Server Express โ Database for local testing
- ๐๏ธ Entity Framework 6 EDMX โ Database-First modeling
- ๐ก WCF Services โ Legacy service technology
- ๐ฏ Domain-Driven Design โ Bounded contexts explained
- ๐ Strangler Fig Pattern โ Incremental modernization
- ๐ฌ GitHub Discussions โ Ask questions, share findings
- ๐ Report Issues โ Found a bug? Let us know!
- ๐ Contribute โ Improve this lab for others
๐ WHAT MAKES THIS LAB SPECIAL?
This isn't a toy application. TransFleet is a realistic enterprise system with:
- โ Real complexity โ 1200-line service classes, 150+ tables, WCF integrations
- โ Real patterns โ Repository, Specification, Domain Services, Adapters
- โ Real challenges โ Technical debt, scattered business rules, implicit dependencies
- โ Real value โ Skills that transfer directly to modernization projects
๐ฏ YOU'LL WALK AWAY WITH:
- ๐ง Confidence in analyzing complex legacy codebases
- ๐ ๏ธ Spec2Cloud expertise for reverse engineering
- ๐ A complete modernization blueprint
- ๐ Skills for your next enterprise migration project
๐ต๏ธ MYSTERY AWAITS...
The TransFleet codebase holds decades of business knowledge. Your mission: extract it, document it, and make it modern.
CASE STATUS: ๐ OPEN
LEAD INVESTIGATOR: YOU ๐ฏ
OBJECTIVE: EXTRACT THE BLUEPRINT ๐
๐ BEGIN LAB: Open APPMODLAB.md ๐
๐ BUILT WITH โค๏ธ BY THE EMEA APP GBB TEAM ๐
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐น๏ธ PRESS START TO BEGIN YOUR INVESTIGATION ๐น๏ธ โ
โ โ
โ ๐ EVIDENCE GATHERED ยท ๐ก INTEL ANALYZED ยท ๐ฏ CASE โ
โ SOLVED WITH SPEC2CLOUD! ๐ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ