Spring-Boot-Framework / web-app

Angular 7 + Spring boot microservices + PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 7 + Spring boot 2.1 microservices + PostgreSQL 10

Table of contents

Application

This example show application for keeping records of courses, students and teachers.

Architecture

The application is divided into two basic sections, a backend (Spring boot 2.1 microservices) and a frontend (Angular 7).

Relational database schema:

Backend

Backend side is composed of spring boot applications that are organized according to microservice architecture.
There are a few microservices:

  • faculty
  • report
  • config
  • eureka
  • zuul

Each microservice can be built as a Docker image and assembled so that with one command it is possible to create and run all microservices from the configuration.

Faculty

This microservice provides basic create, read, update, and delete (CRUD) operations.
Faculty microservice use Spring Data JPA to store and retrieve data in a relational database (PostgreSQL) with provided pagination for GET method.
Lombok is a library which facilitates many tedious tasks and it reduce Java source code verbosity (no need for getters, setters and constructors).
Swagger offers the most powerful and easiest to use tools to take full advantage of the OpenAPI Specification (document, test).

Report

This microservice generate a report and comunicate with faculty microservice.
This communication is easily implemented using feign.
Client-side load balancing is provided by ribbon (for multiple instances of faculty miscroservice).
The report can be generated as pdf, saved or printed thanks to jasper.

Config

This microservice (Spring Cloud Config) provides server and client-side support for externalized configuration in a distributed system. It is a central location for managing external microservice properties in all environments. Properties can be stored in a local file, a git repository or a git cloud repository such as GitHub.

Eureka

This microservice (Client-side service discovery) allows microservices to find and communicate with each other without hard-coding hostname and port. Each microservice is registered with this microservice during startup.

Zuul

This microservice (Zuul Api Gateway) is a gateway application that handles all the requests and performs dynamic routing of microservice applications.

Frontend

Frontend side is Angular 7 application with Angular Material theming with animations and some extra things such as open an external link in new tab (for backend administration), embeded pdf file... Also, sorting, filtering and pagination is provided (pagination on the frontend and backend).

Running

Requirement:

To start the backend, start the microservices from STS in the order shown on the application architecture.
To start the frontend, run the following commands in VSC:

npm install
ng serve -o

You will also need to provide some CORS plugin for your browser.

Screenshots

Report generated from app

Directions for further development

In progress:

  • Spring security
  • Spring profiles
  • AWS

About

Angular 7 + Spring boot microservices + PostgreSQL


Languages

Language:Java 41.6%Language:TypeScript 37.8%Language:HTML 12.2%Language:CSS 4.7%Language:JavaScript 2.4%Language:Dockerfile 1.2%