flight_booking_bff
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| flight_booking_bff [2025/12/31 09:53] – [Recommended Placement] pradnya | flight_booking_bff [2026/01/24 05:44] (current) – [Error Handling Strategy] madan | ||
|---|---|---|---|
| Line 15: | Line 15: | ||
| ==== Key Services / Core Components ==== | ==== Key Services / Core Components ==== | ||
| - | ^Service^Responsibility| | + | ^Service^Responsibility^Local Port| |
| - | |**API Gateway / BFF (Node.js)** |Single entry point for UI| | + | |**API Gateway / BFF (Node.js)** |Single entry point for UI|4000| |
| - | |**Auth Service** |Issues & validates tokens| | + | |**Auth Service** |Issues & validates tokens|4001| |
| - | |**Flight Service** |Calls supplier API + Redis cache| | + | |**Flight Service** |Calls supplier API + Redis cache|4002| |
| - | |**Booking Service (MySQL)** |Stores booking data| | + | |**Booking Service (MySQL)** |Stores booking data|4003| |
| - | |**Payment Service** |Payment initiation + webhooks| | + | |**Payment Service** |Payment initiation + webhooks|4004| |
| ==== Observability Stack ==== | ==== Observability Stack ==== | ||
| Line 74: | Line 75: | ||
| ^Layer^Purpose^Examples^Should define errors?| | ^Layer^Purpose^Examples^Should define errors?| | ||
| |**Domain** |Business rules|Entities, | |**Domain** |Business rules|Entities, | ||
| - | |**Application** |Use-cases / orchestration|Services, | + | |**Domain/Application** |Use-cases / orchestration|Services, |
| |**Infrastructure** |Technical adapters|DB, | |**Infrastructure** |Technical adapters|DB, | ||
| |**Interface/ | |**Interface/ | ||
| Line 99: | Line 100: | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| ===== MySQL — Connection Pool ===== | ===== MySQL — Connection Pool ===== | ||
| Line 506: | Line 510: | ||
| ^Code^Meaning| | ^Code^Meaning| | ||
| - | |400|validation failure| | + | |400|Bad Request/validation failure| |
| |401|unauthorized| | |401|unauthorized| | ||
| |404|cache expired| | |404|cache expired| | ||
| Line 590: | Line 594: | ||
| ===== Error Flow (Best Practice) ===== | ===== Error Flow (Best Practice) ===== | ||
| - | < | + | < |
| - | ⬇ wrap / map \\ | + | Infrastructure error |
| - | Application error \\ | + | ⬇ wrap / map |
| - | ⬇ serialized to client | + | Application error |
| - | HTTP response | + | ⬇ serialized to client |
| + | HTTP response | ||
| </ | </ | ||
| Line 600: | Line 605: | ||
| final structure should look like | final structure should look like | ||
| - | < | + | < |
| - | ┣ / | + | /src |
| - | | + | ┣ /domain |
| - | ┣ / | + | |
| - | | + | ┣ / |
| - | ┣ / | + | |
| - | | + | ┣ / |
| - | ┗ / | + | |
| - | ┗ error-middleware.ts | + | ┗ /api (interfaces) |
| + | ┗ error-middleware.ts | ||
| </ | </ | ||
| Line 617: | Line 623: | ||
| → couples business logic to technology | → couples business logic to technology | ||
| - | Throwing raw DB/Redis errors upward \\ | + | Throwing raw DB/Redis errors upward\\ |
| → leaks internal details | → leaks internal details | ||
| - | Mixed styles (sometimes returning strings, sometimes errors) \\ | + | Mixed styles (sometimes returning strings, sometimes errors)\\ |
| → debugging nightmare | → debugging nightmare | ||
flight_booking_bff.1767174823.txt.gz · Last modified: by pradnya
