This example show application for keeping records of courses, students and teachers.
The application is divided into two basic sections, a backend (Spring boot 2.1 microservices) and a frontend (Angular 7).
Relational database schema:
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.
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).
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.
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.
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.
This microservice (Zuul Api Gateway) is a gateway application that handles all the requests and performs dynamic routing of microservice applications.
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).
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.
- Spring security
- Spring profiles
- AWS