Skip to content

anita-lee/Kid-Vault-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Kid Vault Back-End

ABOUT

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:


INSTALLATION

To install this repository on your computer, please follow these instructions:

Installing Dependencies

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Running this Back-end

  1. Create .env file with:
DATABASE_URL=postgresql:///mom_api2
SECRET_KEY=[YOUR_SECRET_KEY_HERE]
  1. Create the database:
$ psql
# CREATE DATABASE mom_api2;
  1. 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.

  1. 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"));
  1. Run the app itself:
$ flask run -p 5002

Visit http://localhost:5002/ in your browser to see the results.


WOOHOO!

You Made It! Enjoy and please contact @melawong and @anita-lee with any issues or questions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published