Git Product home page Git Product logo

citybikesolution's Introduction

Solution City Bikes in Miami FL stations

In this project you can find solution of City bikes in Miami

Installing

For install all dependencies you have to:

For backend go to folder CITYBIKE-SERVER

cd citybike-server&& npm i

For frontend got to folder citybike-client

cd citybike-client&& npm i

You can run backend project like this.

cd citybike-server&& npm run start

You can run frontend project like this.

cd citybike-server&& npm run start

Deployment

Explanation Backend

I used node-fetch to make api call to the city bike api(http://api.citybik.es/v2/networks/decobike-miami-beach), then when I got the Miami's stations I saved that data in a cache date base, to save this data I used memory-cache library and with an iterator a I saved data each 5 minutes(300000 ms).

For sending data that I got of the api call to the front-end, I used Sockect IO. I sent data each 200000 ms.

The data of bike stations is saved for 24 hours(86400000 ms). Then the data is deleted.

Finally, I created three services:

  • /historical-bikes: return the range of dates that are allowed in cache
  • /get-data-cache: return the bikes stations at specific hour
  • /first-registry-date: return the first registry of the data base cache

Explanation frontend

The frontend received data through SockectIO and I used react-leaflet library to marked position in the map. I created selector which use service /first-registry-date, this is for know when is the first Date that is storaged in cache. Then i added 5 minutes to this first date to get a range of dates /historical-bikes. When I got a range of Dates, I painted that dates in a table which contain each date that User selected of that range of Dates.

Finally, in the table Users can select any option of that Dates and that Data is showed in the map.

Also, if the users wants to see current data, they can click in the Live Button

Authors

citybikesolution's People

Contributors

nfgonzalez10 avatar

Watchers

James Cloos 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.