# houarizegai/fullstack-angular-springboot architecture

> Architecture diagram of the GitHub repository houarizegai/fullstack-angular-springboot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/houarizegai/fullstack-angular-springboot
- Repository: https://github.com/houarizegai/fullstack-angular-springboot

## Overview

##### Main Components
- Frontend: The Angular application located in the “crm-frontend” directory. It includes various components like login, menu, customer-form, customers, footer, error, welcome, and services (handling authentication, HTTP requests, data services, etc.).
- Backend: The SpringBoot application located in the “crm-rest” directory built using Maven. It exposes RESTful API endpoints (e.g., CustomerController, BasicAuthenticationController, JWT-based controllers) and includes layered packages for models, repositories, services, and security configuration (Spring Security with JWT).
- Database: Although not explicitly detailed in a separate “database” directory, the backend’s “data.sql” and “application.properties” suggest a relational database (or an embedded database) is used to persist customer data.
- Security Component: Both systems implement security: the Angular frontend calls endpoints secured via Spring Security, and the backend has components handling Basic Authentication and JWT (with dedicated controllers, token filters, and configuration classes).

##### Architectural Patterns / Design Principles
- Full-stack separation: Clear division between the Angular client (presentation layer) and the SpringBoot server (business logic & data access).
- Component-based design: Angular’s modular design, where each distinct feature (login, customer management, etc.) exists as its own component.
- Layered Architecture on the backend: Controllers, Services, and Repositories, emphasizing separation of concerns.
- RESTful API design: Highlight that the backend is exposing endpoints for operations like authentication, customer CRUD operations, and token management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Client["Client Browser"]:::client

    %% Angular Frontend
    subgraph "Angular Frontend"
        subgraph "UI Components"
            Login["Login Component"]:::frontend
            Menu["Menu Component"]:::frontend
            CustomerForm["Customer Form Component"]:::frontend
            Customers["Customers Component"]:::frontend
            Error["Error Component"]:::frontend
            Footer["Footer Component"]:::frontend
            Welcome["Welcome Component"]:::frontend
        end
        subgraph "Angular Services"
            BasicAuthService["Basic Authentication Service"]:::frontend
            HttpInterceptor["HTTP Interceptor Service"]:::frontend
            CustomerData["Customer Data Service"]:::frontend
            WelcomeData["Welcome Data Service"]:::frontend
            RouteGuard["Route Guard Service"]:::frontend
        end
    end

    %% SpringBoot Backend
    subgraph "SpringBoot Backend"
        SpringBootApp["SpringBoot Application"]:::backend
        SpringBootApp --> BasicAuthCtrl
        SpringBootApp --> CustomerCtrl
        SpringBootApp --> JwtAuthCtrl
        subgraph "REST API Controllers"
            BasicAuthCtrl["Basic Authentication Controller"]:::backend
            CustomerCtrl["Customer Controller"]:::backend
            JwtAuthCtrl["JWT Authentication Controller"]:::backend
        end
        subgraph "Service Layer"
            CustomerService["Customer Service"]:::backend
        end
        subgraph "Repository Layer"
            CustomerRepository["Customer Repository"]:::backend
        end
        subgraph "Security Components"
            BasicAuthSec["Basic Authentication Security Config"]:::backend
            JwtWebSec["JWT Web Security Config"]:::backend
            JwtTokenFilter["JWT Token Filter"]:::backend
            JwtTokenUtil["JwtTokenUtil"]:::backend
            JwtUserDetails["JwtUserDetails"]:::backend
        end
    end

    Database["Database"]:::database

    %% Connections
    Client -->|"accesses"| Welcome
    Welcome -->|"calls"| BasicAuthService
    BasicAuthService -->|"RESTcall"| BasicAuthCtrl
    BasicAuthCtrl -->|"invokes"| CustomerService
    CustomerCtrl -->|"invokes"| CustomerService
    JwtAuthCtrl -->|"invokes"| CustomerService
    CustomerService -->|"queries"| CustomerRepository
    CustomerRepository -->|"persists"| Database
    BasicAuthCtrl -.->|"secured_by"| BasicAuthSec
    JwtAuthCtrl -.->|"secured_by"| JwtWebSec
    CustomerCtrl -.->|"token_validated_by"| JwtTokenFilter
    JwtTokenFilter -->|"uses"| JwtTokenUtil
    JwtTokenFilter -->|"uses"| JwtUserDetails

    %% Click Events - Angular UI Components
    click Login "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/login/login.component.ts"
    click Menu "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/menu/menu.component.ts"
    click CustomerForm "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/customer-form/customer-form.component.ts"
    click Customers "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/customers/customers.component.ts"
    click Error "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/error/error.component.ts"
    click Footer "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/footer/footer.component.ts"
    click Welcome "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/welcome/welcome.component.ts"

    %% Click Events - Angular Services
    click BasicAuthService "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/service/basic-authentication.service.ts"
    click HttpInterceptor "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/service/http/http-intercepter-basic-auth.service.ts"
    click CustomerData "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/service/data/customer-data.service.ts"
    click WelcomeData "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/service/data/welcome-data.service.ts"
    click RouteGuard "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-frontend/src/app/service/route-guard.service.ts"

    %% Click Events - SpringBoot Backend
    click SpringBootApp "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/CrmRestApplication.java"
    click BasicAuthCtrl "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/controller/BasicAuthenticationController.java"
    click CustomerCtrl "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/controller/CustomerController.java"
    click JwtAuthCtrl "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/jwt/resource/JwtAuthenticationRestController.java"
    click CustomerService "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/service/CustomerService.java"
    click CustomerRepository "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/repository/CustomerRepository.java"
    click BasicAuthSec "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/basic/auth/SpringSecurityConfigBasicAuth.java"
    click JwtWebSec "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/jwt/JWTWebSecurityConfig.java"
    click JwtTokenFilter "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/jwt/JwtTokenAuthorizationOncePerRequestFilter.java"
    click JwtTokenUtil "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/jwt/JwtTokenUtil.java"
    click JwtUserDetails "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/java/com/houarizegai/crm/restfulwebservices/jwt/JwtUserDetails.java"

    %% Click Events - Database Configuration
    click Database "https://github.com/houarizegai/fullstack-angular-springboot/blob/master/crm-rest/src/main/resources/application.properties"

    %% Styles
    classDef client fill:#ffffcc,stroke:#333,stroke-width:2px;
    classDef frontend fill:#ADD8E6,stroke:#007bff,stroke-width:2px;
    classDef backend fill:#90EE90,stroke:#228B22,stroke-width:2px;
    classDef database fill:#FAD7A0,stroke:#E69500,stroke-width:2px;
```
