Giter VIP home page Giter VIP logo

opendoor's Introduction

Listings API

I created an endpoint that returns a list of GeoJSON objects based on the filters given. The project is deployed on Heroku. Here is a sample url: https://lita-listing-app.herokuapp.com/listings?min_bed=3&max_bed=5&min_bath=3&max_price=200000

It took me a total of 4 hours to get everything working, with unit tests. Unfortunately, setting up Heroku took more time than expected, as I am not familiar with it.

Python files of Interest

All the endpoints are defined in routes.py.

The model of a Listing is define in models/listings.py

Migrating the CSV Data to MongoDB

I created a migration script to insert all the data from the CSV file to MongoDB. This is something I have to run manually once using a one-off Dyno. If you were to deploy this yourself to Heroku, you will need to run the following commands:

heroku run bash
<< Once inside the Dyno>>
python manage shell
>> from listings_migration import run
>> run()

This will kick off the migration.

Tests

To run the tests, enter the following command:

py.test tests/

Technologies Used

I ended up using Flask with Blueprints, JSON Schema for validation, and MongoDB as my data store. I like Flask with Blueprints, as the routing maps directly onto the function call. I also like JSON Schema, because the json file acts like an API documentation. I ended up using MongoDB for the sake of ramp up time. I am familiar with it, and it was really quick to set up. MongoDB also has a geo-spatial indexes, which might be a useful feature for querying locations of the houses.

Future Work

If I had more time, I would love to work on pagination of the results, since the endpoint is super slow as it is querying a lot of data. This would be the highest priority.

Secondly, I would like to add a nearby feature, where you can give it a lat/lng and a radius, and it will return houses near that area.

Lastly, I would love to add a front-end portion to the API. This would be a lot more work, but I think it would be fun.

opendoor's People

Contributors

lita 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.