# team-scandela/scandela architecture

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

- Interactive diagram: https://gitdiagram.com/team-scandela/scandela
- Repository: https://github.com/team-scandela/scandela

## Overview

##### Main Components
- Frontend Clients:
- The main web interface: Located under the “scandelapp” directory (a ReactJS application). It contains components, pages (e.g., home, features, admin, etc.), assets, and styles.
- Browser Extension: Located under “browserExtension”. This is an independent module offering an extension-based UI with its own React components.
- Additional Frontend: “newVitrine” and “forward” directories show alternative ways or variants of the web interface (possibly experimental designs or different deployment modes). Include them if they are used in production.
- Backend Server:
- “server” directory: A Java-based backend (likely Spring Boot given the structure) with controllers, services, DAOs (data access objects), entities, and configuration. This handles APIs, business logic, authentication (controllers such as LoginController, NotificationController, etc.), and likely interacts with a database.
- Integration & Deployment:
- Docker: Dockerfile(s) in “server” and docker-compose files (docker-compose.yml and docker-compose.dev.yml) indicate containerized deployment.
- CI/CD: The .github/workflows folder with CI.yaml and deploy.yaml shows continuous integration and deployment mechanisms.
- External Dependencies:
- Although not explicitly shown as a separate module, the server layer typically interacts with a database (implied by the use of DAOs and entities).
- Other external services might include email systems (EmailController and EmailService), payment APIs (StripeWebhookController and StripeService), and mapping systems (hinted by components such as “Map”, “Legends”, “RadarChartComponent”, etc.).

##### Relationships and Interactions between Components
- User devices/browsers access the web portal and browser extension, which communicate via HTTPS with the backend’s RESTful APIs.
- The ReactJS frontends (scandelapp, newVitrine) leverage a rich component hierarchy (as seen in the numerous subdirectories inside “scandelapp/src/components”) to render maps, charts, and data related to streetlights.
- The backend server (built in Java) exposes endpoints via its multiple controllers (LampController, AdminController, etc.) and orchestrates the interactions with the database through DAOs.
- Docker and CI/CD pipelines ensure that both frontend and backend components are built, deployed, and maintained consistently.

##### Architectural Patterns and Design Principles
- Component-Based Architecture for the frontend (ReactJS with clearly separated components, pages, hooks, and utilities).
- Layered/MVC Pattern in the backend (controllers, service layer, DAOs, and entities) which clearly separates concerns.
- Micro Frontends or Multi-Client Support: Different frontends (browserExtension, newVitrine, executable) imply that the system is built to support various client applications or views.
- Containerized Deployment with Docker and automation via CI/CD (GitHub workflows).
- Emphasis on modularity as seen by separate directories for tests (both frontend and backend) and documentation.

##### Relevant Technologies, Frameworks, and Libraries
- Frontend: ReactJS, TypeScript or JavaScript (with CSS for styling, and webpack configurations).
- Backend: Java (with Spring Boot, inferred by package structure), Maven for builds, and JUnit for testing.
- Deployment: Docker, Docker Compose.
- CI/CD: GitHub Actions for continuous integration and deployment.
- Others: Various utility libraries, possibly mapping libraries, and a potential relational database (not explicitly shown but assumed due to DAO/use).

## Diagram (Mermaid)

```mermaid
graph TD
  %% Frontend Subgraph
  subgraph "Frontend"
    A1("Main Web Interface (ReactJS)") 
    A2("Browser Extension")
    A3("Additional Frontend (newVitrine)")
    A4("Additional Frontend (forward)")
    A5("Executable Frontend Module")
  end

  %% Backend Subgraph
  subgraph "Backend"
    B1("Backend Server (Java-based)")
    B2(("Database"))
  end

  %% Deployment & Integration Subgraph
  subgraph "Deployment & Integration"
    D1("Dockerfile (scandelapp)")
    D2("Dockerfile.dev (scandelapp)")
    D3("Dockerfile (server)")
    D4("Dockerfile.dev (server)")
    D5("docker-compose.yml")
    D6("docker-compose.dev.yml")
    D7("CI Pipeline")
    D8("Deploy Pipeline")
  end

  %% External Dependencies Subgraph
  subgraph "External Dependencies"
    E1("External Services (Payment,Email,Mapping)")
  end

  %% Interactions between Frontend and Backend
  A1 -->|"HTTPS_API"| B1
  A2 -->|"HTTPS_API"| B1
  A3 -->|"HTTPS_API"| B1
  A4 -->|"HTTPS_API"| B1
  A5 -->|"HTTPS_API"| B1

  %% Backend interactions
  B1 -->|"DAO_calls"| B2
  B1 -->|"API_calls"| E1

  %% Deployment interactions with Backend & Frontend
  D1 --> B1
  D2 --> B1
  D3 --> B1
  D4 --> B1
  D5 --> B1
  D6 --> B1
  D7 -->|"Deploys"| B1
  D8 -->|"Deploys"| B1
  D7 --> A1
  D7 --> A2
  D7 --> A3
  D7 --> A4
  D7 --> A5
  D8 --> A1
  D8 --> A2
  D8 --> A3
  D8 --> A4
  D8 --> A5

  %% Styling Classes
  class A1,A2,A3,A4,A5 frontend;
  class B1 backend;
  class D1,D2,D3,D4,D5,D6,D7,D8 deployment;
  class E1 external;
  class B2 database;

  %% Click Events for Frontend Components
  click A1 "https://github.com/team-scandela/scandela/tree/master/scandelapp/"
  click A2 "https://github.com/team-scandela/scandela/tree/master/browserExtension/"
  click A3 "https://github.com/team-scandela/scandela/tree/master/newVitrine/"
  click A4 "https://github.com/team-scandela/scandela/tree/master/forward/"
  click A5 "https://github.com/team-scandela/scandela/tree/master/executable/"

  %% Click Event for Backend
  click B1 "https://github.com/team-scandela/scandela/tree/master/server/"

  %% Click Events for Docker & Deployment Files
  click D1 "https://github.com/team-scandela/scandela/tree/master/scandelapp/Dockerfile"
  click D2 "https://github.com/team-scandela/scandela/blob/master/scandelapp/Dockerfile.dev"
  click D3 "https://github.com/team-scandela/scandela/tree/master/server/Dockerfile"
  click D4 "https://github.com/team-scandela/scandela/blob/master/server/Dockerfile.dev"
  click D5 "https://github.com/team-scandela/scandela/blob/master/docker-compose.yml"
  click D6 "https://github.com/team-scandela/scandela/blob/master/docker-compose.dev.yml"
  click D7 "https://github.com/team-scandela/scandela/blob/master/.github/workflows/CI.yaml"
  click D8 "https://github.com/team-scandela/scandela/blob/master/.github/workflows/deploy.yaml"

  %% Class Definitions
  classDef frontend fill:#A7D7C5,stroke:#333,stroke-width:2px;
  classDef backend fill:#F9E79F,stroke:#333,stroke-width:2px;
  classDef deployment fill:#AED6F1,stroke:#333,stroke-width:2px;
  classDef external fill:#F5B7B1,stroke:#333,stroke-width:2px;
  classDef database fill:#D2B4DE,stroke:#333,stroke-width:2px;
```
