Giter Club home page Giter Club logo

order-management's Introduction

order-management

Headers

Prerequisites

Setup

  • Download any IDE that work with Gradle and Springboot

  • Install MongoDb

    • Follow Mongo DB setup from here setup
    • Create database named orderManagement and collection named orderDetails
    • Create another collection named userLogin for authentication
  • Install Kafka (Steps are different for Windows): version kafka_2.13-3.2.0

Install zookeeper and kakfa
  • WSL2 - Virtual linx environment in Windows (Ubuntu is default)
    wsl --install --ubuntu

  • Download Kafka
    wget https://archive.apache.org/dist/kafka/3.2.0/kafka_2.13-3.2.0.tgz

  • Extract Kafka and move to desired folder
    tar xzf kafka_2.13-3.2.0.tgz mv kafka_2.13-3.2.0 ~ cd kafka_2.13-3.2.0/

    PATH="$PATH:~/kafka_2.13-3.2.0/bin"

  • Start zookeeper

    ~/kafka_2.13-3.2.0/bin/zookeeper-server-start.sh ~/kafka_2.13-3.2.0/config/zookeeper.properties

  • Start kafka

    ~/kafka_2.13-3.2.0/bin/kafka-server-start.sh ~/kafka_2.13-3.2.0/config/server.properties /home/exzion/kafka_2.13-3.2.0/bin

  • Create topic

    ~/kafka_2.13-3.2.0/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic order-details

  • List topics

    ~/kafka_2.13-3.2.0/bin/kafka-topics.sh --bootstrap-server localhost:9092 --list

  • Edit server.properties of kafka in vi and add map local host URL

    advertised.listeners=PLAINTEXT://127.0.0.1:9092\
    listener.security.protocol.map=PLAINTEXT:PLAINTEXT\
    listeners=PLAINTEXT://0.0.0.0:9092
    

Start server

.\gradlew bootRun

Run test cases

.\gradlew clean test --info

Postman collection updated in repo\

  • order-management.postman_collection.json

  • Use below end point to generate token
    /order_management/v1/login

Authentication

  • For all other secured end points add following headers

Headers

curl --location --request POST 'http://localhost:9050/order_management/v1/orders' \
--header 'Content-Type: application/json' \
--header 'Cookie: user=exzion' \
--header 'x-auth-token: cc830fca-115b-44a4-94f9-1e937a8b76a4' \
--data-raw ' { "expectedDeliveryDate": "",
 "shipmentAddress": "Chennai, INdia",
 "customerName": "Anand",
 "customerId": "99999",
 "phoneNumber": "9952563200",
 "productList": [{
    "productId": "P8971",    
    "productName": "HOme products",   
    "price": 500,    
    "productType" : "Decor"
 },{
    "productId": "P8171",    
    "productName": "Item1",   
    "price": 100,    
    "productType" : "Fashion"
 }]
 
 }

order-management's People

Contributors

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