Installing the project

System Requirements

  • Debian flavor of linux (tested on Ubuntu 16.04)
  • A non root user with sudo privileges
  • Node v.8

Create a secrets.py file

A secrets.py file is used to store several things. This file needs to be restricted in production environments using chmod.

The file needs to contain the following:

  • Database username and password
    • Both should be set during the setup_script. Make sure you have the same credentials copied over (username’s default is catalog) or the application will not work.
  • Flask’s secret_key which is used for session cryptography
    • To generate a good key run $ python3 -c 'import secrets; print(secrets.token_bytes(16))'

An example secrets.py file would be as follows:

db_username = 'catalog'
db_password = 'catalog'
flask_secret_key = b'\xfa\x85\xf7\xcc/I\xb7\xf2\xa1P\xb0o\xae\x95s\x17'

Install Steps

  • First time setup (This project has to be run in a debian based environment)
    1. All commands should be run from the project root unless a cd command was instructed previously
    2. Run $ ./server_management/setup_script.py respond yes when prompted if this is your first time.
    3. Run $ source env/bin/activate
    4. Run $ python -m portal_server.db.setup
    5. If you want fake data in your db run $ python -m portal_server.db.import_fake_data
    6. $ cd portal_server/directory/home_static
    7. Run $ npm install
    8. Run $ npm run build
    9. Return to project root $ cd ../../..
    10. See Running the Project for instructions on running the project
    11. Visit the login page