# stedt-project/sss architecture

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

- Interactive diagram: https://gitdiagram.com/stedt-project/sss
- Repository: https://github.com/stedt-project/sss

## Overview

##### Main Components

a) Web Interface Layer:
- Multiple interface versions (Chiangmai, Lund, RootCanal, Singapore)
- RootCanal as the primary interface
- PHP-based Singapore experimental interface

b) Application Logic Layer:
- Perl-based core (STEDT::RootCanal namespace)
- CGI::Application framework
- Data processing modules (Table, RootCanal components)

c) Data Management Layer:
- Database system (implied by SQL scripts)
- Data archiving components
- Semantic classification system

##### Key Architectural Elements

**[Web Layer]**
- RootCanal Interface (primary)
- Singapore Interface (PHP)
- Legacy Interfaces (Chiangmai, Lund)

**[Application Layer]**
- Core STEDT Modules
- RootCanal Components
- Table Management
- User Management
- Search Functions

**[Data Layer]**
- Database
- Archiving System
- Semantic Classification

##### Important Relationships

- Data flow between application modules and database
- Separate flows for search, edit, and archiving operations
- Semantic classification as a special subsystem with its own data flow

##### Technical Details

- Technology stack:
- Perl/CGI::Application
- PHP (Singapore version)
- JavaScript/jQuery
- SQL Database

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style definitions
    classDef web fill:#3498db,stroke:#2980b9,color:white
    classDef app fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef process fill:#e67e22,stroke:#d35400,color:white
    classDef archive fill:#9b59b6,stroke:#8e44ad,color:white
    classDef experimental fill:#e74c3c,stroke:#c0392b,color:white

    subgraph Web_Layer
        RC["RootCanal Interface"]:::web
        SI["Singapore Interface (PHP)"]:::experimental
        CI["Chiangmai Interface"]:::web
        LI["Lund Interface"]:::web
    end

    subgraph App_Layer
        CORE["Core STEDT Modules"]:::app
        TM["Table Management"]:::app
        UM["User Management"]:::app
        SF["Search Functions"]:::app
        JS["JavaScript/jQuery"]:::app
    end

    subgraph Data_Layer
        DB[(Database)]:::data
        AS["Archiving System"]:::archive
        SC["Semantic Classification"]:::data
    end

    subgraph Processing
        PY["Python Scripts"]:::process
        DR["Data Rendering"]:::process
    end

    %% Relationships
    RC --> CORE
    SI --> CORE
    CI --> CORE
    LI --> CORE

    CORE --> TM
    CORE --> UM
    CORE --> SF
    CORE --> JS

    TM --> DB
    UM --> DB
    SF --> DB
    
    DB --> AS
    DB --> SC

    DB --> PY
    PY --> DR
    DR --> RC

    %% Click events
    click RC "https://github.com/stedt-project/sss/tree/master/rootcanal/web/"
    click SI "https://github.com/stedt-project/sss/tree/master/singapore/php/"
    click CI "https://github.com/stedt-project/sss/tree/master/chiangmai/"
    click LI "https://github.com/stedt-project/sss/tree/master/lund/public_html/"
    click CORE "https://github.com/stedt-project/sss/tree/master/rootcanal/perl/STEDT/RootCanal/"
    click TM "https://github.com/stedt-project/sss/tree/master/rootcanal/perl/STEDT/Table/"
    click UM "https://github.com/stedt-project/sss/blob/master/rootcanal/perl/STEDT/RootCanal/Account.pm"
    click SF "https://github.com/stedt-project/sss/blob/master/rootcanal/perl/STEDT/RootCanal/Search.pm"
    click DB "https://github.com/stedt-project/sss/tree/master/rootcanal/sql/"
    click AS "https://github.com/stedt-project/sss/tree/master/archiving/dump/"
    click SC "https://github.com/stedt-project/sss/tree/master/semcats/"
    click JS "https://github.com/stedt-project/sss/tree/master/rootcanal/web/js/"
    click PY "https://github.com/stedt-project/sss/tree/master/rootcanal/py/"
    click DR "https://github.com/stedt-project/sss/tree/master/rootcanal/render/"

    %% Legend
    classDef legend fill:none,stroke:none
    subgraph Legend
        L1["Web Interface"]:::web
        L2["Application Logic"]:::app
        L3["Data Storage"]:::data
        L4["Processing"]:::process
        L5["Archive"]:::archive
        L6["Experimental"]:::experimental
    end
```
