# dsevilla/ssdd architecture

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

- Interactive diagram: https://gitdiagram.com/dsevilla/ssdd
- Repository: https://github.com/dsevilla/ssdd

## Overview

##### Main Components
- Frontend Components:
- “proyecto/frontend” and “ejemplos/frontend/flask-example”: These represent web UI components built with Python/Flask.
- “proyecto/llamachat”: A standalone chat application with its own Docker configurations.
- Backend Components:
- “proyecto/backend-grpc” and its example counterpart “ejemplos/backend/grpc”: These house gRPC-based services, each having client/server implementations and using protocol buffers (.proto files).
- “proyecto/backend-rest” (and its examples in “ejemplos/backend/rest-jersey”): Contain RESTful services likely implemented using Jersey.
- “proyecto/backend”: Provides additional backend functionality with DAO (data access objects) and business logic.
- Persistence and Databases:
- “proyecto/db-mongo” and “proyecto/db-mysql”: Docker configurations and initialization files for MongoDB and MySQL respectively, which serve as the data persistence layers.
- Common/Supporting Infrastructure:
- Docker and Docker-Compose files at the project’s root and in various folders signal containerized deployments.
- Build tools (like Maven with pom.xml files) and Makefiles indicate standardized build and deployment methods across components.

##### Relationships and Data Flow
- From the frontend side, illustrate two main UI systems (Flask-based web app and the chat app) that interact with the backend services through distinct API calls (gRPC calls for gRPC services, HTTP/REST for REST services).
- That the backend services interact with their designated databases (MongoDB for NoSQL operations and MySQL for relational data) using separate persistence modules (as seen with DAO implementations).
- That Docker-Compose setups tie these components together, suggesting networked communication between containers.

##### Architectural Patterns and Technologies
- Microservices or service-oriented architecture: Each backend module (gRPC, REST, DAO-driven services) is separated into its own service with clearly defined APIs and responsibilities.
- Containerization: Illustrate that each major component might run as a Docker container, referencing the multiple Dockerfiles and docker-compose configuration files.
- Technologies and frameworks: Label components with the precise technology used (e.g., Java with Maven for backend services, Jersey for REST, gRPC for RPC communication, Flask for the frontend, and Docker/Mongo/MySQL for persistence).

## Diagram (Mermaid)

```mermaid
graph TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        FrontendFlask["Frontend - Flask UI"]:::frontend
        FlaskExample["Flask Example (ejemplos)"]:::frontend
        Llamachat["Frontend - Llamachat"]:::frontend
    end

    %% Backend Services
    subgraph "Backend Services"
        subgraph "gRPC Services"
            GRPCMain["Backend - gRPC Service (Main)"]:::backend
            GRPCExample["Backend - gRPC Service (Example)"]:::backend
        end
        subgraph "REST Services"
            RESTMain["Backend - REST Service (Main)"]:::backend
            RESTExample["Backend - REST Service (Example)"]:::backend
        end
        DAOModule["Backend - DAO Module"]:::backend
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        MongoDB["Database - MongoDB"]:::database
        MySQL["Database - MySQL"]:::database
    end

    %% Deployment & Containerization
    subgraph "Deployment & Containerization"
        Deployment["Deployment Infrastructure"]:::container
    end

    %% Connections from Presentation to Backend
    FrontendFlask -->|"gRPC_call"| GRPCMain
    FrontendFlask -->|"HTTP_Request"| RESTMain
    FlaskExample -->|"HTTP_Request"| RESTMain
    Llamachat -->|"HTTP_Request"| RESTMain

    %% Connections within Backend
    GRPCMain -->|"DAO_access"| DAOModule
    GRPCExample -->|"DAO_access"| DAOModule
    RESTMain -->|"DAO_access"| DAOModule
    RESTExample -->|"DAO_access"| DAOModule

    %% Connections from Backend to Persistence
    DAOModule -->|"NoSQL/JDBC"| MongoDB
    DAOModule -->|"SQL/JDBC"| MySQL

    %% Deployment connections (dotted to show containerization)
    FrontendFlask -.->|"dockerized"| Deployment
    FlaskExample -.->|"dockerized"| Deployment
    Llamachat -.->|"dockerized"| Deployment
    GRPCMain -.->|"dockerized"| Deployment
    GRPCExample -.->|"dockerized"| Deployment
    RESTMain -.->|"dockerized"| Deployment
    RESTExample -.->|"dockerized"| Deployment
    DAOModule -.->|"dockerized"| Deployment
    MongoDB -.->|"dockerized"| Deployment
    MySQL -.->|"dockerized"| Deployment

    %% Click Events
    click FrontendFlask "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/frontend"
    click FlaskExample "https://github.com/dsevilla/ssdd/tree/24-25/ejemplos/frontend/flask-example"
    click Llamachat "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/llamachat"
    click GRPCMain "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/backend-grpc"
    click GRPCExample "https://github.com/dsevilla/ssdd/tree/24-25/ejemplos/backend/grpc"
    click RESTMain "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/backend-rest"
    click RESTExample "https://github.com/dsevilla/ssdd/tree/24-25/ejemplos/backend/rest-jersey"
    click DAOModule "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/backend"
    click MongoDB "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/db-mongo"
    click MySQL "https://github.com/dsevilla/ssdd/tree/24-25/proyecto/db-mysql"
    click Deployment "https://github.com/dsevilla/ssdd/blob/24-25/proyecto/docker-compose.yml"

    %% Styles
    classDef frontend fill:#a2d2ff,stroke:#333,stroke-width:2px;
    classDef backend fill:#89c2d9,stroke:#333,stroke-width:2px;
    classDef database fill:#ffadad,stroke:#333,stroke-width:2px;
    classDef container fill:#fdffb6,stroke:#333,stroke-width:2px;
```
