Skip to content

sokimaaa/reactive-grpc-bookstore

Repository files navigation

Reactive Grpc Bookstore

Objective

Spring Boot Application for bookstore inventory management.

Functionality includes:

  1. Ability to explore bookstore by different input criteria goto
  2. Registration at the inventory new kind of books goto
  3. Supplying books that ready to purchase goto
  4. The option to purchase (or withdraw) the book goto
  5. Updating the information for customer goto

In context of project, ISBN is numeric commercial book identifier that is intended to be unique. Even in case of full copy of book.

In context of project, since ISBN is unique even for copies of books, we need to have another identificator of the similar books, e.g. checksum. Checksum considered to be generated by author, title, edition fields of book.

Technology Stack

  • Java 17
  • Spring Boot 3
  • Project Reactor
  • Reactive Grpc
  • R2DBC
  • Postgres
  • Testcontainers
  • Gradle
  • Docker

Architecture Perspective

For learning curve had chose the hexagonal architecture. The main goal was to provide as flexible as possible project where business logic does not loosely depend on framework, technology stack and et cetera. Specifically it represents four modules:

  • java-domain
  • proto-domain
  • usecase
  • infrastructure

ER Diagram

goto

Build and Run

Run postgres database with sql script or

docker run -d \
  --name postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_DB=bookstore \
  -p 5432:5432 \
  -v "./2-database/init.sql:/docker-entrypoint-initdb.d/init.sql" \
  postgres:14.0

Initial project build

gradle clean build -xtest

On the infrastructure level present main class Starter to launch manually or

gradle run

Or using docker compose

docker compose up -d

Docker compose mainly needed for e2e tests to start environment via testcontainers.

About

Hexagonal Architecture | Spring Boot | gRPC | R2DBC | Project Reactor | Gradle

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages