Skip to content

lemmonquiche/cs1530

Repository files navigation

grouper-flask-react

Intallation/Compilation/Execution Instruction

Installation

  1. Install python 2.7 by running:
    • sudo apt install python2.7 python-pip
  2. Install yarn by running:
    • sudo apt install yarn -g
  3. Install pip by running:
    • sudo apt install pip
  4. Install virtualenv by running
    • pip install virtualenv

Compilation/Execution

  1. Create a virtual environment for Python and activate:
    • virtualenv [env-dir] (env-dir - is a directory that will be created and where all virtual env will be localed)
    • source [env-dir]/bin/activate
  2. Copy the repo:
    • git clone https://github.com/lemmonquiche/cs1530
  3. To install all requirements to virtual env from the root of the repository run:
    • pip install -r requirements.txt
  4. Install/Build react app by running script from root of the repository
    • ./build.sh
  5. Add the FLASK_APP variable to your path.
    • cd [app-root-dir]
    • export FLASK_APP=grouper.py
  6. Running Flask App
    • python -m flask initdb
    • flask run --host 0.0.0.0 -p 5000 (Runs the service on http://localhost:5000)
  7. Logging in as student
    • username: test
    • password: pwd
  8. Logging in as instructor
    • username: prof
    • password: password

Database Load Mode

  1. Initialize new database with all the data:
    • python -m flask initdb
  2. Dump the database into a dump.sql file
    • python -m flask dumpdb
  3. Load the database from dump.sql file
    • python -m flask loaddb

Database administration

  1. Launch application in Database Administration mode by running the script administrate_database.sh
  2. Obtain password by reading the script
  3. Log in to the administrative site by entering the password from the adminstrate_database.sh script.

In case Installation Instraction does not work

  1. apt install pip
  2. pip install virtualenv
  3. virrualenv [dir]
  4. source [dir]/bin/activate
  5. pip install Flask
  6. pip install flask-sqlalchemy
  7. export FLASK_APP=cater.py
  8. python -m flask initdb (not yet)
  9. python -m flask run --host 0.0.0.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published