Skip to content

daonhan/TravelBookings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Travel Booking

Legacy .NET Framework monolith โ†’ Azure microservices modernization

Travel Booking is the architectural blueprint and reference implementation for migrating a monolithic .NET Framework application (~40,000 users, ~600-table database) to a cloud-native, event-driven microservices architecture on Azure using .NET 9.

Status: Pre-Phase 1 โ€” Phase 1 runs May 2026 to January 2027. Service scaffolding, shared libraries, and architecture design documents are complete; awaiting Phase 1 kickoff.


Architecture Overview

The modernization follows the Strangler Fig pattern with Azure API Management (APIM) as the facade, progressively routing traffic from the legacy monolith to five bounded-context microservices.

graph TB
    Client["๐ŸŒ React 18 SPA"]
    APIM["๐Ÿ”— Azure APIM<br/>(Gateway)"]
    
    Travel["โœˆ๏ธ Travel Booking"]
    Event["๐Ÿ“… Event Management"]
    Payment["๐Ÿ’ณ Payment"]
    Reporting["๐Ÿ“Š Reporting"]
    Notification["๐Ÿ”” Notification"]
    
    Bus["๐Ÿ“ฎ Azure Service Bus<br/>(Topics & Queues)"]
    
    Client -->|All requests| APIM
    APIM -->|Route & Feature Flags| Travel
    APIM -->|Route & Feature Flags| Event
    APIM -->|Route & Feature Flags| Payment
    APIM -->|Route & Feature Flags| Reporting
    APIM -->|Route & Feature Flags| Notification
    
    Travel -->|Domain Events| Bus
    Event -->|Domain Events| Bus
    Payment -->|Domain Events| Bus
    Reporting -->|Subscribe Events| Bus
    Notification -->|Subscribe Events| Bus
    
    Travel -.->|Command Query| Bus
    Event -.->|Command Query| Bus
    Payment -.->|Command Query| Bus
Loading

Core Architectural Patterns

Pattern Implementation
Strangler Fig APIM routes traffic to new services or legacy, with feature-flag-controlled progressive rollout
Transactional Outbox Domain state + outbox message written in a single SQL transaction; MassTransit publishes to Service Bus
Saga Orchestration MassTransit State Machine in Travel Booking for multi-step booking workflows with compensation
CQRS Write services (Travel, Event, Payment) separated from read-optimized Reporting Service
Anti-Corruption Layer Payment Service wraps the legacy payment system in Phase 1
Event-Driven Messaging Service Bus Topics for pub/sub, Queues for point-to-point commands

Microservices

Service Responsibility Key Patterns
Travel Booking Search, itinerary management, booking lifecycle Saga orchestrator, transactional outbox
Event Management Event CRUD, scheduling, attendee registration Domain events, pub/sub
Payment Payment processing, refunds, reconciliation Anti-corruption layer (legacy wrapper in Phase 1)
Reporting Dashboards, analytics, data exports Read-only materialized views from domain events
Notification Email, SMS, push notifications Event subscriber, template-based delivery

Each service follows Clean Architecture: API โ†’ Application โ†’ Domain โ†’ Infrastructure, with its own Azure SQL database.


Tech Stack

Backend

Component Technology
Runtime .NET 9 / ASP.NET Core 9
ORM Entity Framework Core 9
Messaging MassTransit 8.3 + Azure Service Bus
CQRS/Mediator MediatR 12.4
Resilience Polly 8.5 (circuit breakers, retries)
Validation FluentValidation 11.11
Mapping Mapster 7.4
Logging Serilog 9.0 โ†’ Application Insights
Auth JWT Bearer + API Key
API Docs Swashbuckle/Swagger 7.3
Testing xUnit 2.9 ยท Moq 4.20 ยท FluentAssertions 7.2 ยท Coverlet 6.0

Frontend

Component Technology
Framework React 18.3 + TypeScript 5.7
Build Vite 6.0
Routing TanStack Router 1.92
Server State TanStack Query 5.62
Client State Zustand 5.0
Forms React Hook Form 7.54 + Zod 3.24
Styling TailwindCSS 4.0 + Radix UI
Real-time SignalR 8.0
Charts Tremor 3.18
i18n i18next 24.2
Testing Vitest 3.0 ยท Testing Library 16.1 ยท Playwright 1.49

Azure Infrastructure

Azure App Service ยท Azure SQL Database ยท Azure Service Bus ยท Azure API Management ยท Azure Front Door (CDN + WAF) ยท Application Insights ยท Azure Key Vault ยท Azure DevOps CI/CD


Project Structure

