Skip to content

Latest commit

Β 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎟 TicketMe

A serverless Event Registration & Ticketing System, built entirely on AWS.

πŸ”— Live Demo: https://d24m8nf71z49d9.cloudfront.net

Table of Contents

Overview

TicketMe replaces manual, spreadsheet-based event registration workflows with a fully serverless, cloud-native REST API and web application. It handles event discovery, registration, duplicate/capacity prevention, cancellation, email confirmations and real-time monitoring, all without managing a single server.

The Problem

Organizations commonly manage event signups through Microsoft Forms feeding into Excel spreadsheets. This approach:

  • Doesn't scale past a handful of events or attendees
  • Has no real-time capacity enforcement, overbooking is common
  • Allows duplicate registrations with no automated prevention
  • Provides no automated confirmations or notifications
  • Offers zero operational visibility (no logs, no alerts, no monitoring)

The Solution

A serverless system where:

  • Events and registrations live in DynamoDB, not spreadsheets
  • Business logic runs in AWS Lambda, scaling automatically with demand and costing nothing when idle
  • API Gateway exposes a clean REST API consumed by a modern frontend
  • SNS sends automated registration confirmations
  • CloudWatch monitors error rates in real time and alerts via SNS if they exceed 5%
  • AWS Budgets guards against unexpected cost
  • The entire system is defined as code (Terraform) and deployed via a tested, automated CI/CD pipeline (GitHub Actions)

Architecture

TicketMe Architecture Diagram

See docs/architecture/ for the full architecture writeup and data model.

Tech Stack

Layer Technology
Cloud Provider AWS
Compute AWS Lambda (Python 3.12)
API Amazon API Gateway (REST)
Database Amazon DynamoDB
Notifications Amazon SNS
Monitoring Amazon CloudWatch (Logs, Metric Alarms)
Cost Control AWS Budgets
Infrastructure as Code Terraform
CI/CD GitHub Actions
Frontend Vanilla JavaScript (ES Modules), CSS3, HTML5
Hosting Amazon S3 + CloudFront (CDN, HTTPS)
Testing pytest, moto (AWS mocking)

Features

  • Browse, search, and filter live events
  • Register for events with real-time validation
  • Duplicate registration prevention (per email + event)
  • Capacity enforcement using atomic, race-condition-safe DynamoDB updates
  • View and cancel registrations by email
  • Skeleton loading states, toast notifications, empty/error states
  • Dark/light theme toggle
  • Least-privilege IAM, a dedicated role per Lambda function
  • CloudWatch error-rate alarms (metric math: errors Γ· invocations)
  • AWS Budgets cost-tracking safety net
  • Fully automated CI: unit tests + Terraform validation on every push/PR

Screenshots

Application

Events Registration My Registrations
Events Registration My Registrations

Infrastructure (Terraform-provisioned)

DynamoDB Lambda API Gateway
DynamoDB Lambda API Gateway

Monitoring & CI/CD

CloudWatch Alarms SNS Topics AWS Budget
Alarms SNS Budget
GitHub Actions CI Test Results
CI Tests

Project Structure

ticketme/ β”œβ”€β”€ backend/ β”‚ └── lambda/ β”‚ β”œβ”€β”€ list_events_handler/ β”‚ β”œβ”€β”€ register_handler/ β”‚ β”œβ”€β”€ get_registrations_handler/ β”‚ β”œβ”€β”€ cancel_registration_handler/ β”‚ └── shared/ # response_utils, logger, validators β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ index.html β”‚ β”œβ”€β”€ css/ # design system, components, animations β”‚ └── js/ β”‚ β”œβ”€β”€ api.js # centralized API client β”‚ β”œβ”€β”€ router.js # hash-based SPA router β”‚ β”œβ”€β”€ state.js β”‚ β”œβ”€β”€ views/ # events, registrations β”‚ └── components/ # eventCard, modal, toast β”œβ”€β”€ infrastructure/ # Terraform: DynamoDB, IAM, Lambda, β”‚ # API Gateway, S3, CloudFront, SNS, β”‚ # CloudWatch alarms, AWS Budgets β”œβ”€β”€ tests/ # pytest + moto unit tests β”œβ”€β”€ scripts/ # build & deploy automation β”œβ”€β”€ docs/ β”‚ β”œβ”€β”€ architecture/ β”‚ β”œβ”€β”€ api/ β”‚ β”œβ”€β”€ screenshots/ β”‚ └── deployment-guide.md β”œβ”€β”€ presentation/ └── .github/workflows/ # CI: backend tests, Terraform validate

