# aws-samples/aws-serverless-airline-booking architecture

> Architecture diagram of the GitHub repository aws-samples/aws-serverless-airline-booking, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-samples/aws-serverless-airline-booking
- Repository: https://github.com/aws-samples/aws-serverless-airline-booking

## Overview

This repository is an AWS serverless reference application for airline booking. Its architecture is centered on a Vue.js web client backed by AWS-managed serverless services, with GraphQL used as the main application API and a small REST surface for payment and loyalty integration.

1. Client/UI boundary  
The front end is a browser-based single-page app built with Vue.js and Quasar. It uses Amplify for authentication UI and AWS integration, and Stripe JS/Elements for card collection and tokenization. The client talks primarily to AppSync for application data and to payment-related endpoints where needed.

2. Identity and access control  
Amazon Cognito issues JWTs for signed-in users. Those tokens are consumed by AppSync to enforce fine-grained authorization at the GraphQL type/field level. This is the main security boundary for user access to booking, catalog, and loyalty data.

3. Primary API layer  
AWS AppSync is the central API hub. It exposes the GraphQL schema for the application and coordinates access to the underlying services and data stores. In this architecture, AppSync is not just a gateway; it also owns much of the data access pattern through GraphQL types and resolvers.

4. Catalog subsystem  
The Catalog service provides flight search and related CRUD-style operations. The README indicates it is largely driven by Apache VTL and that Amplify auto-generates CRUD operations and custom indexes. This subsystem is the read-heavy discovery side of the application and feeds the booking flow.

5. Booking subsystem  
Booking is the core transactional service. It supports creating and listing bookings, but the business workflow itself is implemented in Python rather than in GraphQL mapping templates alone. This is the main orchestration boundary where flight selection, payment, and loyalty updates are coordinated.

6. Payment subsystem  
Payment is exposed as a REST-based service, not GraphQL, to model integration with an external provider and to demonstrate service-to-service security. It handles authorization, collection, and refund. Much of the Stripe integration is packaged through a Serverless Application Repository app, while booking-driven payment operations are implemented in Python.

7. Loyalty subsystem  
Loyalty is a separate service written in TypeScript and also exposed as REST. It manages customer points and tiers. The README calls out that it demonstrates secure internal communication while still presenting a public endpoint, so it is a distinct service boundary rather than simply a GraphQL type.

8. Workflow orchestration and messaging  
The booking business process is coordinated through Step Functions, which makes the booking flow a stateful orchestration rather than a single request/response handler. SNS is used for asynchronous service-to-service communication, especially between Booking and Loyalty. This creates an event-driven edge between the transactional booking flow and the rewards subsystem.

9. Data model and persistence  
The domain is modeled around GraphQL types and stored in DynamoDB. That means the schema is the primary contract for the data model, while DynamoDB is the backing store for the serverless data layer. AppSync resolvers and service code mediate access rather than a traditional monolithic database API.

10. Language/runtime split  
The stack is polyglot by service role: Python for most backend business logic, TypeScript for Loyalty, and JavaScript for the front end. Catalog uses Apache VTL for schema/resolver behavior, and Payment includes YAML plus Python. This split matters architecturally because it reinforces service ownership by concern, not by one shared runtime.

11. Integration and external services  
Stripe is the main external payment integration. AWS Amplify is used on the client side for auth and AWS connectivity, while AWS Cognito, AppSync, DynamoDB, Step Functions, and SNS form the internal cloud backbone. These services define the main trust and communication boundaries in the system.

12. Delivery and verification  
The README explicitly mentions end-to-end testing and CI/CD as part of the sample application. That suggests the project was designed to be deployable as an integrated cloud system, not just as isolated services. The repository itself is currently a reference snapshot; the README points to the archive branch for the former code and to docs for deployment.

If you are drawing an architecture diagram, the key flows are: browser client → Cognito/AppSync → DynamoDB-backed services for catalog and booking; booking workflow → Step Functions → payment and loyalty interactions; loyalty/payment → REST endpoints; and booking → SNS → loyalty for asynchronous reward updates.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client/UI"]
  node_browser(("Browser SPA<br/>web client"))
  node_vue_quasar["Vue App<br/>frontend UI"]
  node_amplify_ui["Amplify UI<br/>auth/integration UI"]
  node_stripe_js["Stripe JS<br/>payment client"]
end

subgraph group_api["API/Security"]
  node_cognito[("Cognito<br/>identity provider")]
  node_appsync{{"AppSync<br/>GraphQL API"}}
  node_graphql_schema["GraphQL Schema<br/>domain contract"]
end

subgraph group_services["Domain Services"]
  node_catalog["Catalog<br/>flight discovery"]
  node_booking_api["Booking API<br/>booking service"]
  node_booking_flow{{"Booking Flow<br/>orchestration"}}
  node_payment["Payment<br/>REST service"]
  node_loyalty["Loyalty<br/>REST service"]
