How to Build a REST API Using Flask and SQLAlchemy
Learn how to build a RESTful API to generate quotes using Flask and SQLAlchemy.
Motivation
While designing my personal portfolio website, an idea stuck onto my thoughts: to have motivational quotes displayed on top of the page and update periodically. It seemed like a useful idea to learn and showcase my skills about building a REST API.
This API is an interface between the database (where the quotes are stored) and the front end (where the quotes will be displayed).
In this article, learn the foundations of designing and building the API, as well as the design considerations made to make it robust.
The code can be found here.
This article will cover the following topics:
- What is an API? What are the benefits of using an API? What is a REST API?
- Technologies used in this project
- Design pattern used
- Error handling
- Authentication and authorization
- Deployment
Let’s begin...
Why develop an API?
While designing, I had three choices on how I wanted to display the quotes on the…