Skip to content

YichenQian09/CS516-project

Repository files navigation

Team members:

  • Xinyu (Diane) Hu - xh112
  • Yichen Qian - yq82
  • Zhensheng Xie - zx93
  • Angikar Ghosal - ag520

Project chosen: semi-standard project

Our team chooses to do a “semi-standard” course project: a researcher club application based on databases containing published scholarly papers (paper title, author, abstract, affiliation, year, etc). On our application, users can “shop” papers they are interested in. The goal of our application is to help researchers efficiently access useful papers.

Team name: Crouching Tiger Hidden Dragons

Github repository: https://github.com/halfmoontonight/CS516-project

To run the project:

  1. If you are using MacOS, switch your shell to bash ($chsh -s /bin/bash)

  2. Make sure you have installed python3, pip3, psql

  3. psql user role and password setting

# set a database role of <<username>
# make the username as same as your account on your host machine
$ sudo -u postgres createuser <<username>>

# give the user a super permission
$ sudo -u postgres psql -c "ALTER ROLE <<username>> WITH SUPERUSER;"

# make sure the username is bind with password
$ sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"
  1. Run install.sh If you are using windows, install WSL and execute $./install.sh

If you are using MacOs, tweak your install.sh as follows and then execute $./install.sh

#!/bin/bash
 
brew install coreutils
# brew install python3
pip3 install virtualenv
brew install gsed
# brew install postgresql
 
echo "You may need to tweak .flashenv and db/setup.sh manually"
# sudo apt-get -qq coreutils
mypath=`realpath $0`
mybase=`dirname $mypath`
user=`whoami`
echo "Assume your database user name is: $user"
read -p "Enter database password and press [ENTER]: " dbpasswd
 
secret=`LC_ALL=C tr -dc 'a-z0-9-_' < /dev/urandom | head -c50`
cd $mybase
cp -f flaskenv-template.env .flaskenv
gsed -i "s/default_secret/'$secret'/g" .flaskenv
gsed -i "s/default_db_user/$user/g" .flaskenv
gsed -i "s/default_db_password/$dbpasswd/g" .flaskenv
 
# sudo apt-get -qq update
# sudo apt-get -qq --yes install python3-virtualenv
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
chmod +x db/setup.sh
db/setup.sh
  1. Activate and enter virtual env
$ source env/bin/activate
  1. Run flask app
$ flask run

For the 'copy to clipboard' function to run properly, please use the localhost:5000 version of the link. Otherwise your browser might block this operation and please copy manually in this case.

Environment setup

  1. set up Ubuntu enviroment locally
  • follow instructions on https://docs.microsoft.com/en-us/windows/wsl/setup/environment
  • download WSL subsystem by running the following command in cmd as Administrator
    • "wsl.exe --install -d Ubuntu"
  • set up username and password
  • run "sudo apt update && sudo apt upgrade" to update and upgrade pacakges
  • use "wsl --set-version Ubuntu 2" in cmd to update WSL 1 to WSL 2
  1. get windows terminal, VS Code
  1. connect it to git
  • worked somehow
  1. Run ./install.sh
  • make sure postgresql is installed and connected
    • if not run "sudo service postgresql start"
    • to check status run "sudo service postgresql status"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •