GithubHelp home page GithubHelp logo

vehicle-registration's Introduction

Vehicle Registration

Vehicle registration coding task

Task description

Implement a Springboot Project to create some APIS. Latest Springboot and Java 11 is preferred

  • Create person
  • Create vehicle (unique by Vehicle Registration)
  • Link person to a vehicle
  • Unlink person from a vehicle Rules
  • A person can be linked to multiple regos
  • A rego can be linked to only one person Data need not be persisted in DB. In memory storage is fine. Relevant tests, API specs and assumptions are to be documented

Technical stack

  • Spring Boot - version 2.5.2
  • Java 11
  • Liquibase - version 4.3.5 (To create database DDL scripts)
  • Lombok - version 1.18.20
  • Swagger2 - version 3.0.0
  • H2 database

Setup instructions

  • Checkout the source code from this GIT repository.
  • Build the project with mvn install
  • Change directory to <PROJECT_ROOT>\target
  • Run the Spring boot application by running the below command <JAVA_HOME>\bin\java.exe -jar registration-0.0.1-SNAPSHOT.jar com.vehicle.registration.VehicleRegistrationApplication

Swagger API documentation

The Swagger API specification JSON is in the below file.
https://github.com/balajit123/vehicle-registration/blob/main/src/main/resources/swagger/vehicle-registration-0.0.1.json
Access the swagger api documentation from the localhost url while the application is running.
http://localhost:8080/swagger-ui.html#/vehicle-registration-controller

API Payload cURL

  • Create Person
curl --location --request POST 'http://localhost:8080/vehicle-registration/create-person' \ --header 'Content-Type: application/json' \ --data-raw '{ "firstName": "John", "lastName": "Bob" }'
* Create Vehicle
curl --location --request POST 'http://localhost:8080/vehicle-registration/create-vehicle' \ --header 'Content-Type: application/json' \ --data-raw '{ "registrationNumber": "ASD-89P" }'
* Link Person to Vehicle
curl --location --request PATCH 'http://localhost:8080/vehicle-registration/link-person-to-vehicle' \ --header 'Content-Type: application/json' \ --data-raw '{ "firstName": "John", "lastName": "Bob", "registrationNumber": "ASD-89P" }'
* Unlink Person from Vehicle
curl --location --request DELETE 'http://localhost:8080/vehicle-registration/unlink-person-from-vehicle' \ --header 'Content-Type: application/json' \ --data-raw '{ "firstName": "John", "lastName": "Bob", "registrationNumber": "ASD-89P" }'
* Get Person Vehicle Registrations
curl --location --request GET 'http://localhost:8080/vehicle-registration/get-person-vehicle-registrations?firstName=John&lastName=Bob'

vehicle-registration's People

Contributors

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