Code Monkey home page Code Monkey logo

prices-service's Introduction

This API REST has been developed following the following requirements: Enunciado

Prices API REST

  1. Who has developed it?
  2. API First
  3. Running the application
  4. Testing the application
  5. API Documentation
  6. H2 In memory database

1. Who has developed it?

This application has been fully designed and developed by Victor Martin Gil
Check more details about me in my website:

2. API First

This API REST has been designed and developed using the API First methodology.
The API has been designed and documented before any code has been written, as you can check in the api.yaml file.

3. Running the application

Please note that to run this application you will need at least Java 17 version installed in your machine.
To check which java version you have installed in your machine, type the following command in your terminal or command prompt:

java -version

3.2 - Running the application with the .jar packaged application

You can find the prices-service.jar file ready to be executed in the following path:
/package

Open your terminal in the path where you have downloaded it in your computer and run the application with the following command:

java -jar prices-service.jar

The application is running by default in port 8080. If you need to change the port, use this command:

java -jar prices-service.jar --server.port=8085

3.3 - Running the application with your IDE (IntelliJ recommended)

3.3.1 - Generate API files with maven plugin (mvn clean install)

  1. Clone this repository into your local machine.

  2. Use mvn clean install to generate sources specified in the following file: api.yaml

    mvn clean install

This mavend command also will generate the required Mappers with Mapstruct

No you can run the application with your IDE, which will be able by default in the port 8080.

4. Testing the application

4.1 - End-to-end testing

You need to run the application before testing it. Check 3.Running the application.
Be sure the application is running in port 8080, otherwise, update the port in the query in Postman Collection.

There are 5 end-to-end tests readies. You can use one of the following options to run them:

4.2 - Manual testing

You can use the same Postman Collection and you will find a query ready to be executed in the folder "api".

5. API Documentation

The API has been documented through this api.yaml file.
To see this documentation in an appropriate User Interface, while your application is running, you can go to the Swagger UI.
Also, you can use online Swagger Editor and paste the content of the api.yaml file there.

6. H2 In memory database

This application works with H2 in-memory database.
Please note two different databases have been defined, one for test, other for dev environments.

6.1 - H2 Console

To access h2 console, while the application is running, you can go to the following link: http://localhost:8080/h2-console

To log into the database, set the following parameters and credentials to access dev environment database (you can also see them in application.yml file):

  • Driver Class: org.h2.Driver
  • JDBC URL: jdbc:h2:mem:prices-db
  • User Name: sa
  • Password: sa

prices-service's People

Contributors

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