# aniollidon/palamblock architecture

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

- Interactive diagram: https://gitdiagram.com/aniollidon/palamblock
- Repository: https://github.com/aniollidon/palamblock

## Overview

##### Project Type and Purpose
- The project is a full-stack solution focused on a browser extension – “PalamBlock Extension” – that integrates with a backend service. The README links to the Chrome web store and provides installation instructions for Windows (and likely other OS versions via palamOS and palamOS-linux). This indicates that the software not only implements a browser extension for content blocking/control but also provides server-side administration and possibly OS-level integration.

##### Analyzing the File Structure
- Browser Extension (PalamBlock):
– The “PalamBlock” directory contains typical extension components: manifest.json, background.js, various HTML pages (popup.html, login.html, blocked.html), associated JS scripts, and CSS/image assets.
– This component is responsible for client-side tasks (e.g., communicating with the server, enforcing content filters).

- Server/Backend (palamSRV):
– The “palamSRV” folder resembles a Node.js backend with clearly defined directories for controllers, services, and routes. The controllers (e.g., adminController.js, alumneController.js) and services (e.g., adminService.js, normaService.js) suggest an MVC (Model-View-Controller) or service-oriented architecture.
– Additionally, there are subdirectories for versioned routes (v1) which include admin pages, several HTML/CSS/JS bundles for the admin interface (inside src/v1/admin), and WebSocket endpoints (ws-admin, ws-cast, ws-extention, ws-os). This separation may indicate both RESTful and real-time interactions between the browser extension, admin interface, and other clients.

- OS Integration (palamOS and palamOS-linux):
– These directories suggest that there’s additional code for deeper system integration, likely providing the mechanisms for Windows registration or native integration in different operating systems.

- Other Files:
– A .gitmodules file hints at submodules for external dependencies that could be part of the overall system ecosystem.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser Extension - PalamBlock
    subgraph "Browser Extension – PalamBlock"
        BE1["manifest.json"]:::client
        BE2["background.js"]:::client
        BE3["popup.html"]:::client
        BE4["popup.js"]:::client
        BE5["login.html"]:::client
        BE6["login.js"]:::client
        BE7["blocked.html"]:::client
        BE8["blocked.js"]:::client
        BE9["CSS Assets"]:::client
        BE10["Image Assets"]:::client
    end

    %% Backend Server - palamSRV
    subgraph "Backend Server – palamSRV"
        %% Controllers Subgraph
        subgraph "Controllers"
            C1["Admin Controller"]:::backend
            C2["Alumne Controller"]:::backend
            C3["Historial Controller"]:::backend
            C4["Info Controller"]:::backend
            C5["Norma Controller"]:::backend
            C6["Validacio Controller"]:::backend
        end

        %% Services Subgraph
        subgraph "Services"
            S1["Admin Service"]:::backend
            S2["Alumne Service"]:::backend
            S3["Historial Service"]:::backend
            S4["Info Service"]:::backend
            S5["Norma Service"]:::backend
            S6["Validacio Service"]:::backend
        end

        %% API Routes and WebSocket Endpoints
        subgraph "API & WebSockets"
            API["REST API Routes"]:::backend
            WS1["WS Admin"]:::backend
            WS2["WS Cast"]:::backend
            WS3["WS Extention"]:::backend
            WS4["WS OS"]:::backend
        end

        %% Admin Interface
        AUI["Admin UI"]:::backend

        %% Database Access
        DB["Database Access"]:::backend
    end

    %% OS Integration Modules
    subgraph "OS Integration"
        OS1["palamOS Module"]:::os
        OS2["palamOS-linux Module"]:::os
    end

    %% Connections between major components
    BE1 ---|"loads"| BE2
    BE2 ---|"communicates with"| API
    BE2 ---|"real-time via"| WS3
    BE3 ---|"triggers"| BE4
    BE5 ---|"triggers"| BE6
    BE7 ---|"triggers"| BE8
    BE2 ---|"may interact with"| OS1
    BE2 ---|"may interact with"| OS2

    %% Backend internal interactions
    API --->|"routes call"| C1
    API --->|"routes call"| C2
    API --->|"routes call"| C3
    API --->|"routes call"| C4
    API --->|"routes call"| C5
    API --->|"routes call"| C6

    WS1 --->|"websocket events"| C1
    WS2 --->|"websocket events"| C2
    WS3 --->|"websocket events"| C3
    WS4 --->|"websocket events"| OS1

    C1 -->|"invokes logic"| S1
    C2 -->|"invokes logic"| S2
    C3 -->|"invokes logic"| S3
    C4 -->|"invokes logic"| S4
    C5 -->|"invokes logic"| S5
    C6 -->|"invokes logic"| S6

    S1 -->|"accesses"| DB
    S2 -->|"accesses"| DB
    S3 -->|"accesses"| DB
    S4 -->|"accesses"| DB
    S5 -->|"accesses"| DB
    S6 -->|"accesses"| DB

    AUI --->|"manages"| C1
    AUI --->|"manages"| C2
    AUI --->|"manages"| C3
    AUI --->|"manages"| C4
    AUI --->|"manages"| C5
    AUI --->|"manages"| C6

    %% Click Events for Browser Extension components
    click BE1 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/manifest.json"
    click BE2 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/background.js"
    click BE3 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/popup.html"
    click BE4 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/popup.js"
    click BE5 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/login.html"
    click BE6 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/login.js"
    click BE7 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/blocked.html"
    click BE8 "https://github.com/aniollidon/palamblock/blob/master/PalamBlock/blocked.js"
    click BE9 "https://github.com/aniollidon/palamblock/tree/master/PalamBlock/css"
    click BE10 "https://github.com/aniollidon/palamblock/tree/master/PalamBlock/images"

    %% Click Events for Backend Controllers
    click C1 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/adminController.js"
    click C2 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/alumneController.js"
    click C3 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/historialController.js"
    click C4 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/infoController.js"
    click C5 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/normaController.js"
    click C6 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/controllers/validacioController.js"

    %% Click Events for Backend Services
    click S1 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/adminService.js"
    click S2 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/alumneService.js"
    click S3 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/historialService.js"
    click S4 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/infoService.js"
    click S5 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/normaService.js"
    click S6 "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/services/validacioService.js"

    %% Click Events for API Routes and WebSocket Endpoints
    click API "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/routes"
    click WS1 "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/ws-admin"
    click WS2 "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/ws-cast"
    click WS3 "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/ws-extention"
    click WS4 "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/ws-os"

    %% Click Event for Admin Interface
    click AUI "https://github.com/aniollidon/palamblock/tree/master/palamSRV/src/v1/admin"

    %% Click Event for Database Access
    click DB "https://github.com/aniollidon/palamblock/blob/master/palamSRV/src/database/db.js"

    %% Click Events for OS Integration Modules
    click OS1 "https://github.com/aniollidon/palamblock/tree/master/palamOS"
    click OS2 "https://github.com/aniollidon/palamblock/tree/master/palamOS-linux"

    %% Styling Classes
    classDef client fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef os fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
```
