Getting started

Prerequisites

Before start make sure you have installed Python 3 and Node.js. Please follow the official instructions. Also, you need to have a PostgreSQL database handy. If you don't want to install it you can use ElephantSQL service, they have a free plan: ElephantSQL.

Steps to follow

Step 1. Download the full zip or pull code from the repository, find full instruction in Github documentation

Step 2. Add necessarily environment variables (you can add them into /venv/scripts/activate file or into .env in the root folder):

  • FLASK_APP=application
  • db_url='postgres://user:password@dbhost:port/database'
  • JWT_SECRET_KEY='your jwt secret key'
  • SECRET_KEY='your secret key'
  • MAIL_SERVER = 'mail server'
  • MAIL_PORT = Number (like 465)
  • MAIL_USE_SSL = Bool (True of False)
  • MAIL_USE_TLS = Bool (True of False)
  • MAIL_USERNAME = 'your email'
  • MAIL_PASSWORD = 'your password'
  • ADMIN_EMAIL = 'your admin email'
  • MAIL_DEFAULT_SENDER = 'the same as your email'

Note. At least 2 first variables MUST be set up (FLASK_APP and db_url) else the installation script wont' work.

JWT_SECRET_KEY and SECRET_KEY are just strings that not easy to guess, for example, it may be 'My Co0LServ_ice'.

Tip. If you are puzzled how and why .env is used please read this explanation on Stackoverflow

Step 3. Run the command (Windows):

init

(Mac):

./init.sh

For any problem happening during execution of this command please see the section Troubleshooting below.

Warning! This command will first drop ALL tables in your database. (You can comment this part if you wish, see /src/shared/utils/db_scaffold, line 25.)

Step 4. If everything is going fine you will see the following text in your terminal:

* Serving Flask app "application" * Environment: production * WARNING: Do not use the development server in a production environment. Use a production WSGI server instead. * Debug mode: off * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

If you prefer to go through the installation process manually, please refer steps from the according version of init file in the root folder.