An open API service indexing awesome lists of open source software.

https://github.com/beemi/lat-long-spring-boot-service

Lat Long Spring boot service
https://github.com/beemi/lat-long-spring-boot-service

java

Last synced: 8 months ago
JSON representation

Lat Long Spring boot service

Awesome Lists containing this project

README

          

# Spring boot Lat long service

This is a simple Spring boot service that returns the latitude and longitude of a given postcode.

## πŸ“‹ Requirements

- β˜• Java 17
- πŸ—οΈ Gradle
- 🐬 MySQL
- 🐘 Spring Boot
- 🐬Liquibase
- 🐳 Docker
- 🧩 Docker-compose
- πŸ“¬ Postman

# Project structure :file_folder:
```angular2html
.
β”œβ”€β”€ build.gradle
β”œβ”€β”€ gradle
β”‚Β Β  └── wrapper
β”‚Β Β  β”œβ”€β”€ gradle-wrapper.jar
β”‚Β Β  └── gradle-wrapper.properties
β”œβ”€β”€ gradlew
β”œβ”€β”€ gradlew.bat
β”œβ”€β”€ README.md
β”œβ”€β”€ settings.gradle
src
β”œβ”€β”€ main
β”‚Β Β  β”œβ”€β”€ java
β”‚Β Β  β”‚Β Β  └── com
β”‚Β Β  β”‚Β Β  └── example
β”‚Β Β  β”‚Β Β  └── latlong
β”‚Β Β  β”‚Β Β  config
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ LatLongConfig.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ LatLongSwaggerConfig.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ LatLongApplication.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ controller
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── LatLongController.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ model
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ LatLong.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── Postcode.java
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ service
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ LatLongService.java
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── PostcodeService.java
β”‚Β Β  β”‚Β Β  └── util
β”‚Β Β  β”‚Β Β  └── LatLongUtil.java
β”‚Β Β  └── resources
β”‚Β Β  β”œβ”€β”€ application.properties
```

### 🐳 Run the Application with Docker-compose

This application uses MySQL as the backend database. To run the application along with MySQL in Docker containers, use
the following command:

### ▢️ Run the Application Locally

```shell
docker-compose up -d
```

```bash
gradle bootRun
```

Build with Gradle:

```bash
gradle clean build
```

Run test with Gradle:

```bash
gradle test
```

Run jar:

```bash
java -jar build/libs/latlong-spring-boot-service-1.0.0.jar
```

## Swagger UI :books:

http://localhost:80890/api-docs/

http://localhost:8090/swagger-ui/index.html

### Actuator info endpoint :thumbsup:

Actuator health endpoint

http://localhost:8090/actuator/health