How aws-samples/aws-serverless-airline-booking works
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.
Components 16
Client/UI
Browser application and user-facing integration points
- Browser SPA · Single-page airline booking application
- Vue App · Vue.js and Quasar presentation layer
- Amplify UI · Authentication and AWS integration support in the client
- Stripe JS · Card collection and tokenization in the browser
API/Security
GraphQL entry point and identity boundary
- Cognito · Issues JWTs for signed-in users
- AppSync · Central application API and resolver hub
- GraphQL Schema · Primary API contract for booking, catalog, and loyalty data
Domain Services
Catalog, booking, payment, and loyalty capabilities
- Catalog · Search and catalog operations, largely resolver-driven
- Booking API · Creates and lists bookings
- Booking Flow · Python booking workflow coordinating payment and loyalty
- Payment · Payment authorization, capture, and refund boundary
- Loyalty · Customer points and tier management
Platform/Integrations
Workflow, messaging, persistence, and external providers
- DynamoDB · Backing store for application domain data
- Step Functions · Stateful orchestration for booking business process
- SNS · Asynchronous service-to-service messaging
- Stripe · External card processing integration
Connections 19
- 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