Giter Club home page Giter Club logo

coffee-with-me's Introduction

Coffee With Me

This application was developed for learning purposes and some architectural decisions could and probably should otherwise have been taken differently.

Table of Contents

  1. Application
  2. Running the application
  3. Application structure
  4. Technologies
  5. API Documentation

Application

Keywords:

  • Microservices
  • Saga Pattern
  • Event-driven
  • Spring
  • MySQL

The application consists of the following components:

  • Discovery Server
  • API Gateway
  • Auth Service
  • Social Service
  • Notification Service
  • Documentation Service: API documentation

Running the application

To run the application, run eureka server and gateway first, then the three services.

The easiest approach is to build the services first:

mvn clean install -DskipTests

And then launch them with docker-compose:

docker-compose up --build 

The application will be available at http://localhost:3000.

This will also launch PHPMyAdmin at http://localhost:8181

Running the server locally

In order to run the server locally you will first need to build it. To build and package a Spring Boot app into a single executable Jar file with Maven, you can use the command below. You will need to run it from the root project folder which contains the pom.xml file.

mvn package -DskipTests

or you can use

mvn install -DskipTests

To run the Spring Boot app from a terminal you can you the java -jar command. The executable jar files can then be run individually with

java -jar gateway\target\gateway-0.0.1-SNAPSHOT.jar
java -jar eureka-server\target\discovery-0.0.1-SNAPSHOT.jar
java -jar social-service\target\social-service-0.0.1-SNAPSHOT.jar
java -jar notification-service\target\notification-service-0.0.1-SNAPSHOT.jar
java -jar auth-service\target\auth-service-0.0.1-SNAPSHOT.jar

You can also use the Spring Boot Maven plugin to run the app. Then you can use the snippet below to run the application:

mvn spring-boot:run

IDEA

You can follow any/all of the above commands, or simply use the run configuration provided by your favorite IDE and run/debug the application from there for development purposes.

Local development

For local development it is recommended to start eventuate-tram, the message broker and RDBMS first by running

docker-compose -f docker-compose-dev.yml

And then starting the applications manually.

Once the application is running, the services can be accessed over the following base-path:

http://localhost:8080/api/

Some of the important API endpoints are as follows:

Application Structure

The application is built as several microservices with an API Gateway to proxy incoming requests to the appropriate service using Spring Cloud Netflix Zuul and Eureka Server Registration and Discovery. They communicate internally with the help of choreography-based sagas for distributed data management with messaging through Apache Kafka.

Technologies

The following libraries, among others, were used during the development of this application:

  • Spring Boot - Server side framework
  • Docker - Containerizing framework
  • MySQL - RDBMS
  • Apache Kafka - Distributed streaming platform
  • Eventuate Tram - Framework for distributed data management
  • Spring Cloud Netflix Zuul - JVM based router and server side load balancer
  • Spring Cloud Netflix Eureka - Client side service discovery
  • JWT - Authentication mechanism for REST APIs

API Documentation

API documentation via Swagger can be found at http://localhost:8080/api/docs/swagger-ui.html

coffee-with-me's People

Contributors

eirsteir 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.