This application is based on datasets of movies and TV shows and allows movie and TV show fans to search, view, rate and leave comments for each movie and TV show.
SQL Database is created by sql/initial.sql, which is used for creating tables, constraints, and stored triggers.
- Go to the
sql
folder. - In the MySQL server, run the initial.sql by
source initial.sql;
. This will create a new database calledCS348_Movie_DB
and all the tables needed and create a user with the name 'user1' and password 'Password0!'.
Sample database sql/sample-data.sql is generated by scripts/scrapy_top10.py, you can recreate it by running python3 scripts/scrapy_top10.py
. You need to install the python package cinemagoer
by running pip install cinemagoer
to scrape the data.
- Type
source initial.sql;
to initialize the database. - Type
source sample-data.sql;
to load the sample dataset. - Type
source test-sample.sql;
to test the 6 functionalities on the sample dataset.
Production database sql/production-data.sql is generated by scripts/scrapy_top250.py, you can recreate it by running python3 scripts/scrapy_top250.py
. You need to install the python package cinemagoer
by running pip install cinemagoer
to scrape the data.
- Type
source initial.sql;
to initialize the database. - Type
source production-data.sql;
to load the production dataset. - Type
source test-production.sql;
to test the 6 functionalities on the production dataset.
- View information about the movie selected based on the name. (ex.
The Lord of the Rings
) - Find all movies with ratings in a specific range. (ex.
> 7.0/10.0
) - Order all movies by their rate order. (ex.
High-to-Low
orLow-to-High
) - Find movies with
top-n
ratings. (ex.n <= 10
) - Leave both a rating and a comment on a specific movie.
- Update the given rate and comments based on the user name.
Before running the data-driven application, please be sure to load in databases (sample or production).
- Go to the
back-end
folder,- type
pip install -r requirements.txt
to install all python packages, - and type
python3 main.py
to start.
- type
- Go to the
front-end
folder,- type
npm config set legacy-peer-deps true
. - type
npm install
to install dependencies. - type
npm install @material-ui/icons
to install icons. - In the same folder, type
npm start
, and this will display a webpage.
- type
- View information about the movie selected based on the name. (ex.
The Lord of the Rings
) - Find all movies with ratings in a specific range. (ex.
> 7.0/10.0
) - Order all movies by their rate order. (ex.
High-to-Low
orLow-to-High
) - Find movies with
top-n
ratings. (ex.n <= 10
)
- Initialize database
- Load Data
- run main.py in back-end folder
- npm install and npm start in front-end folder
- Go to website localhost:3000
Claire Sheng
Ganlin Feng
Junyi Liu
Yuming Long