Giter VIP home page Giter VIP logo

bikes_rental_api's Introduction

Bike Rental REST API

This kata has for goal to create a v2 of this API and take into account new features.

At the same time, v1 will have to keep working as usual and live within the same code repo.

The business logic is really poor here and you have to focus on the way to organize your project to have 2 different versions of a given API.

In this scenario, you operate as a bikes renter like Velib in Paris, France.

V1 API

The V1 API exposes the following endpoints and operations

Bikes

Endpoint : /api/v1/bikes

Operations

GET /api/v1/bikes/{bikeId} to get informations about a bike

Rental

Endpoint : /api/v1/rentals

Operations

POST /api/v1/rentals/ to create a new rental
The body must contain a rental without its id.
PUT /api/v1/rentals/{rentalId} to update or end a rental
The body must contain the updated rental.

User

Endpoint : /api/v1/users

Operations

GET /api/v1/users/{userId} to get informations about a user
POST /api/v1/users/ to create a new user
The body must contain the new user to create.
PUT /api/v1/users/{userId} to update a user
The body must contain the user to update.
DELETE /api/v1/users/{userId} to delete a user

V2 API

For this API version, we have these new needs :

  • You will be able to rent electric scooter and bikes
    • The endpoint changes : /api/v2/equipments
    • The returned object will have an identifier to know what kind of equipment it is
    • The returned object will have an identifier to know if it is electric
  • We need to have information on bikes stations :
    • New endpoint : /api/v2/stations
    • If the station is in altitude, the user will have bonus
    • Ability to find near stations when one is full

And there is also in change in the users API : the id will be a string and no more an integer

V2 API development

How can you do to do that by having just one code base and be able to improve the V2 in the future without being annoyed by V1 ?

How to run this project

You just need to have a JDK 17 and Maven.

To run the project, just type :

mvn spring-boot:run

bikes_rental_api's People

Contributors

acourtes avatar

Watchers

 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.