GithubHelp home page GithubHelp logo

contacts-api's Introduction

Spring boot Rest Api

A rest api in Spring Boot to manage contacts

How to Run

Docker

  1. Clone/Download the repository.

  2. Open the project in the IDE (Netbeans/Intellij Idea/Eclipse) and generate the executable .jar file for the application. The alternate method to generate the .jar file is through Maven.

  3. Open the terminal and go to the directory where docker-compose.yml is located and run the below command in -d (Detach Mode) and will build Spring Boot Rest API Containers.

    docker-compose up -d
    
  4. Run the below command to get the list of running containers :

    docker ps 
    
  5. After executing above steps without any errors and docker containers are up and running, open the browser and navigate to below url:

    http://localhost:8000/swagger-ui.html#/

IDE

  1. Clone/Download the repository.

  2. Open the project in the IDE (Netbeans/Intellij Idea/Eclipse) and generate the executable .jar file for the application. The alternate method to generate the .jar file is through Maven or run mvn package.

  3. Then run from Spring Boot application and do not forget to inject the environment variables

    SPRING_DATABASE_URL=jdbc:postgresql://dimensadb.crygwiotn2wx.us-east-1.rds.amazonaws.com:5432/dimensadb;SPRING_DATABASE_USERNAME=dimensa;SPRING_DATABASE_PASSWORD=senhadimensa123
    

    like the image below img.png

  4. To run the tests just create in Run a JUnit test, all routes on controller are covered en tests.

Deployed system on free service https://render.com/

  https://contacts-api-dc6p.onrender.com/swagger-ui.html#/

Obs:

  1. The https://render.com/ free service asks for a /health get route, which is why it was developed.
  2. In addition, it has a spin down system with inactivity, so the first request made on the link provided will take a significant amount of time, but the other requests will be faster. Therefore, for the first request it will be necessary to wait longer than the others.

contacts-api's People

Contributors

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