NOTE: SECRET_KEY and SQLALCHEMY_DATABASE_URI are set to ENVIRONMENT variables. Modify your bashrc or other shell initializiation folder (zshrc, or set using windows commands if on that OS | you can set these values to anything at the moment, but these will be importantly hidden out of production code for security reasons when the program is deployed. we just want to make sure these values can be accessed by our code during development. see config.py)
Example for configuring environment variables:
vi ~/.bashrc
Add SECRET_KEY and SQLALCHEMY_DATABASE_URI environment variables:
export SECRET_KEY='SuperSecretKey'
export SQLALCHEMY_DATABASE_URI='postgresql://postgres:password@localhost/health'
Above command assumes that you have a PostgreSQL database on the localhost named 'health'
- This application is currently under development using Python 3.8.10.
- In order to launch the site, you will need to set up the virtual environment first.
- Once you have set up/cloned the repository, navigate to the top level directory. (contains
health_app/
folder,requirements.txt
, etc.) - Create a new virtual environment in the top level directory by running the command
python3 -m venv venv/
, which will create a directory venv/ with the enviroment. - Activate the virtual environment by running
source venv/bin/activate
while in api directory. - Update the enviroment with the necessary dependencies from
requirements.txt
by running the commandpip3 install -r requirements.txt
- Once your venv is activated and the dependencies are installed, you can launch api by running
flask run
while in the top level directory. - Once you have set up a PostgreSQL database and configured the environment variables as necessary (see above), you can populate the database with mock data by running the script,
populate_db.py
located inapi/script
(remember to launch the api before executing the script or else the requests won't go through)
- Navigate to
frontend/
- Install dependencies:
npm install
- Run the application:
npm run dev