Code Monkey home page Code Monkey logo

cs532's Introduction

Setting up the API

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'

  1. This application is currently under development using Python 3.8.10.
  2. In order to launch the site, you will need to set up the virtual environment first.
  3. Once you have set up/cloned the repository, navigate to the top level directory. (contains health_app/ folder, requirements.txt, etc.)
  4. 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.
  5. Activate the virtual environment by running source venv/bin/activate while in api directory.
  6. Update the enviroment with the necessary dependencies from requirements.txt by running the command pip3 install -r requirements.txt
  7. Once your venv is activated and the dependencies are installed, you can launch api by running flask run while in the top level directory.
  8. 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 in api/script (remember to launch the api before executing the script or else the requests won't go through)

Setting up the front end

  1. Navigate to frontend/
  2. Install dependencies: npm install
  3. Run the application: npm run dev

cs532's People

Contributors

steenfuentes avatar devtamer avatar madguy16s avatar avidityseth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.