This Flask API serves as the back-end for the Kid Vault app, which was built as part of the StepZen GraphQL Challenge 2022.
The React front-end and StepZen GraphQL API code repositories can be viewed here:
The deployed version of this Flask back-end with a mock Postgres database is viewable here:
NOTE:
Heroku often takes some time to wake up! Don't forget to give it a minute.
The deployed version of our app is viewable here:
To install this repository on your computer, please follow these instructions:
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
- Create .env file with:
DATABASE_URL=postgresql:///mom_api2
SECRET_KEY=[YOUR_SECRET_KEY_HERE]
- Create the database:
$ psql
# CREATE DATABASE mom_api2;
- Run
seed.py
file in the project root directory to create the database tables:
$ python3 seed.py
You only need to do this once, unless you change your model definitions.
- Fix the database (Data was entered explicitly using .csv files, so we need to set max student_id value):
# psql
# \c mom_api2;
# SELECT setval('students_id_seq', (SELECT MAX(id) from "students"));
- Run the app itself:
$ flask run -p 5002
Visit http://localhost:5002/ in your browser to see the results.
You Made It! Enjoy and please contact @melawong and @anita-lee with any issues or questions.