Giter Site home page Giter Site logo

bagiasn / book-spot Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 443 KB

Sample microservices application using spring-boot and golang

Java 33.25% CSS 1.41% HTML 12.97% JavaScript 21.50% Dockerfile 7.55% Go 7.17% Shell 16.16%
spring-boot java microservices go docker-compose

book-spot's Introduction

Build Status

Logo

About

BookSpot is a microservices demo application. It is a web-based book rating app.

The aim of this project is to showcase how we can setup a local development environment when working with microservices, since the hurdles of replicating a diverse production stack can be many.

Services

Name Description
gateway Acts as an API gateway that routes requests to downstream services
catalog Provides CRUD endpoints for all available books
user Provides CRUD endpoints for users along with login session
announcement-server Generates (fake) announcement events
announcement-publisher Listens for announcements and publishes them to connected clients

Build with

Various technologies/frameworks were used in order to speed development and, happily, all of them are open-source:

  • Spring Boot - Catalog, user and gateway use Spring Boot, a popular Java framework, along with many of its plugins, such as Spring Data JPA/REST/Redis.
  • PostgresSQL - Postgres is the RDBMS used for persistent storage by both catalog and user.
  • Redis - In-memory database serving as caching layer. Also used for storing login session info.
  • Zuul - Gateway uses Netflix's Zuul as a gateway proxy.
  • Gorilla - Announcement-publisher utilizes gorilla to provide a WebSockets server, written in Go.
  • gRPC-Go - Announcement-server uses this library as a gRPC server and publisher as a gRPC client.
  • Faker - Fake data generator, used by announcement-server, written in Go.

All Java services were developed in IntelliJ IDEA Ultimate Edition (2019.3.3) (Educational license).

All Go services were developed in VS Code.

Last but not least, HTML/CSS/JS & Semantic UI were used for frontend development.

The following diagram shows how all these fit together:

Architecture-diagram

How to run

In order to avoid problems from different local configurations/runtimes, all services can run on docker containers. For convenience, various docker-compose configurations were created:

  • docker-compose.yml: Starts only Postgres and Redis, useful for everyday development, where you work and test individual services.
  • docker-compose.dev.yml: Starts all services using the local build context, useful for checking how the whole system works locally.
  • docker-compose.all.yml: Starts all services, by pulling pre-built images from Docker Hub.

So, assuming you are in the project's root directory you can start the system by executing:

docker-compose -f docker-compose.all.yml up

All things well, you can verify that the application runs at:

127.0.0.1:8080

To stop press Ctrl+C or run

docker-compose -f docker-compose.all.yml stop

replace stop with down to destroy all containers, images etc.

Note

This project is part of my MSc thesis.

book-spot's People

Contributors

bagiasn avatar

Stargazers

Anthony Roussos avatar Sambo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.