How dinhduongdev/flight-booking-management works
Project Overview
• This is a full-stack web application focused on flight management and booking. The backend (built using Flask with blueprints for modularity) handles user authentication (including Google OAuth), flight information management, booking/reservation processing, administrative tasks, and integration with third-party services like VNPay for payments and Cloudinary for avatar management.
• The project emphasizes distinct roles for admins, flight managers, sales staff, and customers, as well as system processes for notifications and emails.
Main Components
• Client/Frontend: Though the project uses server-rendered templates rather than a separate frontend directory, it makes heavy use of HTML, CSS (including bootstrap, custom CSS files), and JavaScript (custom scripts for booking, home, search, etc.). Represent this as the “User Interface” or “Web Browser Client” that interacts with the server.
• Backend Application Server: This is the Flask application located under the “backend/app” folder. Divide this further according to the major blueprints:
• Admin: For administrative tasks (flight management, dashboard, regulation changes).
• Auth: For login, signup, reset password, and Google OAuth integration.
• Bookings: For flight reservations, seat management, and VNPay payment integration.
• Flights: For flight schedule management and search functionality.
• Main: For the general user views like home and about pages.
• Errors: For error handling.
• Database Layer: The README describes an initialization process with a MySQL database. Represent this as a “Database” component interacting with the backend.
• External Services:
• Payment Gateway (VNPay): Used to handle flight reservation payments.
• Authentication/Third-party (Google OAuth): Used for user signups and logins.
• Cloudinary: For managing user avatars.
• Email Service: For token-based password resets and notifications.
• Containerization/Deployment: With Docker (Dockerfile in the backend and docker-compose file), include a “Container/Infrastructure” component, indicating that the app can be deployed in a containerized environment.
Relationships and Data Flow
• Interactions from the backend to external services:
• Outbound calls for Google OAuth authentication.
• Integration with VNPay for payment processing.
• Communication with Cloudinary when randomizing user avatars.
• Outbound email notifications.
• That containerization (Docker) encapsulates the backend and perhaps even the database, indicating deployment aspects.
Architectural Patterns & Design Principles
• Modular Architecture: Represent the multiple blueprints within Flask (admin, auth, bookings, flights, main, errors). This indicates separation of concerns.
• MVC-like Separation: Though not strictly MVC, the separation of templates (views), static files, and business logic (Flask blueprints/routes) should be represented.
• Integration Patterns: Highlight external integrations via clearly labeled connections.
• Clear labels for each component:
• Web Client (Browser)
• Flask Application (with modular blueprints: Admin, Auth, Bookings, Flights, Main, Errors)
• MySQL Database
• External Services (VNPay, Google OAuth, Cloudinary, Email Service)
• Docker Container/Infrastructure (if depicting deployment)
• User requests from browser to backend and responses back.
• Data interactions between the backend and the database.
• Backend outbound REST/API calls to payment gateways and third-party authentication.
• Rectangles for application components.