Skip to content

ProtosaurusRex/People-and-Notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

This is a basic api I built with Flash, Connexion, and Marshmallow, in order to familiarize myself with what API's are and how they run.

This API uses SQLalchemy for Database management. The database 'people.db' contains two tables, 'person' and 'note', as an example of one-to-many relationships within the API.

Information about the endpoints, components, and paths can be found within 'swagger.yml'

Models and Schemas can be found within 'models.py'

To accsess the Swagger UI, type within the URL field.

To set up the API:

1.) Set up a virtual enviornment using 'python -m venv venv' in the command line.

2.) Activate the virtual enviornment by using venv/Scripts/activate in the command line,

Note- You may need to run on of the alternate activation scripts depending on what shell you are using (bash, powershell, etc.)

3.) Install the required dependencies using 'pip -r install requirements.txt'

4.) Next, initialize the database by using 'python database_setup.py' in the command line.

This script sets up the database with the 'person' table.

Alternativley, you may decide to run this script line by line within a python shell.

5.) Extend the database by running 'python extend_database.py' in the command line.

This script extends the database by adding the 'note' table.

This script is identical to the 'build_database.py' script, which performs the same function, I've added 'extend_database.py' for clarity of instruction.

Alternativley, you may decide to run this script line by line within a python shell.

6.) Activate the API by running 'python app.py' in the command line.

7.) Crtl-click on the server address within the terminal, and the browser will open the 'home.html', found in the templates folder.

About

A small API project I built using FLASK from the tutorial on the Real Python website: https://realpython.com/flask-connexion-rest-api/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published