Copyright (c) <2020>, < felicityzhao99 > All rights reserved. Any copy would not be allowed, or will be reported as plagiarism.
The steps we will introduce are about how to deploy the web app on AWS instance.
Note: mysql file on github is called createtable.sql, not create_table.sql.
Step zero:
Don't forget to store movie-data.sql under /home/ubuntu. Build database on AWS MySQL.
Step one:
git clone https://github.com/felicityzhao99/Movie-Platform.git
Step two:
Inside your repo, where the pom.xml file locates, build the war file:
mvn package
Show tomcat web apps, it should NOT have the war file yet:
ls -lah /home/ubuntu/tomcat/webapps
Copy your newly built war file:
cp ./target/*.war /home/ubuntu/tomcat/webapps
Show tomcat web apps, it should now have the new war file:
ls -lah /home/ubuntu/tomcat/webapps
Step three:
- refresh the tomcat manager page. You should see a new project (just deployed): project 1.
- click the project link, which goes to your website's landing page.
- after click the Movies hyperlink, navigate to Movie List Page. Scroll up and down to show all 20 movies if needed.
- on Movie List Page, click on a movie title hyperlink. Should jump to Single Movie Page; click on a star name hyperlink. Should jump to Single Star Page.
- on Single Movie Page, click on a star name hyperlink. Should jump to Single Star Page. Show all information on Single Star Page. Click back button. Should jump to Movie List Page.
- on Single Star Page, click on a movie name hyperlink. Should jump to Single Movie Page. Show all information on Single Movie Page. Click back button. Should jump to Movie List Page.
Step four (OPTIONAL):
- If you want to test the android mobile, after you git clone the project, make sure you import it from the folder called "fabflix_mobile" in intellij. Don't import the folder called "", or else you won't successfully run the android gradle.
Congratulation! You're done!
For those who are interested in our demo, please check this video link:
Project 1: https://www.youtube.com/watch?v=f_nbnUMRR6Q
Project 2: https://www.youtube.com/watch?v=8Ld7Ztijew0&feature=youtu.be
Project 3: https://www.youtube.com/watch?v=zlWNZbClFMs&feature=youtu.be
Project 4: https://youtu.be/rkUvfTvAilo
Project 5: https://youtu.be/A9qPu0foIKk
-
-
- Configuration: fabflix/WebContent/META-INF/context.xml
- fabflix/src/ActorServlet (PreparedStatement)
- fabflix/src/AutoCompleteServlet (PreparedStatement)
- fabflix/src/BrowseServlet
- fabflix/src/cart2Servlet
- fabflix/src/GenreServlet
- fabflix/src/InsertMovieServlet (PreparedStatement, masterdb)
- fabflix/src/Login2Servlet (PreparedStatement)
- fabflix/src/LoginServlet (PreparedStatement)
- fabflix/src/mobileLoginServlet (PreparedStatement)
- fabflix/src/MovieServlet (PreparedStatement)
- fabflix/src/PaymentServlet (PreparedStatement, masterdb)
- fabflix/src/SearchServlet (PreparedStatement)
- fabflix/src/StarServlet (PreparedStatement, masterdb)
-
- All servlets first obtain an environment context and then lease a connection from the JDBC connection pool
- When done, servlets return the connection back to the pool so that it can be reused
- Use PreparedStatement to handle queries that involve user inputs, such as LoginServlet, SearchServlet, and etc
-
- Use a different connection pool for each backend database (masterdb and localhost, two pools)
- Each servlet leases a connection from one of the pools, depending on its purpose => if read only, use localhost; otherwise, use masterdb
-
-
-
- See configuration: fabflix/WebContent/META-INF/context.xml
-
- See above section, files using masterdb involve write operation to SQL
- For those involve write operations, lease connection from the masterdb pool
- For those only involves read, lease connection from localhost pool (does not matter if it is master or slave)
-
-
- It will run as a separate Java program, whose main function involves reading our search log file from location "contextPath+"\search_log.txt". It iterates over the log file line by line, and calculates TS/TJ average.
- Output to contextPath+"\average.txt"
-
Analysis: TS is always greater than TJ. Also, HTTP 1 thread's avg query time is similar as HTTP 10 thread's avg query time. Avg query time of no Connection Pooling is larger than connection pooling one.
-
- ActorServlet
- BrowseServlet
- cart2Servlet
- GenreServlet
- LoginServlet
- MovieServlet
- MoviesServlet
- SearchServlet
-
We compared the Normal vs. Branch vs. Load
15min vs. 162562(milliseconds) vs. 2650 milliseconds
-
We generate our sql query based on search box & advanced search form inputs.
The javascript function is in movieList.js, and the actual query is formed in SearchServlet.java
For title, director, and actor input, we use this syntax: ... where title like '%title%'.
For year input, we use a stricter syntax: ... where year = 'year'.
-
Should support "substring matching" so that customers do not have to provide an exact value for an attribute. For example, if search by title keyword: "term", movies such as "Terminal" and "Terminator" should be returned.
Only String (VARCHAR) fields are required to support substring matching. Thus, year should not support it.
You can use the "LIKE" and "ILIKE" SQL operators for pattern matching in any way you wish.
Customer input should just be keywords. Should NOT expect customer input to have any wildcards characters.
Our team uses LIKE/ILIKE in search feature.
Movie List Page:
The Movie list Page shows movies in specific order. You don't need to show all the movies. Each movie needs to contain the following information:
- title
- year
- director
- first three genres
- first three stars
- rating
Single Movie Page:
From Movie List Page or Single Star Page, if the user clicks on a movie (hyperlinked), the corresponding Single Movie page displays all the information about the movie, including:
- title
- year
- director
- all of the genres
- all of the stars
- rating
Single Star Page:
From Movie List Page or Single Movie Page, if the user clicks on a star (hyperlinked), the corresponding Single Star Page displays all the information about this star, including:
- name
- year of birth (N/A if not available)
- all movies (hyperlinked) in which the star acted