forked from adipai/PopcornPicks
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/brwali/PopcornPicks into …
…master
- Loading branch information
Showing
5 changed files
with
204 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ name: "CodeQL" | |
on: | ||
push: | ||
branches: [ master ] | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
analyze: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: [ master ] | ||
schedule: | ||
- cron: '07 12 * * *' | ||
- cron: '25 20 * * *' | ||
|
||
jobs: | ||
build: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
# Table of Contents | ||
|
||
* [utils](#utils) | ||
* [create\_colored\_tags](#utils.create_colored_tags) | ||
* [beautify\_feedback\_data](#utils.beautify_feedback_data) | ||
* [create\_movie\_genres](#utils.create_movie_genres) | ||
* [send\_email\_to\_user](#utils.send_email_to_user) | ||
* [create\_account](#utils.create_account) | ||
* [add\_friend](#utils.add_friend) | ||
* [login\_to\_account](#utils.login_to_account) | ||
* [submit\_review](#utils.submit_review) | ||
* [get\_wall\_posts](#utils.get_wall_posts) | ||
* [get\_recent\_movies](#utils.get_recent_movies) | ||
* [get\_username](#utils.get_username) | ||
* [get\_recent\_friend\_movies](#utils.get_recent_friend_movies) | ||
* [get\_friends](#utils.get_friends) | ||
|
||
<a id="utils"></a> | ||
|
||
# utils | ||
|
||
Copyright (c) 2023 Aditya Pai, Ananya Mantravadi, Rishi Singhal, Samarth Shetty | ||
This code is licensed under MIT license (see LICENSE for details) | ||
|
||
@author: PopcornPicks | ||
|
||
<a id="utils.create_colored_tags"></a> | ||
|
||
#### create\_colored\_tags | ||
|
||
```python | ||
def create_colored_tags(genres) | ||
``` | ||
|
||
Utitilty function to create colored tags for different | ||
movie genres | ||
|
||
<a id="utils.beautify_feedback_data"></a> | ||
|
||
#### beautify\_feedback\_data | ||
|
||
```python | ||
def beautify_feedback_data(data) | ||
``` | ||
|
||
Utility function to beautify the feedback json containing predicted movies for sending in email | ||
|
||
<a id="utils.create_movie_genres"></a> | ||
|
||
#### create\_movie\_genres | ||
|
||
```python | ||
def create_movie_genres(movie_genre_df) | ||
``` | ||
|
||
Utility function for creating a dictionary for movie-genres mapping | ||
|
||
<a id="utils.send_email_to_user"></a> | ||
|
||
#### send\_email\_to\_user | ||
|
||
```python | ||
def send_email_to_user(recipient_email, categorized_data) | ||
``` | ||
|
||
Utility function to send movie recommendations to user over email | ||
|
||
<a id="utils.create_account"></a> | ||
|
||
#### create\_account | ||
|
||
```python | ||
def create_account(db, email, username, password) | ||
``` | ||
|
||
Utility function for creating an account | ||
|
||
<a id="utils.add_friend"></a> | ||
|
||
#### add\_friend | ||
|
||
```python | ||
def add_friend(db, username, user_id) | ||
``` | ||
|
||
Utility function for adding a friend | ||
|
||
<a id="utils.login_to_account"></a> | ||
|
||
#### login\_to\_account | ||
|
||
```python | ||
def login_to_account(db, username, password) | ||
``` | ||
|
||
Utility function for logging in to an account | ||
|
||
<a id="utils.submit_review"></a> | ||
|
||
#### submit\_review | ||
|
||
```python | ||
def submit_review(db, user, movie, score, review) | ||
``` | ||
|
||
Utility function for creating a dictionary for submitting a review | ||
|
||
<a id="utils.get_wall_posts"></a> | ||
|
||
#### get\_wall\_posts | ||
|
||
```python | ||
def get_wall_posts(db) | ||
``` | ||
|
||
Utility function for creating getting wall posts from the db | ||
|
||
<a id="utils.get_recent_movies"></a> | ||
|
||
#### get\_recent\_movies | ||
|
||
```python | ||
def get_recent_movies(db, user) | ||
``` | ||
|
||
Utility function for getting recent movies reviewed by a user | ||
|
||
<a id="utils.get_username"></a> | ||
|
||
#### get\_username | ||
|
||
```python | ||
def get_username(db, user) | ||
``` | ||
|
||
Utility function for getting the current users username | ||
|
||
<a id="utils.get_recent_friend_movies"></a> | ||
|
||
#### get\_recent\_friend\_movies | ||
|
||
```python | ||
def get_recent_friend_movies(db, user) | ||
``` | ||
|
||
Utility function for getting a certain users id | ||
|
||
<a id="utils.get_friends"></a> | ||
|
||
#### get\_friends | ||
|
||
```python | ||
def get_friends(db, user) | ||
``` | ||
|
||
Utility function for getting the current users friends | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
# Steps for setting up the repository and running the web app | ||
|
||
**Step 1:** | ||
**Git Clone the Repository** | ||
## Step 1: Git Clone the Repository | ||
|
||
git clone https://github.com/brwali/PopcornPicks.git | ||
|
||
(OR) Download the .zip file on your local machine from the following link | ||
|
||
https://github.com/brwali/PopcornPicks/ | ||
|
||
**Step 2:** | ||
**Install the required packages by running the following command in the terminal** | ||
## Step 2: Install the required packages by running the following command in the terminal | ||
|
||
pip install -r requirements.txt | ||
|
||
**Step 3:** | ||
**Run the following command in the terminal** | ||
|
||
## Step 3: MySQL Install | ||
Download and Install [MySQL Workbench](https://dev.mysql.com/downloads/workbench/) and [MySQL Community Server](https://dev.mysql.com/downloads/mysql/) | ||
|
||
## Step 4: Setting up MySQL Community Server | ||
|
||
In the `Type and Networking` tab, select config type as **Server Computer** | ||
|
||
All other menus, use default settings. If you create a root password, be sure not to lose it! | ||
|
||
Click `Execute` button on the bottom of the window to start the MySQL Service. | ||
|
||
## Step 5: Setting up MySQL Workbench | ||
1. Launch MySQL Workbench | ||
2. Under MySQL Connections, Right click in the whitespace. Select `Rescan for Local MySQL Instances`. It should detect the server established in the previous step. | ||
3. Select the discovered Local instance and enter your password if created in server setup. | ||
4. Click `File` > `Open SQL Script` then select `init.sql` in the `PopcornPicks/src` directory. This will create the tables required for the application's persistence. | ||
5. Repeat above step for `movies.sql` file located in the `PopcornPicks/src` directory. This may take a few minutes. | ||
|
||
|
||
## Step 6: Python Packages | ||
Run the following command in the terminal | ||
|
||
cd src/recommenderapp | ||
python app.py | ||
|
||
|
||
**Step 4:** | ||
**Open the URL in your browser:** | ||
## Step 7: Open the URL in your browser | ||
|
||
http://127.0.0.1:5000/ | ||
|
||
**You can also leave Steps 2-4 and directly run the setup.py file for setting up all dependencies and running the web app!** | ||
|
||
python setup.py | ||
|
||
**NOTE: For the email notifier feature - create a new gmail account, replace the sender_email variable with the new email and sender_password variable with its password (2 factor authentication) in the utils.py file (function: send_email_to_user(recipient_email, categorized_data)).** | ||
**NOTE: For the email notifier feature - create a new gmail account, replace the sender_email variable with the new email and sender_password variable with its password (2 factor authentication) in the utils.py file (function: send_email_to_user(recipient_email, categorized_data)).** |