end

subgraph group_platform["Platform/Integrations"]
  node_dynamodb[("DynamoDB<br/>data store")]
  node_step_functions{{"Step Functions<br/>workflow engine"}}
  node_sns["SNS<br/>event bus"]
  node_stripe["Stripe<br/>external payment provider"]
end

node_browser -->|"loads app"| node_vue_quasar
node_vue_quasar -->|"auth UI"| node_amplify_ui
node_vue_quasar -->|"collects card"| node_stripe_js
node_vue_quasar -->|"graphql"| node_appsync
node_cognito -->|"jwt auth"| node_appsync
node_appsync -->|"exposes"| node_graphql_schema
node_graphql_schema -->|"resolves"| node_catalog
node_graphql_schema -->|"resolves"| node_booking_api
node_catalog -->|"reads/writes"| node_dynamodb
node_booking_api -->|"starts"| node_booking_flow
node_booking_flow -->|"orchestrates"| node_step_functions
node_step_functions -->|"calls"| node_payment
node_step_functions -->|"calls"| node_loyalty
node_step_functions -->|"persists"| node_dynamodb
node_booking_flow -->|"publishes"| node_sns
node_sns -->|"notifies"| node_loyalty
node_payment -->|"integrates"| node_stripe
node_payment -->|"records"| node_dynamodb
node_loyalty -->|"records"| node_dynamodb

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser,node_vue_quasar,node_amplify_ui,node_stripe_js toneBlue
class node_cognito,node_appsync,node_graphql_schema toneAmber
class node_catalog,node_booking_api,node_booking_flow,node_payment,node_loyalty toneMint
class node_dynamodb,node_step_functions,node_sns,node_stripe toneRose
```

## Components

### Client/UI

Browser application and user-facing integration points

- **Browser SPA**: web client · Single-page airline booking application
- **Vue App**: frontend UI · Vue.js and Quasar presentation layer
- **Amplify UI**: auth/integration UI · Authentication and AWS integration support in the client
- **Stripe JS**: payment client · Card collection and tokenization in the browser

### API/Security

GraphQL entry point and identity boundary

- **Cognito**: identity provider · Issues JWTs for signed-in users
- **AppSync**: GraphQL API · Central application API and resolver hub
- **GraphQL Schema**: domain contract · Primary API contract for booking, catalog, and loyalty data

### Domain Services

Catalog, booking, payment, and loyalty capabilities

- **Catalog**: flight discovery · Search and catalog operations, largely resolver-driven
- **Booking API**: booking service · Creates and lists bookings
- **Booking Flow**: orchestration · Python booking workflow coordinating payment and loyalty
- **Payment**: REST service · Payment authorization, capture, and refund boundary
- **Loyalty**: REST service · Customer points and tier management

### Platform/Integrations

Workflow, messaging, persistence, and external providers

- **DynamoDB**: data store · Backing store for application domain data
- **Step Functions**: workflow engine · Stateful orchestration for booking business process
- **SNS**: event bus · Asynchronous service-to-service messaging
- **Stripe**: external payment provider · External card processing integration

## Connections

- Browser SPA → Vue App: loads app · Browser hosts the Vue/Quasar single-page app
- Vue App → Amplify UI: auth UI · Client uses Amplify for sign-in and AWS wiring
- Vue App → Stripe JS: collects card · Client tokenizes payment details with Stripe JS
- Vue App → AppSync: graphql · Primary application data access through AppSync
- Cognito → AppSync: jwt auth · JWTs are consumed by AppSync for authorization
- AppSync → GraphQL Schema: exposes · AppSync serves the application GraphQL contract
- GraphQL Schema → Catalog: resolves · Catalog data is modeled and resolved through GraphQL types
- GraphQL Schema → Booking API: resolves · Booking operations are exposed through the GraphQL API
- Catalog → DynamoDB: reads/writes · Catalog data is backed by DynamoDB
- Booking API → Booking Flow: starts · Booking API hands off to the booking workflow
- Booking Flow → Step Functions: orchestrates · State machine coordinates the booking business process
- Step Functions → Payment: calls · Workflow invokes payment operations
- Step Functions → Loyalty: calls · Workflow updates loyalty state
- Step Functions → DynamoDB: persists · Booking state and domain data land in DynamoDB
- Booking Flow → SNS: publishes · Booking emits events for async consumers
- SNS → Loyalty: notifies · SNS carries booking events to loyalty
- Payment → Stripe: integrates · Payment service delegates to Stripe
- Payment → DynamoDB: records · Payment and booking records are stored in DynamoDB
- Loyalty → DynamoDB: records · Loyalty points and tiers are stored in DynamoDB
