Code Monkey home page Code Monkey logo

backend2.0's Introduction

Solemates - Backend Flask App

Not everyone requires two shoes. This app was inspired by a post of someone with one leg showing off their shoe collection and stating that luckily they had a friend who was missing an opposite leg, and was the same size shoe and had similar styles in footware. So we decided to create an app for people to find their Solemate.
(FE deployed endpoint)
(BE deployed endpoint)
Once logged in, the user can browse shoes, filtered by size, side and style, and be connected to the seller via email if they find anything they like. Frontend Github repository can be found here

What can I do on Solemates?

  • Create a user account
  • Post a shoes you want to sell or share
  • View available shoes
  • Search shoes by side, size and style
  • Get buyer's contact information for the shoes you are interested in.

Stack

  • Python Flask PostgreSQL Heroku CircleCI Jupyter Notebook
  • pgAdmin4, SQLAlchemy, Pytest

Readme Content

Local Setup

  • Versions
    • Python 3.9.10
    • Flask 2.0.2
  • Fork and clone the repository
  • cd into your local repo version and install all the libraries specified in requirements.txt
  • This is not necessary, but if you want to be safe, create a virtual environment and activate it in the terminal:
    • python3 -m venv .venv (.venv is just the name of the virtual environment, so it can be anything you want)
    • source .venv/bin/activate
  • Run your own development server. In the terminal, run:
    • python3 app.py
    • Your terminal will show you the url of your local server
  • Create a .env file on the same level as the app.py. Assign the url for the postgres database in the form of:
    • URL = postgresql://(full url from heroku postgres config variables)

API Endpoints

Endpoint : https://turingsolemates.herokuapp.com/

  • View all shoes:

    • Request: GET '/api/v1/shoes'
    • Response:
             {
             "shoes": [
                 {
                   "description": "comfortable shoes",
                   "id": 1,
                   "brand": "Nike",
                   "side": "right",
                   "size": 9,
                   "style": "sneakers",
                   "user_id": 1,
                   "photo_url": "some_url"
                 },
                 {
                   "description": "comfortable shoes",
                   "id": 2,
                   "brand": "Nike",
                   "side": "right",
                   "size": 9,
                   "style": "sneakers",      ,
                   "user_id": 2,
                   "photo_url": "some_url"
        
                 }
               ]
              }
    
  • Search one shoe by id:

    • Request: GET '/api/v1/shoes/'
    • Response:
                 {
                   "id": 1,
                   "brand": "Nike",
                   "side": "right",
                   "size": 9,
                   "style": "sneakers",
                   "description": "comfortable shoes",
                   "user_id": 1,
                   "photo_url": "some_url"
                 }
    
  • Add a shoe:

    • Request: POST '/api/v1/shoes'
    • As a raw JSON body:
                           {
                                "side": "side",
                                "style": "style",
                                "size": size,
                                "photo_url": "url",
                                "description": "description",
                                "brand": "brand",
                                "user_id": user_id
                            }
    
    • Response: The shoe "{id}" has been successfully created.
  • Delete a shoe:

    • Request: POST '/api/v1/shoes/'
    • Response: The shoe " + {id} + " has been deleted!
  • **Filter by size, side and style **:

    • Request: GET '/api/v1/shoes/search'
    • As a raw JSON body:
                          {
                               "side": "side",
                               "style": "style",
                               "size": size
                           }
    
    • Response: The shoe "{id}" has been successfully created.
  • Add a user:

    • Request: POST '/api/v1/users'
    • As a raw JSON body:
                             {
                                  "name": "name",
                                  "email": "email"
                              }
    
    • Response:
            {
            "shoes": [
                {
                  "description": "comfortable shoes",
                  "id": 1,
                  "brand": "Nike",
                  "side": "right",
                  "size": 9,
                  "style": "sneakers",
                  "user_id": 1,
                  "photo_url": "some_url"
                },
                {
                  "description": "comfortable shoes",
                  "id": 2,
                  "brand": "Nike",
                  "side": "right",
                  "size": 9,
                  "style": "sneakers",      ,
                  "user_id": 2,
                  "photo_url": "some_url"
       
                }
              ]
             }
      

Contributors

backend2.0's People

Contributors

haewonito avatar mekimball avatar

Watchers

 avatar Tanya Z  avatar

Forkers

mekimball

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.