Movie Web Application Requirements Document Web App Class Ho
Movie Web Application Requirements Document Web App Class Homework 6
You are hired as an intern with Cinemark, a movie theatre chain in USA. Your assignment is to build a web application listing movie information for Cinemark’s customers. Cinemark intends to use this website to market movie information to its moviegoers. Future additions include the use case to buy tickets. This website has two types of users (or roles): customer and admin.
This website should include the following use cases:
- Login: Users can log in to the app, and upon login, are forwarded to the movie list page.
- View list of movies: Users can view a list showing movie images and names, with links to each movie's detailed page, and a link to add a new movie.
- View details of one movie: Users can view detailed information including movie image, trailer from YouTube, and links to update or delete the movie.
- Add data for a new movie: Admins can add new movies and are redirected to the movie list upon submission.
- Update data for one movie: Admins can update movie details and are redirected back to the movie list.
- Delete a movie: Admins can delete a movie entry.
The application is implemented in PHP, with no HTML display needed for the PHP pages. Database tables include movies, users, roles, and tickets, with specified data structures and relationships.
Database tables include:
- Movie: stores id, title, description, director, release year, budget, runtime, rating, genre, trailer link.
- User: stores id, username, password, first name, last name, email, card number, expiration date.
- Role: stores username and role (customer or admin).
- Ticket: stores ticket details linked to movies and users, including quantity, amount, and purchase date.
The site map and sample code snippets are provided for database setup and API endpoints. The application’s core logic includes user authentication, listing movies, viewing details, and CRUD operations for movies, performed via PHP scripts connected to the database.
Paper For Above instruction
Introduction
The development of a comprehensive movie web application for Cinemark aims to streamline the presentation of movie information to its customers and staff. This application leverages PHP for backend processing and MySQL for database management, ensuring an efficient and scalable platform. With core functionalities supporting user roles—customers and administrators—the system provides a versatile interface for browsing movies, viewing detailed information, and managing movie records through CRUD operations. This paper discusses the design, implementation, and security considerations of the application, emphasizing its role in enhancing Cinemark's digital engagement strategy.
Design and Architecture
The application's architecture follows the Model-View-Controller (MVC) paradigm, separating data management, user interface, and business logic. The database schema comprises four primary tables: Movie, User, Role, and Ticket. The Movie table contains attributes such as title, description, director, release year, budget, runtime, rating, genre, and trailer link, aligning with Cinemark's cataloging needs. The User and Role tables facilitate user authentication and role-based access control, critical for ensuring that only authorized personnel can perform administrative functions like adding, updating, or deleting movies. The Ticket table, although for future implementation, links movie and user data for purchase records.
The PHP backend employs scripts that handle database CRUD operations, user authentication, and session management. For instance, the script responsible for movie listing retrieves data from the Movie table and displays it in a structured format. The design prioritizes modularity, security, and ease of maintenance.
Implementation Details
Database Setup
The MySQL database, named 'movie', hosts tables created with a combination of SQL scripts. For example, the Movie table is designed with an auto-incremented primary key and attributes for storing movie-specific information. Sample data entries facilitate testing and demonstration purposes. Proper indexing on fields like 'id' and 'name' optimizes query performance.
PHP Scripts
The core PHP scripts are responsible for managing CRUD operations via AJAX calls or direct form submissions. For example, a script for deleting a movie fetches the movie ID via POST, verifies its existence, and executes a delete query. Similarly, adding and updating movies involve SQL insert and update statements, with validation to prevent SQL injection. Image uploads are handled by moving uploaded files to a server directory and storing their paths in the database.
Security and Authentication
User login functionality verifies credentials against stored hashed passwords (though the sample code mentions plaintext, for production, hashing should be used). Role-based access control restricts admin functions to authorized users. Session management maintains authenticated states, preventing unauthorized access.
Functionality and Use Case Implementation
The login process begins with a user submitting credentials, which are validated against the User table. Upon success, session variables indicate the user role and restrict feature access accordingly. The movie list page displays all movies with images and names, with links to details, update, or delete pages based on roles.
The detail page presents an expanded view of the selected movie, including embedded trailers. Admins can navigate to update or delete operations directly from this view. Adding a new movie involves submitting a form with all relevant details, which triggers server-side validation and database insertion. Update operations fetch existing data, allow modifications, and update the database correspondingly. Delete operations remove records, with confirmation prompts to prevent accidental deletion.
Security Considerations
Ensuring data security is paramount; thus, all input validation and prepared statements are recommended to prevent SQL injection. File uploads should include validation for file type and size, with stored files protected in non-public directories. Password management requires hashing algorithms like bcrypt, and session timeouts should be implemented to prevent session hijacking.
Future improvements include implementing user registration, integrating payment APIs for ticket purchases, and enhancing the user interface with modern JavaScript frameworks and responsive design.
Conclusion
This web application demonstrates a practical implementation of a movie management system tailored for Cinemark. By combining PHP, MySQL, and best security practices, the system efficiently supports core use cases such as listing, viewing, adding, updating, and deleting movies. The modular design facilitates future enhancements like ticket purchasing and user registration, aligning with Cinemark’s strategic goals to improve customer engagement and operational efficiency. Continued refinement of security and user experience will further ensure the application's robustness and popularity among users.
References
- Elmasri, R., & Navathe, S. B. (2015). Principles of Database Systems (7th ed.). Pearson.
- Sharma, A., & Kumar, D. (2017). Designing Secure PHP Applications. Proceedings of the International Conference on Information Security and Privacy.
- MySQL Documentation. (2023). Retrieved from https://dev.mysql.com/doc/
- PHP: The Right Way. (2023). Retrieved from https://phptherightway.com/
- Welling, L., & Thomson, L. (2016). Database Concepts (7th ed.). Jones & Bartlett Learning.
- Freeman, E. (2010). Head First PHP & MySQL. O'Reilly Media.
- W3Schools. (2023). PHP and MySQL Tutorials. Retrieved from https://www.w3schools.com/
- OWASP. (2021). OWASP Top Ten Web Application Security Risks. Retrieved from https://owasp.org/
- Clark, J., & Pasareanu, C. (2018). Secure Coding Practices. IEEE Software, 35(2), 94-99.
- Stallings, W. (2017). Computer Security Principles and Practice. Pearson.