# aureldp/localoge-kubernetes architecture

> Architecture diagram of the GitHub repository aureldp/localoge-kubernetes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aureldp/localoge-kubernetes
- Repository: https://github.com/aureldp/localoge-kubernetes

## Overview

##### Project Type and Purpose
- The project is a full-stack web application for renting properties.
- The front end is built with NodeJS and React, while the back end is composed of several containerized microservices developed in Java using Spring Boot.
- Additionally, the project includes a MySQL database service and is designed to be deployed on a cloud using Docker containers orchestrated by Kubernetes and managed via the Istio service mesh.

##### File Structure – Main Directories/Components
- client – Contains the front-end React application (with Vite configuration, package.json, etc.).
- server – Contains multiple subdirectories:
- databaseService – Likely provides the MySQL database with its Dockerfile and initialization SQL script.
- housingService – A Spring Boot microservice, including controllers, DAOs, models, exceptions, and services.
- rentalService – Another Spring Boot microservice covering rental functionality, with similar layered organization.
- reservationService – The third Spring Boot microservice focused on handling reservations.
- kubernetes – Houses the YAML configuration files for deploying all these services along with ingress and scripts to apply them.
- .run – Contains runnable configurations and scripts for building and running services, which indicate various deployment/testing modes like “docker build”, “clean package”, and “run simple spring”.

##### Extracting Key Architectural Insights from README
- The README clearly specifies that the architecture separates the front end (NodeJS/React) and back end (Java microservices).
- The back end is split into three distinct microservices (housingService, rentalService, and reservationService) plus a separate database service.
- The deployment environment is cloud-based (using Minikube and Kubernetes) with integration of Istio for network and gateway management.
- Containerization with Docker is explicit, and Kubernetes YAML files are provided to define how each service should be deployed.

a. Main Components:
- Frontend (Client): NodeJS/React application.
- Backend Microservices:
– Housing Service (Spring Boot)
– Rental Service (Spring Boot)
– Reservation Service (Spring Boot)
- Database Service: MySQL container (with its initialization script)
- Container Orchestration:
– Kubernetes cluster (including YAML declarations)
– Istio service mesh for network gateway management.
- Deployment & Build Infrastructure:
– Docker containers for each service.
– Build scripts and run configurations indicated in the .run folder.

b. Relationships and Interactions:
- The Client interacts with the back-end microservices via REST APIs.
- The microservices themselves interact with the MySQL database (possibly through direct connections defined in the Spring Boot configuration).
- Kubernetes orchestrates the deployment of all Docker containers (front end may be served separately or behind an ingress).
- Istio controls the gateway and routing between the microservices and external traffic.

c. Architectural Patterns & Design Principles:
- Microservices architecture: Each business domain (housing, rental, reservation) is encapsulated in its own service.
- Containerization: All services are containerized using Docker.
- Cloud-Native Deployment: Leveraging Kubernetes for orchestration and Istio for service mesh management.
- Standard REST API communication between front end and microservices.

d. Technologies, Frameworks, & Libraries:
- Frontend: React, NodeJS, Vite.
- Backend: Java 17, Spring Boot, Maven (pom.xml) for dependency management.
- Database: MySQL.
- DevOps & Deployment: Docker, Kubernetes, Istio (including specific YAML files and scripts), Minikube for local cluster simulation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        A["Client (React, NodeJS/Vite)"]:::frontend
    end

    subgraph "Infrastructure Layer"
        B["Istio Service Mesh"]:::infrastructure
        C["Kubernetes Cluster"]:::infrastructure
    end

    subgraph "Kubernetes Cluster"
        D["Housing Service (Spring Boot)"]:::microservice
        E["Rental Service (Spring Boot)"]:::microservice
        F["Reservation Service (Spring Boot)"]:::microservice
        G["Database (MySQL, Docker)"]:::database
        D --- E
        E --- F
        F --- G
    end

    H["Deployment & Build Scripts"]:::deployment
    I["Kubernetes Configs (Istio & YAML)"]:::deployment

    A -->|"REST_API_Calls"| B
    B -->|"Routes_Traffic"| C
    C -->|"Executes"| D
    C -->|"Executes"| E
    C -->|"Executes"| F
    D -->|"Reads_Writes"| G
    E -->|"Reads_Writes"| G
    F -->|"Reads_Writes"| G
    H -->|"Build_Deploy"| C
    I -->|"Deploy_Config"| C

    click A "https://github.com/aureldp/localoge-kubernetes/tree/main/client/"
    click D "https://github.com/aureldp/localoge-kubernetes/tree/main/server/housingService/"
    click E "https://github.com/aureldp/localoge-kubernetes/tree/main/server/rentalService/"
    click F "https://github.com/aureldp/localoge-kubernetes/tree/main/server/reservationService/"
    click G "https://github.com/aureldp/localoge-kubernetes/tree/main/server/databaseService/"
    click I "https://github.com/aureldp/localoge-kubernetes/tree/main/server/kubernetes/"
    click H "https://github.com/aureldp/localoge-kubernetes/tree/main/.run/"

    classDef frontend fill:#ffcccc,stroke:#333,stroke-width:2px,color:#000;
    classDef microservice fill:#ccffcc,stroke:#333,stroke-width:2px,color:#000;
    classDef database fill:#ccccff,stroke:#333,stroke-width:2px,color:#000;
    classDef infrastructure fill:#ffffcc,stroke:#333,stroke-width:2px,color:#000;
    classDef deployment fill:#ffccff,stroke:#333,stroke-width:2px,color:#000;
    classDef invisibleLink stroke:#ffffff,stroke-width:0px;

    linkStyle 10,11,12 stroke:#ffffff,stroke-width:0px;color:transparent;
```