TravelBooking/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Common/                            # Shared NuGet libraries
โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Common.Events/       #   Base IntegrationEvent, event contracts
โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Common.Logging/      #   Serilog config, correlation ID middleware
โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Common.HealthChecks/ #   SQL + Service Bus health check extensions
โ”‚   โ”‚   โ””โ”€โ”€ TravelBooking.Common.Security/     #   JWT Bearer + API Key auth handlers
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ Services/                          # Microservices (Clean Architecture per service)
โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.API/         #   REST endpoints, middleware
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Application/ #   MediatR handlers, DTOs, validators
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Domain/      #   Entities, value objects, domain events
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TravelBooking.Infrastructure/ # EF Core, repositories, outbox
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ TravelBooking.Tests/       #   Unit + integration tests
โ”‚   โ”‚   โ”œโ”€โ”€ EventManagement/               #   (same 5-project structure)
โ”‚   โ”‚   โ”œโ”€โ”€ Payment/                       #   (same 5-project structure)
โ”‚   โ”‚   โ”œโ”€โ”€ Reporting/                     #   (same 5-project structure)
โ”‚   โ”‚   โ””โ”€โ”€ Notification/                  #   (same 5-project structure)
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ Frontend/                          # React 18 SPA
โ”‚       โ”œโ”€โ”€ src/
โ”‚       โ”‚   โ”œโ”€โ”€ app/                       #   Layout, router setup
โ”‚       โ”‚   โ”œโ”€โ”€ features/                  #   Feature-sliced modules (bookings, events, etc.)
โ”‚       โ”‚   โ”œโ”€โ”€ shared/                    #   Reusable components, hooks, utilities
โ”‚       โ”‚   โ””โ”€โ”€ mocks/                     #   MSW mock server for testing
โ”‚       โ””โ”€โ”€ e2e/                           #   Playwright E2E tests
โ”‚
โ”œโ”€โ”€ Directory.Build.props                  # Shared .NET build settings
โ”œโ”€โ”€ Directory.Packages.props               # Central NuGet version management
โ”œโ”€โ”€ TravelBooking.slnx                         # Solution file
โ”‚
โ”œโ”€โ”€ Technical_Assessment_Solution_Final_Version5.md   # Latest architecture design
โ”œโ”€โ”€ Technical_Assessment_Solution_Final_Version4.md   # Previous architecture revision
โ”œโ”€โ”€ [Nhan.Nguyen]Technical_Assessment_Solution.md     # Candidate's primary deliverable
โ”œโ”€โ”€ TechSpec.md                            # Detailed technical specifications
โ”œโ”€โ”€ PRD-Frontend-React18-SPA.md            # Frontend PRD (51 user stories)
โ”œโ”€โ”€ Diagrams.md                            # Mermaid diagram sources
โ”œโ”€โ”€ plan-travelBookings.prompt.md          # AI-assisted planning prompt
โ””โ”€โ”€ CLAUDE.md                              # AI agent configuration

Getting Started

Prerequisites

  • .NET SDK 9.0+
  • Node.js 18+
  • SQL Server 2019+ or Azure SQL Database
  • Azure Service Bus namespace (or local emulator)

Backend

# Restore and build all services
dotnet restore TravelBooking.slnx
dotnet build TravelBooking.slnx

# Run tests
dotnet test TravelBooking.slnx

# Run a specific service
cd src/Services/TravelBooking/TravelBooking.API
dotnet run

Each service requires configuration in appsettings.json:

Key Purpose
ConnectionStrings:DefaultConnection Azure SQL connection string
AzureServiceBus:ConnectionString Service Bus connection
Authentication:Authority OAuth2/OIDC authority (Azure AD)
Authentication:SigningKey JWT signing key
ApplicationInsights:InstrumentationKey Telemetry key

Frontend

cd src/Frontend

npm install          # Install dependencies
npm run dev          # Dev server at http://localhost:5173
npm run build        # TypeScript check + production build โ†’ dist/
npm run test         # Vitest (single run)
npm run test:watch   # Vitest in watch mode
npm run test:coverage # Vitest with coverage
npm run test:e2e     # Playwright E2E tests
npm run typecheck    # TypeScript type checking (tsc --noEmit)
npm run lint         # ESLint + Prettier check
npm run lint:fix     # ESLint + Prettier auto-fix

Testing Strategy

Layer Tool Scope
Backend Unit xUnit + Moq + FluentAssertions Domain logic, handlers, validators
Backend Integration WebApplicationFactory API endpoints, EF Core + in-memory DB
Code Coverage Coverlet Target: โ‰ฅ80% on domain/application layers
Frontend Unit Vitest + Testing Library Components, hooks, utilities
Frontend E2E Playwright Full user journeys (booking, events, payments, dashboards, notifications)
API Mocking MSW (Mock Service Worker) Frontend tests against mocked backend

Observability

  • Structured Logging โ€” Serilog with JSON output to Azure Application Insights
  • Correlation IDs โ€” Propagated across all services via CorrelationIdMiddleware
  • Distributed Tracing โ€” W3C Trace Context (traceparent header) across HTTP and Service Bus
  • Health Checks โ€” /health endpoint per service (SQL connectivity, Service Bus reachability)
  • Metrics & Dashboards โ€” Azure Monitor for response time, error rate, throughput
  • Alerting โ€” Dead-letter queue monitoring, circuit breaker state changes, health check failures

Migration Timeline (Phase 1)

Milestone Period Focus
MS1 โ€” Foundation Mayโ€“Jun 2026 IaC, CI/CD, APIM facade, observability, shared libraries
MS2 โ€” Reporting Julโ€“Aug 2026 First service extraction (read-only, lowest risk)
MS3 โ€” Events + Notifications Augโ€“Oct 2026 Event-driven messaging backbone
MS4 โ€” Travel Booking Nov 2026โ€“Jan 2027 Saga orchestrator, core booking workflow
MS5 โ€” Payment + Stabilization Dec 2026โ€“Jan 2027 Payment isolation, end-to-end testing, hardening

Team: 5 backend engineers + frontend and DevOps resources.


Documentation

Document Description
Technical Assessment Solution (Latest) Complete architecture design with diagrams and ADRs (v5)
Technical Assessment Solution (v4) Previous architecture revision
Candidate Deliverable Primary technical assessment submission (2026-03-21)
Technical Specification Event payloads, error handling, retry strategies, API contracts
Frontend PRD 51 user stories, acceptance criteria, UX specifications
Architecture Diagrams Mermaid source for all architecture diagrams
Original Assessment Brief Requirements, constraints, and evaluation criteria

License

Not yet specified.

About

Travel Booking is the architectural blueprint and reference implementation for migrating a monolithic .NET Framework application (~40,000 users, ~600-table database) to a cloud-native, event-driven microservices architecture on Azure using .NET 9.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors