GithubHelp home page GithubHelp logo

scooter-radar / escooter-radar-backend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 705 KB

Escooter Radar backend Api powered by Kotlin Spring Boot

Home Page: http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/

License: GNU General Public License v2.0

Kotlin 99.58% Procfile 0.42%
api-rest backend backend-api kotlin kotlin-spring-boot scooter-sharing spring-boot electric-scooter escooter gbfs

escooter-radar-backend's Introduction

Introduction

Scooter-Radar

Scooter Radar is a software application suite that allows you to track available scooters from various electric scooter sharing companies in your area.

escooter-radar-backend

Escooter Radar Backend is the backend of Scooter Radar

Description

Electric Scooter

Electric scooters (e-scooter) are defined as motorized bicycles propelled by human power or by a combination of human power and an electric motor. Electric scooters are easy to ride and let you breeze up and down hills without even breaking a drop of sweat.

Recently, electric kick scooters (e-scooters) have grown in popularity with the introduction of scooter-sharing systems that use apps allowing users to rent the scooters by the minute.

Scooter-Sharing System

A scooter-sharing system is a shared transport service in which electric motorized scooters (also referred to as e-scooters) are made available to use for short-term rentals. E-scooters are typically "dockless", meaning that they do not have a fixed home location and are dropped off and picked up from certain locations in the service area.

Scooter-sharing systems work towards providing the public with a fast and convenient mode of transport for last-mile mobility in urban areas. Due to the growing popularity of scooter-sharing, municipal governments have enforced regulations on e-scooters to increase rider and pedestrian safety while avoiding the accrual of visual pollution. Scooter-sharing systems are one of the least expensive and most popular micromobility options.

API Manual

API Base Url

http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/

API Routes

  • api/scooter/provider?company={company}

company being the name of the company that you want to get the scooters from.

  • api/scooter/location/zone?city={city}

city being the name of the area or city where you want to get the scooters.

  • api/scooter/location/within?latitude={lat}&longitude={lon}&degree={degree}

lat being the latitude of where you want the scooters to be near.
lon being the longitude of where you want the scooters to be near.
degree being the degree in which you want the scooters to be.

  • api/scooter/location/near?latitude={lat}&longitude={lon}&limit={nbOfScooters}

lat being the latitude of where you want the scooters to be near.
lon being the longitude of where you want the scooters to be near.
nbOfScooters being the number of scooters near the location you want to get.

Endpoints Examples

Getting all Pony e-scooters :

http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/api/scooter/provider?company=Pony

Getting the e-scooters in Brussels :

http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/api/scooter/location/zone?city=brussels

Getting all the e-scooters within a distance of 5,55 km of a given location :

http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/api/scooter/location/within?latitude=50.85045&longitude=4.34878&degree=0.05

Getting the 100 nearest e-scooters to a given location :

http://escooter-radar-backend-env.eba-gkj72vkn.eu-west-3.elasticbeanstalk.com/api/scooter/location/near?latitude=50.85045&longitude=4.34878&limit=100

Converting distance from kilometer to degree

Degrees Kilometers
111 km
0.1° 11.1 km
0.01° 1.11 km
0.001° 111 m
0.0001° 11.1 m
0.00001° 1.11 m
0.000001° 0.11 m

JSON Scheme of an e-scooter

{
"bike_id":"cdd2f513-216c-4014-b73e-f2882f08658f",
"company":"Lime",
"city":"brussels",
"location":{"type":"Point","coordinates":[4.391533,50.894786]},
"is_disabled":false,
"is_reserved":false,
"last_reported":1651661817,
"current_range_meters":8571.0
}

Test it yourself

Installation

Without a ssh key:

$ git clone https://github.com/Scooter-Radar/escooter-radar-backend.git

With a ssh key:

$ git clone [email protected]:Scooter-Radar/escooter-radar-backend.git

Launch docker compose:
You need docker installed and added to your PATH environment variables. If its not, download docker here

$ docker-compose up -d

Execution

You need gradle installed and added to your PATH environment variables. If its not, download gradle here

In the project directory, you can run:

$ gradle bootrun

Usage

After running the command above go to one of the following endpoints

To get the e-scooters from a certain escooter sharing company:
https://localhost:8980/api/scooter/provider?company={company}

To get the e-scooters located in a particular city:
https://localhost:8980/api/scooter/location/zone?city={city}

To get the e-scooters located around a certain location:
http://localhost:8980/api/scooter/location/within?latitude={lat}&longitude={lon}&degree={degree}

To get the x nearest e-scooters a certain location:
http://localhost:8980/api/scooter/location/near?latitude={lat}&longitude={lon}&limit={nbOfScooters}

Featured

  • Lime
  • Pony
  • Bird
  • Spin
  • maybe more in the future...

NB: I'm highly dependent on the data made available by the scooter suppliers, so if the api doesn't show the scooters in your city, don't be harsh on me 😥

Author

  • Ayoub Lahyaoui

escooter-radar-backend's People

Contributors

alahyaoui avatar

Stargazers

 avatar

Watchers

 avatar

escooter-radar-backend's Issues

Add option to get only nearby scooters

I need to add option to get only nearby scooters,
currently the only way to get the scooters is by specifying the zone where you want to get the scooters from

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.