How trinadhreddy1184/movie-booking-site-using-flask works
Main Components
• Frontend: Represented by the HTML templates (found in the “template” folder) and static assets (CSS, JavaScript, images in the “static” folder). This is the layer that the end user interacts with via a web browser.
• Backend: The core Flask application. The entry points are “wsgi.py” (used for deployment) and “application.py” (contains application logic, routes, and integration with external APIs). This component is responsible for receiving HTTP requests from the client, processing business logic, and interacting with other services.
• Database: An external MySQL database service hosted on AWS RDS. This is where user data, movie details, and booking information are stored. Include notes about the schema tables for users, movies, recommended movies, and booking details.
• External Services:
• Email Service: Integrated via Flask-Mail, which is configured in "application.py". This uses Gmail for sending OTPs and booking details, so show the bidirectional communication between the backend and the Gmail server.
• SMS Service: The Fast2sms API is used to send phone OTPs. Represent this as an external SMS gateway that the backend communicates with.
Roles and Interactions Between Components
• Request Handling: The Flask application (backend) receives these requests from the client, processes them (e.g., login, booking, OTP generation) and communicates with the database, email server, and fast2sms API as necessary.
• Database Communication: Represent the communication between the backend and AWS RDS, including queries for managing user data, movie details, and booking records.
• External API Interaction: Show outgoing connections from the backend to external APIs for sending emails and SMS.
Architectural Patterns & Key Design Principles
• Separation of Concerns: The design naturally separates the presentation (HTML templates, CSS/JS files), application logic (Flask application in application.py), and data persistence (AWS RDS).
• Deployment Abstraction: Emphasize that the use of “wsgi.py” alongside deployment on AWS Elastic Beanstalk abstracts away server initialization details.
• Integration Points: Highlight how external services (Gmail and Fast2sms) are integrated and note that these require manual configuration (as described in the README).
Detailed Component Breakdown
• Frontend Layer:
• HTML Templates (located in /template)
• CSS/JS and images (located in /static)
• Application Layer:
• application.py (contains the main booking and user authentication flows)
• wsgi.py (used for deployment via Elastic Beanstalk)
• Requirements.txt (lists dependencies, including Flask, Flask-Mail, etc.)
• Data Management:
• AWS RDS represents a remotely hosted MySQL database.
• Database schemas (Userdata, movies, recommended_movies, booking) as referenced in the README.
• External Service Integrations:
• Gmail configuration for sending OTPs and booking confirmations.
• Fast2sms API integration for phone OTPs.
• Deployment:
• AWS Elastic Beanstalk is used for the production deployment environment.