Code Monkey home page Code Monkey logo

carlease-main's Introduction

Car Lease Main

This project is the main assembly point of the service projects. It contains services as git submodules. To clone use the recursive flag.

git clone --recursive https://github.com/remideboer/carlease-main.git

Works was started on Customer Service, which consequently has received the most work and attention

Manage submodules

Get latest updates from submodules

git submodule update --remote --merge

Run

Docker

build and run with docker compose

docker-compose up --build -d

# or

docker-compose up --build -d --remove-orphans

Manual

Three services are used: Gateway, Car Service, Customer Service. The services can be started separately. See documentation in the README for each service cd into directory and run maven for each service

mvn spring-boot:run

# for the development profile use

mvn spring-boot:run -Dspring-boot.run.profiles=dev

Script

Use supplied script deploy.sh to clean package and run all 3 in one go.

To brute force stop use terminate.sh. Only works on *nix systems. On Windows use something like below, or terminate.ps1

netstat -ano | findstr :PORT_NUMBER
taskkill /pid PORT_NUMBER /f
// or power shell
$ports= @('8080','9091','9092')
foreach ($i in $ports) {
    $processPID =  $($(netstat -aon | findstr $i)[0] -split '\s+')[-1]
    taskkill /f /pid $processPID
}

Services

ports Gateway: 8080 Customer service: 9092 Car service: 9091

URL Mapping

AUTHENTICATION

  • POST: {domain}/authenticate - authenticate using username and password to obtain a JWT

Customer Contract Data

  • GET: {domain}/contracts?{cust_id,car_id,mileage,interest,duration} - fetches customer data and contract lease rate data for specific customer id and car id

CARS

  • GET: {domain}/cars - returns al cars
  • GET: {domain}/cars/{id} - returns specific cars
  • POST {domain}/cars - create new carsw
  • DELETE: {domain}/cars{id} - delete specific cars
  • PUT: {domain}/cars{id} - update specific cars
  • GET: {domain}/cars{id}/leaserate?{mileage,interest,duration} - calculculates leaserate for given car. required parameters

CUSTOMERS

  • GET: {domain}/customers - returns al customers
  • GET: {domain}/customers/{id} - returns specific customer
  • POST {domain}/customers - create new customer
  • DELETE: {domain}/customers/{id} - delete specific customer
  • PUT: {domain}/customers/{id} - update specific customer

get in

Using the most secure overused password in the world.

admin:Welkom01
broker:Welkom01
POST {domain}/authenticate - authentication endpoint see below example 

POST authenticate request body example

{
  "username": "admin",
  "password": "Welkom01"
}

response example

{
    "id": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvY2FybGVhc2UuY29tIiwic3ViIjoiYWRtaW4iLCJleHAiOjE2MjQwMzQzMTB9.BJ1CLXOpVjnTv8uEmjUgw6yrzMJhIzMOvqHsZKN0Av4"
}

carlease-main's People

Contributors

remideboerhva avatar

Watchers

Rémi de Boer 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.