# photon3009/software-discovery-tool architecture

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

- Interactive diagram: https://gitdiagram.com/photon3009/software-discovery-tool
- Repository: https://github.com/photon3009/software-discovery-tool

## Overview

##### Main Components

a) Frontend Layer:
- Angular.js based web interface (evident from /src/static/js structure)
- Key components:
- HomeController
- FAQController
- Views (home.html, faq.html)
- Static assets (CSS, JS, images)

b) Backend Layer:
- Python-based application (evident from .py files)
- WSGI application (SDT.wsgi)
- Core components:
- Package search functionality (package_search.py)
- Configuration management (config.py)
- Distro scripts for package information

c) Data Layer:
- External data repository (software-discovery-tool-data)
- Database components (indicated by database_build.py)

d) Build & Configuration:
- Build scripts (in /bin directory)
- Configuration files (sdt.conf)
- Docker containerization (Dockerfile)

**[User Interface Layer]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Data Layer]**

##### Specific Component Relationships

**Web Browser → Angular.js Frontend → Python WSGI Backend → Package Search Engine → Multiple Data Sources**
- ↓
- Configuration System

##### Important Elements to Highlight

a) Integration Points:
- Connection to Launchpad API (getPackageInfoUsingLaunchpad.py)
- Interaction with external data repository
- Configuration management flow

b) Key Processes:
- Package search flow
- Data synchronization
- Configuration management

##### Architectural Patterns to Emphasize
- MVC pattern in the frontend
- Service-oriented backend
- Modular distro script system
- Containerized deployment

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        Browser["Web Browser"]
        Frontend["Angular.js Frontend"]:::frontend
        HomeCtrl["Home Controller"]:::frontend
        FAQCtrl["FAQ Controller"]:::frontend
        Views["Views"]:::frontend
        Assets["Static Assets"]:::frontend
    end

    subgraph BE["Application Layer"]
        WSGI["WSGI Application"]:::backend
        PythonApp["Python Backend"]:::backend
        PackageSearch["Package Search Engine"]:::backend
        ConfigMgmt["Configuration Management"]:::backend
        DistroScripts["Distribution Scripts"]:::backend
        LaunchpadInt["Launchpad Integration"]:::backend
    end

    subgraph DATA["Data Layer"]
        ExtRepo["External Data Repository"]:::data
        Database["Package Database"]:::data
        ConfigStore["Configuration Store"]:::data
    end

    subgraph BUILD["Build & Deploy"]
        Docker["Docker Container"]:::deploy
        BuildScripts["Build Scripts"]:::deploy
        Tests["Testing Framework"]:::tests
    end

    %% Relationships
    Browser --> Frontend
    Frontend --> HomeCtrl
    Frontend --> FAQCtrl
    Frontend --> Views
    Frontend --> Assets
    Frontend --> WSGI
    WSGI --> PythonApp
    PythonApp --> PackageSearch
    PythonApp --> ConfigMgmt
    PackageSearch --> DistroScripts
    DistroScripts --> LaunchpadInt
    PackageSearch --> Database
    ConfigMgmt --> ConfigStore
    DistroScripts --> ExtRepo

    %% Click Events
    click Frontend "https://github.com/Photon3009/software-discovery-tool/blob/master/src/static/js/app.js"
    click HomeCtrl "https://github.com/Photon3009/software-discovery-tool/blob/master/src/static/js/controller/HomeController.js"
    click FAQCtrl "https://github.com/Photon3009/software-discovery-tool/blob/master/src/static/js/controller/FAQController.js"
    click Views "https://github.com/Photon3009/software-discovery-tool/tree/master/src/static/js/views"
    click Assets "https://github.com/Photon3009/software-discovery-tool/blob/master/src/static/css/app.css"
    click WSGI "https://github.com/Photon3009/software-discovery-tool/blob/master/src/SDT.wsgi"
    click PythonApp "https://github.com/Photon3009/software-discovery-tool/blob/master/src/main.py"
    click PackageSearch "https://github.com/Photon3009/software-discovery-tool/blob/master/src/classes/package_search.py"
    click ConfigMgmt "https://github.com/Photon3009/software-discovery-tool/blob/master/src/config/config.py"
    click DistroScripts "https://github.com/Photon3009/software-discovery-tool/tree/master/src/scripts/distro_scripts"
    click LaunchpadInt "https://github.com/Photon3009/software-discovery-tool/blob/master/src/scripts/distro_scripts/getPackageInfoUsingLaunchpad.py"
    click BuildScripts "https://github.com/Photon3009/software-discovery-tool/tree/master/bin"
    click Tests "https://github.com/Photon3009/software-discovery-tool/tree/master/src/tests"
    click Docker "https://github.com/Photon3009/software-discovery-tool/tree/master/src/setup/Dockerfile"

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef deploy fill:#9b59b6,stroke:#8e44ad,color:white
    classDef tests fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        Frontend_L["Frontend Component"]:::frontend
        Backend_L["Backend Component"]:::backend
        Data_L["Data Store"]:::data
        Deploy_L["Build/Deploy"]:::deploy
        Test_L["Testing"]:::tests
    end
```
