https://github.com/ahmedheikall/serverless-application
A fully serverless application built on AWS. Users can register for a raffle, view the number of participants, and the system randomly selects 3 winners using AWS Lambda and DynamoDB.
https://github.com/ahmedheikall/serverless-application
api-gateway aws-lambda cloud dynamodb s3 serverless
Last synced: 4 months ago
JSON representation
A fully serverless application built on AWS. Users can register for a raffle, view the number of participants, and the system randomly selects 3 winners using AWS Lambda and DynamoDB.
- Host: GitHub
- URL: https://github.com/ahmedheikall/serverless-application
- Owner: AhmedHeikall
- Created: 2025-09-09T14:12:33.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-12T10:43:57.000Z (9 months ago)
- Last Synced: 2025-09-12T12:31:05.966Z (9 months ago)
- Topics: api-gateway, aws-lambda, cloud, dynamodb, s3, serverless
- Language: HTML
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Serverless Raffle Application


A fully **serverless application** built on **AWS**.
Users can register for a raffle, view the number of participants, and the system randomly selects **3 winners** using AWS Lambda and DynamoDB.
## Features
- **User Registration** (name, email, phone)
- **Count Participants** in real time
- **Random Winner Draw** (3 unique winners)
- **Scalable & Serverless** (no server management)
- **Custom Domain + SSL/TLS** via Route53 + ACM
- **Static Frontend** hosted on S3 + CloudFront
## Architecture Components
- **Amazon API Gateway** – Exposes REST endpoints for frontend → backend integration.
- **AWS Lambda** – Three main functions:
- `apply.js` → Registers participants in DynamoDB.
- `count.js` → Returns number of registered participants.
- `draw.js` → Randomly selects winners and marks them in DynamoDB.
- **Amazon DynamoDB** – Stores participants (email, phone, name, status).
- **Amazon S3 + CloudFront** – Hosts static HTML frontend for users.
- **Amazon Route 53 + ACM** – Custom domain with SSL/TLS certificate.
- **IAM Roles & Policies** – Secure least-privilege access for Lambda & API Gateway.
- **Amazon CloudWatch** – Centralized logging & monitoring for Lambda executions.
User (Browser)
↓
CloudFront (CDN) + S3 (Frontend Hosting)
↓
Route 53 (Custom Domain + SSL/ACM)
↓
API Gateway (REST API)
↓
AWS Lambda Functions
↓
DynamoDB (Participants Table)
↓
CloudWatch (Logs/Monitoring)
## How It Works
1. **User opens the frontend (S3 + CloudFront)** and submits name, email, and phone.
2. **API Gateway → Lambda (apply.js)** stores participant data in DynamoDB (`users_raffle` table).
3. **count.js** returns the number of registered participants.
4. **draw.js** randomly selects **3 winners**, updates their status (`won = yes`), and returns them.
## Achievement
This project demonstrates real-world AWS serverless architecture, combining scalability, cost efficiency, and automation with Lambda, API Gateway, DynamoDB, S3, CloudFront, Route53, IAM, ACM, and CloudWatch.