# rpakishore/ak_sap architecture

> Architecture diagram of the GitHub repository rpakishore/ak_sap, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rpakishore/ak_sap
- Repository: https://github.com/rpakishore/ak_sap

## Overview

##### Main System Components

a) Interface Layer
- GUI Interface (Streamlit-based)
- CLI Interface
- Python API Interface

b) Core Wrapper Layer
- SAP2000 Wrapper (Main interface to SAP2000)
- Authentication/Credentials Management

c) Functional Modules Layer
- Model Management
- Analysis Operations
- Database Operations
- Load Management
- Results Processing
- Material Management
- Object Management

##### Component Relationships

**[User Interfaces] → [Wrapper Core] → [SAP2000 API]**
- ↓
**[Functional Modules] ← → [Wrapper Core]**

##### Detailed Component Breakdown

Model Management:
**[Model Module]**
- Units Management
- Project Info
- Model Lock Control
- Logging System

Object Management:
**[Object Module]**
- Point Management
- Frame Management
- Manipulation Tools

Load Management:
**[Load Module]**
- Load Patterns
- Load Cases
- Modal Analysis
- Eigen Analysis
- Ritz Analysis

##### Data Flow Indicators

Key flows:
- Command flow: User → Interface → Wrapper → SAP2000
- Data flow: SAP2000 → Wrapper → Results Processing → User
- Configuration flow: Settings → Modules

##### Integration Points

Highlight:
- SAP2000 API connection points
- Database interaction points
- File I/O operations (model save/load)
- Export functionality (e.g., Hilti-Profis export)

##### Data flow paths for model creation, analysis, and results extraction

Keep the abstraction level focused on the architectural components while showing enough detail to understand the system's operation and data flow. This will help developers understand both the high-level structure and the specific implementation details of the SAP2000 wrapper.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef interface fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef module fill:#f1c40f,stroke:#f39c12,color:black
    classDef processing fill:#e67e22,stroke:#d35400,color:white
    classDef utility fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef api fill:#9b59b6,stroke:#8e44ad,color:white

    %% Interface Layer
    subgraph Interface
        GUI["GUI Interface"]:::interface
        CLI["CLI Interface"]:::interface
        API["Python API"]:::interface
    end

    %% Core Layer
    subgraph Core
        Wrapper["SAP2000 Wrapper"]:::core
        Auth["Authentication"]:::core
    end

    %% SAP2000 API
    SAP["SAP2000 API"]:::api

    %% Functional Modules Layer
    subgraph Modules
        direction TB
        ModelMgmt["Model Management"]:::module
        LoadMgmt["Load Management"]:::module
        ObjMgmt["Object Management"]:::module
        ResultProc["Results Processing"]:::module
        MatMgmt["Material Management"]:::module
        DBOps["Database Operations"]:::module
        Analysis["Analysis Operations"]:::module
    end

    %% Modal Analysis Submodules
    subgraph ModalAnalysis
        direction TB
        Modal["Modal Analysis"]:::module
        Eigen["Eigen Analysis"]:::module
        Ritz["Ritz Analysis"]:::module
    end

    %% Relationships
    GUI & CLI & API --> Wrapper
    Wrapper --> SAP
    Auth --> Wrapper
    
    ModelMgmt & LoadMgmt & ObjMgmt & ResultProc & MatMgmt & DBOps & Analysis <--> Wrapper
    LoadMgmt --> Modal
    Modal --> Eigen & Ritz

    %% Click events for component mapping
    click GUI "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/gui/"
    click CLI "https://github.com/rpakishore/ak_sap/blob/main/src/ak_sap/cli/cli_app.py"
    click Wrapper "https://github.com/rpakishore/ak_sap/blob/main/src/ak_sap/wrapper.py"
    click Auth "https://github.com/rpakishore/ak_sap/blob/main/src/ak_sap/utils/credentials.py"
    click ModelMgmt "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Model/"
    click LoadMgmt "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Loads/"
    click ObjMgmt "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Object/"
    click ResultProc "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Results/"
    click MatMgmt "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Material/"
    click DBOps "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Database/"
    click Analysis "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Analyze/"
    click Modal "https://github.com/rpakishore/ak_sap/tree/main/src/ak_sap/Loads/Modal/"
    click Eigen "https://github.com/rpakishore/ak_sap/blob/main/src/ak_sap/Loads/Modal/Eigen/main.py"
    click Ritz "https://github.com/rpakishore/ak_sap/blob/main/src/ak_sap/Loads/Modal/Ritz/main.py"

    %% Legend
    subgraph Legend
        L1["User Interface"]:::interface
        L2["Core Component"]:::core
        L3["Module"]:::module
        L4["Processing"]:::processing
        L5["Utility"]:::utility
        L6["External API"]:::api
    end
```
