Skip to content

This is a microservice application created using Spring Boot and Spring Cloud

Notifications You must be signed in to change notification settings

Ratnesh2003/book-microservices

Repository files navigation


Logo

Book Microservices

A microservice application built using Spring Boot and Spring Cloud.

Table of Contents
  1. Introduction
  2. Getting Started
  3. Services Ports
  4. Usage
  5. Roadmap
  6. Contributing

Introduction

This application showcases the use of Spring Cloud for a microservice application. It is a basic application for a bookstore platform. Admins can manage books and their availability in the inventory. They can also lend books to users and facilitate book returns.

List of microservices

Each of the microservice has its own README file with detailed information about the service.

(back to top)

Built With

  • SpringBoot
  • Prometheus
  • Grafana
  • Cassandra
  • Mongodb
  • Postgresql
  • Docker

(back to top)

Screenshots

This section shows the screenshots of some of the additional tools and services used in the application.

eureka prometheus

monitoring keycloak

zipkin tracing

(back to top)

Getting Started

Prerequisites

Installation

  • Make a copy of the .env.example file and rename it to .env. Fill in the environment variables in the file.

    cp .env.example .env
  • Run the following command to run the docker-compose file.

    docker-compose up -d
  • Now you can start each of the microservice using the following command inside each of the microservice directory.

    ./mvnw spring-boot:run

(back to top)

Services Ports

  • Microservices:
    • Book Service : 8282
    • Inventory Service : 8383
    • Loan Service : 8484
    • Notification Service : 8585
    • Discovery Server : 8761
    • API Gateway : 8080
    • Apache Kafka: 9092

  • Metrics and Monitoring:
    • Keycloak : 8181
    • Zipkin : 9411
    • Prometheus : 9090
    • Grafana : 3000

  • Databases:
    • Cassandra : 9042
    • MongoDB : 27017
    • PostgreSQL : 5432

Usage

This section shows how to use the services provided by the application.

Book Service

This service is used to manage books. Admins can add, modify and delete books from the database. The service uses MongoDB as the database.
Complete documentation here.

Inventory Service

This service is used to manage the availability of books. Admins can update the availability of books in the inventory. The service uses PostgreSQL as the database.
Complete documentation here.

Loan Service

This service is used to lend and receive books from users. Admins can lend books to users and receive books from users. The service uses Cassandra as the database.
Complete documentation here.

(back to top)

Roadmap

  • Add documentation for each of the microservices.
  • Add gmail smtp server for sending emails in notification service.
  • Add redis for caching and improving performance.
  • Add rate limiting for the API Gateway.
  • Add more events for the notification service.

(back to top)

Contributing

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with theenhancementtag.

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/new_feature
  3. Commit your Changes
    git commit -m 'Add new_feature'
  4. Push to the Branch
    git push origin feature/new_feature
  5. Open a Pull Request

(back to top)