Book Reservation

codecov CircleCI

Build simple Rest API using Spring Boot by implementing TDD. Using Maven as dependency management, Mockito an JUnit as for testing extension and H2 as in-memory database. Create test case for each layer (persistence, service, controller). Using Codecov for coverage, TravisCI CircleCI for CI/CD and Docker for containerisation.

image

Getting Started

Prerequisites

Before using this app, you need to prepare several things listed below. If you're able to run all these commands below, you're good to go 🥳

  1. Installed Java
    java -version
  2. Maven
    mvn -v
  3. Git
    git --version
    
  4. Docker
    docker version
    
How to Run

To run this project, you have 3 options :

  1. Run in you local

    • Clone this repository
    • You can run test and build the project by running mvn clean package
    • Start the app by typing mvn spring-boot:run from the root project directory to start the application.
    • Since we're using H2 as our in-memory database, you can launch the console by visiting http://localhost:8080/h2-console
  2. Run using docker

    • First, pull the docker image docker pull mariesto/book-reservation-spring-boot
    • Make sure it's already pulled docker image ls
    • Run the docker docker run -p 8080:8080 book-reservation-spring-boot
    • Now you can use the API as you wish
  3. Save the best for the last (Play with Docker) 🤩

API Documentation

You can check the API documentation by run this application and hit http://localhost:8080/swagger-ui.html

Reference

This project related to article in medium : https://medium.com/easyread/interact-with-docker-b7f99e7ca26c