8000 GitHub - Adham-Kiwan/baggage-recovery: Airport Lost Baggage & Recovery: SkyBook + BagTrace, two ASP.NET Core MVC apps communicating via RabbitMQ · GitHub
[go: up one dir, main page]

Skip to content

About

Airport Lost Baggage & Recovery: SkyBook + BagTrace, two ASP.NET Core MVC apps communicating via RabbitMQ

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Airport Lost Baggage & Recovery

.NET 10 ASP.NET Core MVC RabbitMQ 4 SQL Server 2022 Docker Compose

When an airline loses a bag, the passenger and the airport staff work in different systems. This project builds both sides and keeps them in sync:

  • SkyBook is the passenger app. Book a flight, check in bags, report a lost one, and follow its recovery live.
  • BagTrace is the airport staff app. Register found bags, match them to reports, verify the owner, and arrange the return.

The two apps have separate databases and never call each other. Everything they share travels as RabbitMQ messages, so either app can go offline and catch up when it comes back.

SkyBook: the passenger answers an ownership question BagTrace: staff review ranked matches
SkyBook report page with an ownership question, a timeline and live notifications BagTrace list of found bags, each with a match score and the reasons for it

How a bag gets home

sequenceDiagram
    actor P as Passenger
    participant S as SkyBook
    participant B as BagTrace
    actor A as Airport staff

    P->>S: Reports a lost bag
    S-->>B: LostBagReported
    A->>B: Selects a matching found bag
    B-->>S: VerificationRequested
    P->>S: Answers the ownership question
    S-->>B: VerificationAnswered
    A->>B: Confirms the owner
    B-->>S: LostReportStatusChanged
    P->>S: Chooses home delivery
    S-->>B: CollectionMethodChosen
    A->>B: Prices the delivery
    B-->>S: DeliveryQuoteIssued
    P->>S: Pays
    S-->>B: DeliveryPaymentCompleted
    A->>B: Dispatches and delivers the bag
    B-->>S: DeliveryStatusChanged
    P->>S: Confirms the bag arrived
    S-->>B: DeliveryReceiptConfirmed
Loading

Dashed arrows are RabbitMQ messages. Passengers can also collect the bag at the airport for free. The message catalogue lists every message.

Architecture

flowchart LR
    S["<b>SkyBook</b><br/>SkyBookDb"]
    B["<b>BagTrace</b><br/>BagTraceDb"]
    S -->|outbox| SE{{skybook.events}} --> BQ[[bagtrace.inbox]] --> B
    B -->|outbox| BE{{bagtrace.events}} --> SQ[[skybook.inbox]] --> S
Loading

The messaging layer is written directly on RabbitMQ.Client, without a framework such as MassTransit. It handles the usual ways messages get lost or repeated:

Problem Solution
The app crashes after saving but before publishing Transactional outbox: the message is saved in the same transaction as the data, then published in the background
The same message arrives twice Idempotent consumer: processed message IDs are stored, and repeats are skipped
A handler fails Delayed retry: up to 3 retries, 10 seconds apart
A message can never be processed Dead-letter queue: it is set aside for inspection and doesn't block the others
The other app is offline Durable queues: messages wait until it returns

The code is in BaggageRecovery.Messaging. Each app also has an admin Diagnostics page that logs every message sent, received, retried or dead-lettered.

Features

SkyBook

  • Flight search, booking and bag check-in
  • Lost-bag reports with a live timeline and notifications (SignalR)
  • Airport pickup or paid home delivery, through a simulated payment gateway
  • Admin pages for flights, bookings and reports

BagTrace

  • Found-bag registry with photos. Google Gemini can suggest the bag's type, colour, brand and marks, and staff review them before saving
  • Match scores from fixed rules, with the reasons shown. Staff make the final decision
  • Live case dashboard, ownership checks, delivery quotes and courier tracking
  • Reports with charts, plus PDF and Excel export
  • Staff, Manager and Admin roles
More screenshots
SkyBook BagTrace
SkyBook home page with flight search BagTrace operations dashboard
Simulated payment page for home delivery BagTrace operations report

Tech stack

Area Tools
Web ASP.NET Core MVC (.NET 10), Razor, Bootstrap 5, SignalR
Data SQL Server 2022, Entity Framework Core 10, ASP.NET Core Identity
Messaging RabbitMQ 4
Reports and AI Chart.js, QuestPDF, ClosedXML, Google Gemini
Infrastructure Docker Compose, Serilog, health checks

Run it locally

You need Docker Desktop. On Apple Silicon, turn on Use Rosetta for x86_64/amd64 emulation in its settings, because SQL Server needs it.

git clone https://github.com/Adham-Kiwan/baggage-recovery.git
cd baggage-recovery
cp .env.example .env
docker compose up --build

The databases and demo data are created on first start. Photo analysis is optional: to enable it, set GEMINI_API_KEY in .env.

App Address Demo login Password
SkyBook http://localhost:5001 passenger@skybook.local Passenger#2026
BagTrace http://localhost:5002 manager@bagtrace.local Manager#2026
RabbitMQ http://localhost:15672 baggage baggage_dev_pw

These accounts exist only in your local copy. For the Diagnostics pages, sign in as admin@skybook.local or admin@bagtrace.local with Admin#2026.

Try it

  1. In SkyBook, open Lost Bags and report bag SB100001. Enter Samsonite as the brand.
  2. In BagTrace, open the new case. Found bag FB-001 is the top match.
  3. Select it, send an ownership question, and watch it appear in SkyBook without a refresh.
  4. To see the queue at work, run docker compose stop bagtrace and answer the question in SkyBook. Then run docker compose start bagtrace, and the answer arrives.
Run the apps with the .NET SDK instead

With the .NET 10 SDK installed, run only SQL Server and RabbitMQ in Docker:

docker compose up -d sqlserver rabbitmq
dotnet run --project src/SkyBook/SkyBook.Web

In a second terminal, start BagTrace with the SQL Server password from .env:

export ConnectionStrings__DefaultConnection='Server=localhost,1433;Database=BagTraceDb;User Id=sa;Password=BaggageRecovery#2026;TrustServerCertificate=True'
dotnet run --project src/BagTrace/BagTrace.Web

Project structure

src/
├── SkyBook/SkyBook.Web                  Passenger app
├── BagTrace/BagTrace.Web                Staff app
└── Shared/
    ├── BaggageRecovery.Contracts        Messages both apps agree on
    └── BaggageRecovery.Messaging        Outbox, consumer, retries, dead-lettering

More detail: message catalogue · SkyBook integration guide · design decisions · project plan · development workflow with Claude Code

Authors

Built for a university Advanced Programming course.

About

Airport Lost Baggage & Recovery: SkyBook + BagTrace, two ASP.NET Core MVC apps communicating via RabbitMQ

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0