Getting Started

Full step-by-step setup instructions are in docs/deployment-guide.md. Summary:

# Clone
git clone https://github.com/Fiber-dunstan/TICKETME.git
cd TICKETME

# Backend: set up Python environment
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt

# Run tests
pytest tests/ -v

# Deploy infrastructure
cd infrastructure
terraform init
terraform apply

# Seed sample data
cd ..
python scripts/seed_events.py

# Deploy frontend
.\scripts\deploy_frontend.ps1

Testing

14 unit tests cover all 4 Lambda functions, happy paths and every failure branch (validation errors, missing resources, duplicates, capacity limits) using moto to simulate AWS services in-memory, with zero cost and no real AWS calls.

pytest tests/ -v

CI/CD Pipeline

Two GitHub Actions workflows run automatically:

  • backend-tests.yml runs the full pytest suite on every push/PR to main/develop
  • terraform-validate.yml checks Terraform formatting and validity on every change to infrastructure/

Branch protection on main requires both checks to pass before a merge is allowed, a genuine automated quality gate, not just advisory.

Branching strategy: main (stable) ← develop (integration) ← feature/* branches, via Pull Requests.

Monitoring & Security

  • Least-privilege IAM: each Lambda has its own role with only the exact permissions it needs
  • Input validation & sanitization on every write endpoint
  • CloudWatch Logs for every function, with 14-day retention (cost control)
  • CloudWatch Alarms: error rate (errors Γ· invocations) monitored per function, alerting via SNS if it exceeds 5%
  • AWS Budgets: monthly spend alerts at 80% actual / 100% forecasted

Cost Optimization

  • DynamoDB PAY_PER_REQUEST billing no idle cost
  • Lambda pay only per invocation, generous AWS Free Tier
  • CloudWatch Log Groups with explicit 14-day retention (prevents unbounded log storage cost)
  • CloudFront PriceClass_100 cheapest tier, sufficient edge coverage
  • AWS Budgets as an explicit safety net

Lessons Learned

A few real debugging challenges worth highlighting (detailed in docs/troubleshooting.md):

  • Python module-name collisions across Lambda handlers during testing
  • DynamoDB reserved keywords (capacity, status) requiring ExpressionAttributeNames
  • API Gateway CORS preflight requiring explicit passthrough_behavior
  • API Gateway not reliably URL-decoding path parameters, solved with explicit unquote()
  • Git branching discipline the practical cost of merging into the wrong base branch, and how consistent git status checks and gh pr create --base develop solved it for good

Future Improvements

  • Single-table DynamoDB design for reduced read/write costs at scale
  • Cognito-based authentication for an admin dashboard
  • QR code ticket generation and PDF ticket download
  • Event-attendance forecasting using historical registration data (ML-ready architecture)
  • Custom domain + ACM certificate for the CloudFront distribution
  • Terraform remote state (S3 backend + DynamoDB locking) for team collaboration
  • Per-user registration confirmation emails via Amazon SES (SNS's static-subscriber model only supports notifying a fixed operator address, not dynamic per-registrant recipients)

Documentation

Author

Dunstan Banyaa Built as a capstone project for the Azubi Africa AWS Cloud & AI Intensive Program.

License

None Selected

About

TicketMe is a fully serverless event registration and ticketing platform built entirely on AWS. It replaces manual Microsoft Forms + Excel workflows with an automated REST API (API Gateway + Lambda + DynamoDB) featuring real-time capacity enforcement, duplicate prevention, and automated notifications via SNS.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages