GithubHelp home page GithubHelp logo

inditex-shop's Introduction

shop API

This is an API first hexagonal-architecture microservice that serves information about products.

Steps in its creation:

  1. First, the project was generated with Spring initialzr (https://start.spring.io/).
  2. Added openapi-generator in order to generate the API and DTOs from main/resources/api.yml
  3. Moved back from Spring boot 3.0.3 to 2.7.9 because 3.0.0 transitioned to JakartaEE 9 and openapi-generator does not fully support it yet (OpenAPITools/openapi-generator#13124)
  4. Created database (flyway)
  5. Implemented endpoint (tests, controller, service, mapper, product factory)
  6. Refactor and added swagger-ui
  7. Migrated to hexagonal architecture
  8. Release

API docs are also auto generated based on the OpenAPI 3 specification from annotations, available at

Swagger integration available at http://localhost:8080/swagger-ui.html

Tests can be run with ./mvnw clean test

About hexagonal architecture

Hexagonal architecture is a model of designing software applications around domain logic to isolate it from external factors.

In order to achieve this, the code is divided into three layers: application (outside), domain (inside) and infrastructure (outside).

Manually test the microservice

To start the microservice, execute the following command in the root folder of the project:

./mvnw clean package && java -jar target/shop-0.1.1.jar

and you will be able to test the endpoint in the swagger-ui: http://localhost:8080/swagger-ui.html

Dataset

Provided dataset is loaded via flyway and is tested in ProductIntegrationTest.java

Improvements

  1. Decouple domain POJOs from entity POJOs in order to normalize Product class (Product should contain a price and a branch, and the price shouldn't contain a product)

inditex-shop's People

Contributors

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