Movie Magic – Smart Movie Ticket Booking System
Project Description:
In many cities, moviegoers face fragmented booking experiences across multiple platforms, leading
to confusion over seat availability and missed showtimes. The lack of personalized features and real-
time updates often disrupts the excitement of planning a cinematic outing.
To solve this, a cloud-based Movie Booking Platform was developed using Flask for backend
development, AWS EC2 for hosting, and DynamoDB for real-time data management. The system
allows users to browse movie listings, securely register/login, select seats in real time, and complete
bookings smoothly. Designed to support future scalability, the platform lays the foundation for
integrating multiple theaters, payment gateways, and personalized recommendations. IAM ensures
role-based access control, and error resilience is achieved with robust transaction handling logic.
This modern solution enhances convenience for users and operational efficiency for theaters by
streamlining the entire booking experience into a single, cloud-native interface.
Scenario 1: Real-Time Seat Selection for Moviegoers
The Movie Booking Platform utilizes AWS EC2 to provide a highly available backend infrastructure,
handling multiple users exploring seat layouts concurrently. For instance, a user logs in, navigates to
a movie listing, and views a live seating chart for a specific showtime. Flask orchestrates backend
logic to lock seats momentarily while the user completes selection. DynamoDB leverages
conditional writes to prevent double booking during peak hours, allowing real-time updates to be
reflected instantly across users' screens. The responsive experience ensures high satisfaction and
prevents booking conflicts.
Scenario 2: Secure User Registration and Booking Flow
The platform ensures secure onboarding via IAM-based policies and Flask-authenticated login
flows. For example, a new user signs up, browses current movies, selects available seats, and
confirms the booking—all within an intuitive interface. AWS DynamoDB stores session data and
ticket status, enabling persistent and fast retrieval for future interactions. IAM manages role-based
permissions, separating administrative operations from user-level access. The booking flow
validates payment readiness and ensures transaction resilience, minimizing failure points during
confirmation.
Scenario 3: Theater Efficiency and Backend Resilience
The movie theater benefits from streamlined operations with minimal manual coordination. Admins
can log in to update movie schedules, track seat occupancy, and analyze booking trends. Flask
handles these backend operations, while EC2 provides reliable deployment support for
simultaneous user access. DynamoDB enables fast queries about occupancy rates and movie
popularity. Real-time insights from the data allow theaters to optimize show timings and predict
demand. The seat selection mechanism ensures concurrency-safe
updates, avoiding overbooking during high-traffic periods.
AWS ARCHITECTURE
Entity Relationship (ER)Diagram:
Pre-requisites:
1. .AWS Account Setup: AWS Account Setup
2. Understanding IAM: IAM Overview
3. Amazon EC2 Basics: EC2 Tutorial
4. DynamoDB Basics: DynamoDB Introduction
5. SNS Overview: SNS Documentation
6. Git Version Control: Git Documentation
Project WorkFlow:
1. AWS Account Setup and Login
Activity 1.1: Create an AWS account at [Link].
Activity 1.2: Log in to the AWS Management Console
2. DynamoDB Database Creation and Setup
Activity 2.1: Create a table Movie_Bookings, Partition Key: id
Activity 2.2: Create a table Movie_Users, Partition Key: email
3. SNS Notification Setup
Activity 3.1: Create SNS topics for movie bookings
Activity 3.2: Subscribe users to SNS email notifications, You will get SNS_TOPIC_ARN.
sns_topic_arn = 'arn:aws:sns:us-east-1:605134439175:MovieMagicNotifications:259e3be3-5864-
4985-ab9d-edfc09ca6300'
4. Backend Development and Application Setup
Activity 4.1:Develop the Backend Using Flask.
Activity 4.2: Integrate AWS Services Using boto3.
5. IAM Role Setup
Activity 5.1: Create IAM Role
Activity 5.2: Attach Policies
SNSFullAccess, DynamoDBFullAccess, EC2FullAccess
6. EC2 Instance Setup
Activity 6.1: Launch an EC2 instance to host the Flask application.
Activity 6.2: Configure security groups for HTTP, and SSH access.
7. Deployment on EC2
Activity 7.1:Upload Flask Files
Activity 7.2: Run the Flask App
Testing and Deployment
Activity 8.1: Conduct functional testing to verify user registration, login, book requests, and
notifications.
Milestone 1: AWS Account Setup and Login
● Activity 1.1: Set up an AWS account if not already done.
0 Sign up for an AWS account and configure billing settings.
● Activity 1.2: Log in to the AWS Management Console
0 After setting up your account, log in to the AWS Management Console.
Milestone 2: DynamoDB Database Creation and Setup
● Activity 2.1:Navigate to the DynamoDB
0 In the AWS Console, navigate to DynamoDB and click on create tables.
○
● Activity 2.2:Create a DynamoDB table for storing registration details and book
requests.
0 Create Users table with partition key “Email” with type String and click on
create tables.
○ Follow the same steps to create a requests table with Email as the primary key
for book requests data.
Milestone 3: SNS Notification Setup
● Activity 3.1: Create SNS topics for sending email notifications to users and
library staff.
0 In the AWS Console, search for SNS and navigate to the SNS Dashboard.
○ Click on Create Topic and choose a name for the topic.
○ Choose Standard type for general notification use cases and Click on Create
Topic.
○ Configure the SNS topic and note down the Topic ARN.
● Activity 3.2: Subscribe users and staff to relevant SNS topics to receive real-time
notifications when a book request is made.
0 Subscribe users (or admin staff) to this topic via Email. When a book request
is made, notifications will be sent to the subscribed emails.
○ After subscription request for the mail confirmation
○ Navigate to the subscribed Email account and Click on the confirm subscription in the
AWS Notification- Subscription Confirmation mail.
○ Successfully done with the SNS mail subscription and setup, now store the ARN link.
Milestone 4:Backend Development and Application Setup
● Activity 4.1: Develop the backend using Flask
○ File Explorer Structure
Description: set up the INSTANT LIBRARY project
with an [Link] file, a static/ folder for assets, and a templates/ directory containing
all required HTML pages like home, login, register, subject-specific pages (e.g.,
computer_science.html, data_science.html), and utility pages (e.g., request-
[Link], [Link]).
Description of the code :
● Flask App Initialization
Description: import essential libraries including Flask utilities for routing, Boto3 for
DynamoDB operations, SMTP and email modules for sending mails, and Bcrypt for
password hashing and verification
Description: initialize the Flask application instance using Flask(__name__) to start building
the web app.
● Dynamodb Setup:
Description: initialize the DynamoDB resource for the ap-south-1 region and set up access to the
Users and Requests tables for storing user details and book requests.
● SNS Connection
Description: Configure SNS to send notifications when a book request is submitted. Paste your
stored ARN link in the sns_topic_arn space, along with the region_name where the SNS topic is
created. Also, specify the chosen email service in SMTP_SERVER (e.g., Gmail, Yahoo, etc.) and
enter the subscribed email in the SENDER_EMAIL section. Create an ‘App password’ for the email
ID and store it in the SENDER_PASSWORD section. ● Routes for Web Pages
● Home Route:
Description: define the home route / to automatically redirect users to the register
page when they access the base URL.
● Register Route:
Description: define /register route to validate registration form fields, hash the user
password using Bcrypt, store the new user in DynamoDB with a login count, and send an
SNS notification on successful registration
● login Route (GET/POST):
Description: define /login route to validate user credentials against DynamoDB, check the
password using Bcrypt, update the login count on successful authentication, and redirect users
to the home page
● Home, E- book buttons and subject routes:
Description: define /home-page to render the main homepage, /ebook-buttons to handle
subject selection and redirection, and /<subject>.html dynamic route to render subject-
specific pages like Mathematics or English.
● Request Routes:
●
Description: define /request-form route to capture book request details from users, store the
request in DynamoDB, send a thank-you email to the user, notify the admin, and confirm submission
with a success message.
Exit Route:
Description: define /exit route to render the [Link] page when the user chooses to leave or
close the application.
Deployment Code:
Description: start the Flask server to listen on all network interfaces ([Link]) at port 80 with
debug mode enabled for development and testing.
Milestone 5: IAM Role Setup
● Activity 5.1:Create IAM Role.
○ In the AWS Console, go to IAM and create a new IAM Role for EC2 to interact with
DynamoDB and SNS.
● Activity 5.2: Attach Policies.
Attach the following policies to the role:
● AmazonDynamoDBFullAccess: Allows EC2 to perform read/write operations on DynamoDB.
● AmazonSNSFullAccess: Grants EC2 the ability to send notifications via SNS.
Milestone 6: EC2 Instance Setup
● Note: Load your Flask app and Html files into GitHub repository.
● Activity 6.1: Launch an EC2 instance to host the Flask application.
● Launch EC2 Instance
○ In the AWS Console, navigate to EC2 and launch a new instance.
● Click on Launch instance to launch EC2 instance
● Choose Amazon Linux 2 or Ubuntu as the AMI and [Link] as the instance type (free-tier
eligible).
● Create and download the key pair for Server access.
● Activity 6.2:Configure security groups for HTTP, and SSH access.
● To connect to EC2 using EC2 Instance Connect, start by ensuring that an IAM role is
attached to your EC2 instance. You can do this by selecting your instance, clicking on
Actions, then navigating to Security and selecting Modify IAM Role to attach the
appropriate role. After the IAM role is connected, navigate to the EC2 section in the AWS
Management Console. Select the EC2 instance you wish to connect to. At the top of the
EC2 Dashboard, click the Connect button. From the connection methods presented, choose
EC2 Instance Connect. Finally, click Connect again, and a new browser-based terminal will
open, allowing you to access your EC2 instance directly from your browser.
● Now connect the EC2 with the files
Milestone 7: Deployment on EC2
Activity 7.1: Install Software on the EC2 Instance
Install Python3, Flask, and Git:
On Amazon Linux 2:
sudo yum update -y
sudo yum install python3 git
sudo pip3 install flask boto3
Verify Installations:
flask --version
git --version
Activity 7.2:Clone Your Flask Project from GitHub
Clone your project repository from GitHub into the EC2 instance using Git.
Run: ‘git clone [Link] Note:
change your-github-username and your-repository-name with your credentials
here: ‘git clone [Link] ● This will
download your project to the EC2 instance.
To navigate to the project directory, run the following command:
cd InstantLibrary
Once inside the project directory, configure and run the Flask application by
executing the following command with elevated privileges:
Run the Flask Application
sudo flask run --host=[Link] --port=80
Verify the Flask app is running: [Link]
ip
○ Run the Flask app on the EC2 instance
Access the website through:
PublicIPs: [Link]
Milestone 8: Testing and Deployment
● Activity 8.1: Conduct functional testing to verify user registration, login, book
requests, and notifications.
Login Page:
Register Page:
Home page:
About Us page:
Contact Page:
E-Books page:
Mathematica E-Books Page:
Statistics E-Books Page:
Computer Science E-Books Page:
DataScience E-Books Page:
English E-Books Page:
Request Books Page:
Exit:
Dynamodb Database updations :
1. Users table :
2. Requests table :
3. Mail to the User:
4. Mail to the admin:
Conclusion:
The Instant Library Website for Greenfield University has been successfully developed and deployed
using a robust cloud-based architecture. By leveraging AWS services such as EC2 for hosting,
DynamoDB for data management, and SNS for real-time notifications, the platform ensures reliable
and scalable access to essential library services. This system addresses the challenge of limited
physical resources by providing students with a convenient way to request books and receive timely
updates, while library staff can efficiently manage and track these requests.
The cloud-native approach allows for seamless scalability, ensuring that as student demand
increases, the platform can handle the load without compromising performance. The integration of
Flask with AWS ensures that backend processes, including user authentication and book requests,
run efficiently. The platform's testing phase has ensured that all functionalities, from user
registration to book request notifications, work smoothly.
In conclusion, the Instant Library Website provides a modern, efficient solution for managing
limited library resources, enhancing the overall user experience, and improving communication
between students and library staff. This project is a testament to the potential of cloud-based
systems in addressing real-world challenges in educational institutions.