Giter Club home page Giter Club logo

airswap_backend's Introduction

AirSwAP Backend

This backend sits and waits for requests from the frontend.

Overview - What is AirSWaP

AirSWaP allows people from different parts of the world to swap apartments/houses with each other for a certain amount of time. The motivation for the application comes from the fact that people want to travel to different parts of the world for various periods of time but don’t want to spend money on Airbnb or hotel costs. An ideal user of the app would be a person who wants a break in routine from their normal lives for a short while. This is mostly meant for people who are either able to work remotely, looking to take a vacation, or are not employed.

The pandemic showed us that with a surge of remote jobs, people want a break from their normal routine at a cost that won’t break their bank. This app can help fill this void. Airbnb users can short-term and long-term rent apartments and houses all around the world, however, they have to pay for the rental.

Getting Started / Installation

To run on Mac & Linux

Make sure you have venv installed. Then create your virtual env:

python3 -m venv venv

Now, activate via:

On Linux and Mac:

./venv/bin/activate

On Windows:

source venv\Scripts\activate.bat

Now install

pip3 install -r requirements.txt

Now you can run via python3 App.py

To run on Windows

1) Install Virtual Environment

pip install virtualenv

2) CD to your project directory then run virtualenv to create the new virtual environment.

The following commands will create a new virtual environment under my-project/my-venv.

   cd my-project
   virtualenv --python C:\Path\To\Python\python.exe venv

3) Activate Environment

venv\Scripts\activate.bat

4) Install requirements

pip install -r requirements.txt

5) Run the App

python App.py

Requirements

This system runs off of Python3 Flask for handling routing. We use Flask SQLAlchemy in order to communicate with our database. We also use the Flask JWT Extended library in order to simplify authentication. The full list of requirements can be found in the requirements file.

Data Model

All of our models are defined in (the models.py file)[https://github.com/PredatorFeesh/airswap_backend/blob/master/models.py]. Here is a breakdown:

User:
{
    id: 123,
    email: '[email protected]',
    password: 'secure_password',
    first_name: 'Jane',
    last_name: 'Doe',
    image: 'google.com/imageloc',
    phone_number: '347-347-1010',
    description: 'I am a good person',
    listingrequested : Listing {Object},
    cities: City {Object}
}

Listing:
{
    id = 12,
    address = '12 Address Street',
    image: 'google.com/houseloc',
    description: "My Humble Abode",
    is_listed: true,
    date = March 12 2020 {Date Object},
    user_id: Foreign Key USER Id,
    city_id: Foreign Key CITY Id
}

City: 
{
    id: 12,
    name: Moscow',
    listings = Listing {Objects}
    followers = User {Object}
}

Additionally, we keep tables to keep relations between objects:

follows = db.Table(
    "follows",
    Date, User ID, City ID
)

requests = Table(
    Requester ID, Requestee ID
)

The different endpoints are described in the frontend Data Model Section Here.

Site Map

Please see the site map on the frontend page here.

User Stories

Swappers are users of our App. These are the people who would be swapping apartments or houses.

As a swapper, I want to be able to:

Auth based actions

  • Register an account
  • Login to my account
  • Log out of my account
  • Update my profile
  • Update my listing
  • Open my listing
  • Close my listing

Swap based actions

  • Follow a city
  • Unfollow a city
  • View listings of a given city
  • View listings in cities that I liked
  • Visit the profile and listing of any listing I see
  • Request to swap with someone else
  • Remove request to swap with someone else
  • View all the requests I sent
  • View all the requests I received

References Used

Authors:

airswap_backend's People

Contributors

nataliaharrow avatar paulalek avatar predatorfeesh avatar

Watchers

 avatar  avatar

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.