An open API service indexing awesome lists of open source software.

https://github.com/ngdangkietswe/ndk-microservices

Microservices | gRPC | Redis | Docker | PostgreSQL | RabbitMQ | ElasticSearch | Jenkins, ...
https://github.com/ngdangkietswe/ndk-microservices

docker elasticsearch grpc java jwt microservices postgresql rabbitmq redis spring-boot spring-cloud

Last synced: 3 months ago
JSON representation

Microservices | gRPC | Redis | Docker | PostgreSQL | RabbitMQ | ElasticSearch | Jenkins, ...

Awesome Lists containing this project

README

          

# DKMicroservices

Simple Microservices with Spring Boot and gRPC

## Prerequisites

- [Docker](https://docs.docker.com/engine/install/)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)

## Installing required tools

- Once the prerequisites are installed, run the command in folder ***/docker***.

```
docker-compose -f docker-compose.yml up -d
```

![docker-compose](./docs/docker-compose.png)

- Docker Containers

![docker-containers](./docs/docker-containers.png)

## System Architecture

![system-architecture](./docs/system-architecture.png)

## Project Structure and Technical Stack

- Project Structure

![project-structure](./docs/project-structure.png)
- Technical Stack



Spring Cloud
Spring Security
Rest Server
gRPC Server
Postgresql
RabbitMQ
ElasticSearch
Redis


Config Server
x









Service Registry
x

x







Api Gateway
x
x
x


x

x


Auth Service
x
x

x






Employee Service
x


x
x
x




Department Service
x


x
x





Notification Service
x


x
x
x




Location Service
x


x






Tracking Service
x


x

x
x



Recruitment Service
x


x
x
x




Attendance Service
x


x
x
x


- Services Port



Rest Server Port
gRPC Server Port


Config Server
8088



Service Registry
8761



Api Gateway
8003



Auth Service
8004
8040


Employee Service
8002
8020


Department Service
8001
8010


Notification Service
8005
8050


Location Service
8006
8060


Tracking Service
8007
8070


Recruitment Service
8008
8080


Attendance Service
8009
8090

## Run on Local

- Run with IntelliJ IDEA

- Run command in root project ***/dkmicroservices***

```
mvn clean install
```

- Maven

![maven](./docs/maven.png)

- Service run order: service-registry, config-server > department-service, employee-service, auth-service,
notification-service > api-gateway

![service](./docs/service.png)

- Open browser and type _http://localhost:8761_. All services already started

![eureka](./docs/eureka.png)

- Type _http://localhost:8003/swagger-ui/index.html_

![swagger](./docs/swagger.png)

## Run Project with Docker
- Need only download *docker-compose.prod.yml*
- Run command
```
docker-compose up -d
```
- Containers

![docker-container-prod](./docs/docker-container-prod.png)
## CI/CD

- Pipeline

![pipeline](./docs/pipeline.png)

- Jenkins

![jenkins](./docs/jenkins.png)

![cicd-api-gateway](./docs/cicd-api-gateway.png)

- Docker Hub

![dockerhub](./docs/docker-hub.png)