Skip to content

Micro Services for Ordering System for some (hardware) products.

Notifications You must be signed in to change notification settings

camillaborges/restful-api-microservice

Repository files navigation

Micro Services for Ordering System


Micro Services for Ordering System for some (hardware) products.

Table of Contents

Introduction

It is a RESTful API build on top of microservice architecture focused on ordering system.

Features

Those are the features available:

  • Manage Product catalog:
    • allow adding new products to catalog;
    • allow removing products from the catalog;
    • get information about stock for a specific product;
    • manage product stock (increase or decreasing the number of available items);
  • Manage Ordering of Products from the catalog:
    • create new order
      • only known products are orderable;
      • check on stock is done;
      • orders have a state (running, delivered, cancelled);
    • order can have its state updated:
      • the product stock is updated on delivery of the order;
      • show status and content of orders;

Requirements

The application can run locally, the requirements for each setup are listed below:

Local

Docker (needed for Zipkin)

Quick Start

Make sure to have Docker started on your local machine.

Start Zipkin

Start Zipkin application on its default port 9411. In order to do that, run the following command:

$ docker run -d -p 9411:9411 openzipkin/zipkin

Run Spring Boot applications

Start each Spring Boot application in the respective order:

  1. service-registry
  2. config-server
  3. product-service
  4. inventory-service
  5. order-service
  6. api-gateway

For example, go to the respective application's folder, and run:

$ cd ./service-registry
$ mvn spring-boot:run

Each application will run on its pre-defined port. Another option is to run them on the IDE of your preference.

Knows more at the Microservice Architecture section.

API Usage

A Postman Collection can be found at this repository.

The collection has all the available endpoints within this project.

Microservice Architecture

Below is the overview of the project's architecture: Micro service architecture

Database Diagram

Below is the overview of the project's database diagram: Micro service architecture

Remarks

Below are some remarks, stuff not yet done but seen as possible improvements:

  • Use spring-boot-starter-validation to provide validation for the requests;
  • Reducing microservice duplicity of Java Objects with shared libraries;
  • Implement some sort of Security;
  • Write Unit tests (JUnit);
  • Change @repository layers to have a real Database like PostgresSQL instead of List and HashMap;

About

Micro Services for Ordering System for some (hardware) products.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages