Best Flask open-source libraries and packages

RESTFUL API Flask Server

This is a REST API project using Flask Server.
Updated 1 year ago

Flask RESTFUL API

This is a RESTFUL API project using Flask server.

This project running on : https://replit.com/@ViktoriusSuwand/AppBrewery-python-Day-66-Flask-RESTFUL-API

Documentation can be found on : https://github.com/viktoriussuwandi/RESTFUL-API-Flask-Server

Technology and Features :

* RESTFUL API created on Flask server.
* python-flask as backEnd.
* python-SQLAlchemy as database Interface.
* data output is on json format.

Development

HTTP GET - a Random Cafe

  1. Scenario : Client would need to fetch a random cafe from our API.
  2. Create a /random route in main.py that allows GET requests to be made to it.
  3. When client makes a GET request to the /random route, our Flask server should fetch a random cafe from our database. Retun the random cafe in JSON format.

Get random-1 Get random-2

HTTP GET - All the Cafes

  1. Scenario : Client would need to fetch all cafes from our API.
  2. Create another GET route that's called /all.
  3. When a GET request is made to this /all route, the server should return all the cafes from database as a JSON format.

Get all

HTTP GET - Find a Cafe

  1. Scenario : Cliend would need to find cafe(s) on specific location from our API.
  2. Create a /search route to search for cafes at a particular location.
  3. Client will make a GET request to /search route and pass the location as a parameter.
  4. If the location the user passed as the parameter doesn't exist, server will send error message : "Not Found": "Sorry a cafe with that id was not found in the database.".

find a cafe

HTTP POST - A New Cafe

  1. Scenario : Cliend would need to register a new cafe to database.
  2. Create a /add_cafe route to register a new cafe to database.
  3. Use SQLAlchemy add function to add new row to cafes database.
  4. Send success or failed message with HTTP response as return.

add new cafe

HTTP PATCH - A Cafe's Coffee Price

  1. Scenario : Client would need to update a coffe price at specific cafe.
  2. GET the cafe's'id which client would to update.
  3. Create a PATCH request route in main.py to handle PATCH requests to our API.
  4. Send success or failed message with HTTP response as return.

update coffee price

HTTP DELETE - A Cafe that's Closed

  1. Scenario : Client would neet to delete a cafe from database.
  2. GET the cafe's'id which client would to update, also GET special token as user's authorization.
  3. Create a DELETE request on main.py, and send success or failed message as return.

delete a cafe

Tags restful