Skip to content

zilogfa/D66-FlaskRESTfulAPI-SQLAlchemy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wifi & Cafe Project - Flask RESTful API

This project is a RESTful API developed with Flask that provides information about various cafes and their amenities. It supports operations for retrieving, adding, updating, and deleting cafe data.

Features

  • List all cafes.
  • Get a random cafe.
  • Search for a cafe by location or name.
  • Add a new cafe.
  • Update the price of coffee for a specific cafe.
  • Delete a cafe entry (admin-restricted).

Technologies

  • Python
  • Flask
  • SQLAlchemy
  • SQLite

Setup

To run this project, install it locally using pip:

$ pip install Flask
$ pip install Flask_SQLAlchemy

API Endpoints

Method URL Description Parameters Response
GET /random Get a random cafe None JSON object of a cafe
GET /all Get a list of all cafes None JSON list of cafes
GET /search Search for cafes by location or name loc=[string], name=[string] JSON object of a cafe
POST /add Add a new cafe Form Data: name, cafe_url, img_url, loc, sockets, toilet, wifi, calls, seats, coffee_price Confirmation message
PATCH /update-price/<cafe_id> Update the coffee price of a cafe URL Param: cafe_id, Arg: new_price Confirmation message
DELETE /report-closed/<cafe_id> Delete a cafe entry URL Param: cafe_id, Arg: api-key Confirmation message or error

How to Use

Start the server:

$ python main.py

Utilize the endpoints via a browser or a tool like Postman to interact with the API.

Developer:

Ali Jafarbeglou

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published