Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danielmachadovasconcelos/base-vertx-spring
Base application that mix vertx reactive with spring boot
https://github.com/danielmachadovasconcelos/base-vertx-spring
gradle postgres spring-boot vertx
Last synced: 20 days ago
JSON representation
Base application that mix vertx reactive with spring boot
- Host: GitHub
- URL: https://github.com/danielmachadovasconcelos/base-vertx-spring
- Owner: DanielMachadoVasconcelos
- Created: 2022-04-18T08:21:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-20T18:41:45.000Z (over 2 years ago)
- Last Synced: 2024-11-01T02:23:37.335Z (2 months ago)
- Topics: gradle, postgres, spring-boot, vertx
- Language: Java
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Order Service
## Base vertx with Spring Boot#### Daniel Machado Vasconcelos
### Basic requirements (that were implemented):
* Use Dependency Injection and Inversion of Control;
* Use Flyway to configure the database tables;
* Make sure to log all the request to the applications;### Extra requirements to be done:
* ~~Replace the console logs for log4j~~
* ~~Include Postgres database integration~~
* Expose metrics and health checks
* Provide authentication and authorisation
* ~~Replace the JsonObjects for Data Models~~
* Make sure to log `correlation_id` and `event_id`---
Prerequisites
-------------* Java JDK 17
* Gradle
* Docker / Docker Compose#### Resources
* Postgres### Tech Stack usage
**Postgres**
Simple SQL database to persist the data. It can be flexible to use json data in a event source style
## How to build?
Start the external resources by running the docker-compose file. (It may take a while to start all resources)
```bash
docker-compose up -d
```Start the service that expose the REST API by running the class: `Application.java`
####Use the following commands to place an order and fetch orders by id :
### To place an order
```bash
curl --location --request POST 'localhost:8080/orders' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_id": "123456789",
"amount": 4500
}'
```
### To get the order
```bash
curl --location --request GET 'localhost:8080/orders/{order_id}' \
--header 'Content-Type: application/json' \```