# jhipster/jhipster-sample-app architecture

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

- Interactive diagram: https://gitdiagram.com/jhipster/jhipster-sample-app
- Repository: https://github.com/jhipster/jhipster-sample-app

## Overview

##### Main Components Identification

The system consists of these primary components:
- Frontend (Angular application)
- Backend (Spring Boot application)
- Database (PostgreSQL)
- Authentication/Authorization layer
- Monitoring & Management components

**Client Layer**
- Angular Frontend (src/main/webapp/app/)
- Feature Modules (entities, admin, account)
- Shared Components
- Core Services

**API Layer**
- REST Controllers (src/main/java/.../web/rest/)
- Security Filters
- JWT Authentication

**Service Layer**
- Business Services
- DTO Mappers
- Security Services

**Data Access Layer**
- JPA Repositories
- Domain Entities
- Liquibase Migrations

**Infrastructure Layer**
- PostgreSQL Database
- Monitoring (Prometheus/Grafana)
- JHipster Control Center

##### Component Details

Frontend (Angular):
- Core Modules
- Authentication
- Layouts
- Shared Services
- Feature Modules
- Bank Account
- Operation
- Admin Modules

Backend (Spring Boot):
- REST Controllers
- Service Layer
- Business Logic
- DTO Mapping
- Repository Layer
- Security
- JWT Authentication
- Authorization

##### Additional Elements

Include:
- External service connections (Sonar, Docker)
- Development tools integration
- Testing infrastructure (Cypress, Jest, Gatling)
- Build/deployment flow

##### Architectural Patterns to Highlight

- MVC pattern in frontend
- Layered architecture in backend
- REST API design
- Microservice-ready structure
- Security patterns (JWT)

##### Notes for Implementation

- Use standardized UML notation where applicable
- Keep component sizes proportional to their complexity
- Related components visually
- Version information
- Deployment considerations

Remember to include the monitoring and management aspects (Prometheus, Grafana, JHipster Control Center) as they are integral parts of the production setup.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef security fill:#f1c40f,stroke:#f39c12,color:black
    classDef database fill:#9b59b6,stroke:#8e44ad,color:white
    classDef monitoring fill:#e67e22,stroke:#d35400,color:white

    %% Client Layer
    subgraph ClientLayer["Client Layer"]
        Frontend["Angular Frontend"]
        CoreModules["Core Modules"]
        FeatureModules["Feature Modules"]
        AdminModules["Admin Modules"]
        Auth["Authentication"]
        Layouts["Layouts"]
    end

    %% API Layer
    subgraph APILayer["API Layer"]
        RestControllers["REST Controllers"]
        SecurityFilters["Security Filters"]
        JWTAuth["JWT Authentication"]
    end

    %% Service Layer
    subgraph ServiceLayer["Service Layer"]
        BusinessServices["Business Services"]
        DTOMappers["DTO Mappers"]
        SecurityServices["Security Services"]
    end

    %% Data Access Layer
    subgraph DataLayer["Data Access Layer"]
        JPARepos["JPA Repositories"]
        DomainEntities["Domain Entities"]
        LiquibaseMigrations["Liquibase Migrations"]
    end

    %% Infrastructure Layer
    subgraph InfraLayer["Infrastructure Layer"]
        PostgreSQL["PostgreSQL Database"]
        Prometheus["Prometheus"]
        Grafana["Grafana"]
        JHipsterCC["JHipster Control Center"]
    end

    %% Relationships
    Frontend --> RestControllers
    CoreModules --> Frontend
    FeatureModules --> Frontend
    AdminModules --> Frontend
    Auth --> Frontend
    Layouts --> Frontend

    RestControllers --> SecurityFilters
    SecurityFilters --> JWTAuth
    RestControllers --> BusinessServices
    BusinessServices --> DTOMappers
    BusinessServices --> SecurityServices
    DTOMappers --> JPARepos
    JPARepos --> DomainEntities
    DomainEntities --> PostgreSQL
    LiquibaseMigrations --> PostgreSQL

    PostgreSQL --> Prometheus
    Prometheus --> Grafana
    PostgreSQL --> JHipsterCC

    %% Click Events
    click CoreModules "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/webapp/app/core/"
    click FeatureModules "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/webapp/app/entities/"
    click AdminModules "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/webapp/app/admin/"
    click Auth "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/webapp/app/core/auth/"
    click Layouts "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/webapp/app/layouts/"
    click RestControllers "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/java/io/github/jhipster/sample/web/rest/"
    click BusinessServices "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/java/io/github/jhipster/sample/service/"
    click JPARepos "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/java/io/github/jhipster/sample/repository/"
    click DomainEntities "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/java/io/github/jhipster/sample/domain/"
    click SecurityFilters "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/java/io/github/jhipster/sample/security/"
    click PostgreSQL "https://github.com/jhipster/jhipster-sample-app/blob/main/src/main/docker/postgresql.yml"
    click LiquibaseMigrations "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/resources/config/liquibase/"
    click Prometheus "https://github.com/jhipster/jhipster-sample-app/blob/main/src/main/docker/prometheus/prometheus.yml"
    click Grafana "https://github.com/jhipster/jhipster-sample-app/tree/main/src/main/docker/grafana/"
    click JHipsterCC "https://github.com/jhipster/jhipster-sample-app/blob/main/src/main/docker/jhipster-control-center.yml"
    click JWTAuth "https://github.com/jhipster/jhipster-sample-app/blob/main/src/main/java/io/github/jhipster/sample/config/SecurityJwtConfiguration.java"

    %% Style Applications
    class Frontend,CoreModules,FeatureModules,AdminModules,Auth,Layouts frontend
    class RestControllers,BusinessServices,DTOMappers backend
    class SecurityFilters,JWTAuth,SecurityServices security
    class PostgreSQL,JPARepos,DomainEntities,LiquibaseMigrations database
    class Prometheus,Grafana,JHipsterCC monitoring
```
