# danicvan/fluig-api-template architecture

> Architecture diagram of the GitHub repository danicvan/fluig-api-template, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danicvan/fluig-api-template
- Repository: https://github.com/danicvan/fluig-api-template

## Overview

##### Project type and purpose
- This is a **backend template**: a Spring Boot–based WAR that runs on TOTVS Fluig and exposes secure REST APIs (e.g., `/ping`, `/`).
- Purpose: provide a starting point for integrations (DocuSign, SAP, Protheus) on the Fluig platform.

##### File structure
- Top level contains Maven config (`pom.xml`), CI workflow (`.github/workflows/build.yml`), and `README.md`.
- `src/main/java/br/suaempresa/fluigapi` holds the Spring Boot application class and controllers.
- Packaging is WAR, so it targets an external servlet container (Fluig’s Tomcat).

##### README for additional insights
- Tech stack: Java 11, Spring Boot 2.6.3, Maven, WAR packaging.
- Mentions secure REST API and typical integration use cases.

##### Key reminders
- Be **detailed**: separate controllers, business logic, and integration clients.
- **deployment aspect** (WAR in Fluig).

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef internal fill:#D0E8FF,stroke:#0366d6;
    classDef deployment fill:#E6FFFA,stroke:#2c9c7c;
    classDef external fill:#FFF4E6,stroke:#D9822B;
    classDef docs fill:#F5F5F5,stroke:#666;

    subgraph "Project Root"
        POM["pom.xml"]:::docs
        CI[".github/workflows/build.yml"]:::docs
        README["README.md"]:::docs
    end

    Client["Client (Fluig UI / Consumer)"]:::external

    subgraph "Fluig Platform (Servlet Container)"
        direction TB
        Container["Tomcat Servlet Container"]:::deployment
        Container --> SpringApp
    end

    SpringApp["Spring Boot Application\n(FluigApiApplication)"]:::internal

    subgraph "Application Layers"
        direction TB
        Dispatcher["Spring DispatcherServlet"]:::internal
        Dispatcher --> HC
        Dispatcher --> PL
        HC["HealthCheckController"]:::internal
        PL["Other Controllers (placeholder)"]:::internal
        HC --> Services
        PL --> Services
        Services["Service Layer (business logic)"]:::internal
        Services --> Integrations
        Integrations["Integration Layer (external API clients)"]:::internal
    end

    Integrations -->|REST/SOAP| DocuSign["DocuSign API"]:::external
    Integrations -->|REST/SOAP| SAP["SAP"]:::external
    Integrations -->|REST/SOAP| Protheus["Protheus"]:::external

    Client --> Container
    SpringApp --> Dispatcher

    click POM "https://github.com/danicvan/fluig-api-template/blob/main/pom.xml"
    click CI "https://github.com/danicvan/fluig-api-template/blob/main/.github/workflows/build.yml"
    click README "https://github.com/danicvan/fluig-api-template/blob/main/README.md"
    click SpringApp "https://github.com/danicvan/fluig-api-template/blob/main/src/main/java/br/suaempresa/fluigapi/FluigApiApplication.java"
    click HC "https://github.com/danicvan/fluig-api-template/blob/main/src/main/java/br/suaempresa/fluigapi/controller/HealthCheckController.java"
    click PL "https://github.com/danicvan/fluig-api-template/tree/main/src/main/java/br/suaempresa/fluigapi/controller"
```
