Microservices Reservation System

Table of Contents

  1. Project Overview
  2. Tasks

Project Overview

This project aims to create a reservation management application based on a microservices architecture. 
The application will handle reservations for resources, with each reservation associated with
a single resource.

A resource is defined by its ID, name, and type (MATERIEL_INFO, MATERIEL_AUDIO_VISUEL). 
A reservation is defined by its ID, name, context, date, and duration, and is made by a person. 
A person is defined by their ID, name, email, and function.

The application consists of two functional microservices:

  • Resources-Service: Manages resources.
  • Reservation-Service: Manages reservations made by people.

The technical microservices to be implemented are:

  • Service Gateway: Based on Spring Cloud Gateway.
  • Service Discovery: Based on Eureka Server.
  • Service Configuration: Based on Spring Cloud Config.

For the application,

  • A web frontend will be developed using the Angular framework.
  • Security will be based on OAuth2 and OIDC with Keycloak as the identity provider.
  • Microservices will generate RESTful web service documentation using the OpenAPI Specification Swagger.
  • Circuit breakers based on Resilience4J will be used for fault tolerance.

Tasks

1. Technical Architecture

Technical architecture for the project, including the microservices and their interactions. Identify the technologies and tools used for each component.

arch (1)

2. Maven Project

Create a Maven project that includes the following microservices:

image

  • resources-service
C:.
│   .gitignore
│   Dockerfile
│   HELP.md
│   mvnw
│   mvnw.cmd
│   pom.xml
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───dev
│   │   │       └───moudni
│   │   │           └───resourcesservice
│   │   │               │   ResourcesServiceApplication.java
│   │   │               │
│   │   │               ├───dtos
│   │   │               │       ResourceRequestDTO.java
│   │   │               │       ResourceResponseDTO.java
│   │   │               │
│   │   │               ├───entites
│   │   │               │       Resource.java
│   │   │               │
│   │   │               ├───enums
│   │   │               │       ResourceType.java
│   │   │               │
│   │   │               ├───exceptions
│   │   │               │       ResourceNotFoundException.java
│   │   │               │
│   │   │               ├───mappers
│   │   │               │       ResourceMapper.java
│   │   │               │
│   │   │               ├───repository
│   │   │               │       ResourceRepository.java
│   │   │               │
│   │   │               ├───security
│   │   │               │       JwtAuthConverter.java
│   │   │               │       SecurityConfiguration.java
│   │   │               │
│   │   │               ├───service
│   │   │               │       ResourceService.java
│   │   │               │       ResourceServiceImpl.java
│   │   │               │
│   │   │               └───web
│   │   │                       ResourceController.java
│   │   │
│   │   └───resources
│   │       │   application.properties
│   │       │
│   │       ├───static
│   │       └───templates
│
  • reservation-service
C:.
│   .gitignore
│   Dockerfile
│   HELP.md
│   mvnw
│   mvnw.cmd
│   pom.xml
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───dev
│   │   │       └───moudni
│   │   │           └───reservationservice
│   │   │               │   ReservationServiceApplication.java
│   │   │               │
│   │   │               ├───entites
│   │   │               │       Person.java
│   │   │               │       Reservation.java
│   │   │               │
│   │   │               ├───enums
│   │   │               │       ResourceType.java
│   │   │               │
│   │   │               ├───feign
│   │   │               │       FeignInterceptor.java
│   │   │               │       ResourceFeign.java
│   │   │               │
│   │   │               ├───model
│   │   │               │       Resource.java
│   │   │               │
│   │   │               ├───repository
│   │   │               │       PersonRepository.java
│   │   │               │       ReservationRepository.java
│   │   │               │
│   │   │               ├───security
│   │   │               │       JwtAuthConverter.java
│   │   │               │       SecurityConfiguration.java
│   │   │               │
│   │   │               └───web
│   │   │                       PersonController.java
│   │   │                       ReservationController.java
│   │   │
│   │   └───resources
│   │       │   application.properties
│   │       │
│   │       ├───static
│   │       └───templates
  • gateway-service
C:.
│   .gitignore
│   Dockerfile
│   HELP.md
│   mvnw
│   mvnw.cmd
│   pom.xml
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───dev
│   │   │       └───moudni
│   │   │           └───gatewayservice
│   │   │                   GatewayServiceApplication.java
│   │   │
│   │   └───resources
│   │           application.properties
│   │           application.yml
  • discovery-service
C:.
│   .gitignore
│   Dockerfile
│   HELP.md
│   mvnw
│   mvnw.cmd
│   pom.xml
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───dev
│   │   │       └───moudni
│   │   │           └───discoveryservice
│   │   │                   DiscoveryServiceApplication.java
│   │   │
│   │   └───resources
│   │           application.properties
  • config-service
C:.
│   .gitignore
│   Dockerfile
│   HELP.md
│   mvnw
│   mvnw.cmd
│   pom.xml
│
├───src
│   ├───main
│   │   ├───java
│   │   │   └───dev
│   │   │       └───moudni
│   │   │           └───configurationservice
│   │   │                   ConfigurationServiceApplication.java
│   │   │
│   │   └───resources
│   │           application.properties
  • angular-front-app

3. Technical Microservices Development and Testing

Develop and test the following microservices:

  • Discovery Service:

image

  • Gateway Service:

image

image

  • Config Service:

image

image

config git repository : https://github.com/el-moudni-hicham/exam-config-git-repo

4. Resources-Service Development and Testing

Develop and test the resources-service microservice, including:

- Entities
- DAO (Data Access Object)
- Service
- DTO (Data Transfer Object)
- Mapper
- RestController
  • H2 Database

image

  • Endpoints Tests

image

image

  • Swagger

image

image

5. Reservation-Service Development and Testing

Develop and test the reservation-service microservice, including:

- Entities
- DAO
- Service
- DTO
- Mapper
- RestController
- Rest client using Open Feign
  • H2 Database

image

image

  • Endpoints Tests

image

  • Resilience4J

image

  • Swagger

image

image

image

6. Angular Frontend

Develop a simple web frontend for the application using the Angular framework.

  • Login Page :

image

  • Dashboard Reservations

image

  • Display Reservator Infos

image

  • Display Resource Infos

image

  • Display Resource Infos in case of fault tolerance

image

  • Reservators

image

  • Resources

image

7. Security

Secure the application with Keycloak for authentication.

image

image

image

image

8. Deployment with Docker

Deploy the application using Docker and Docker Compose.

image

image

image

Now frontend app is accessible in port 8083 instead of 4200

image