# sanima2025/sanima-fichas architecture

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

- Interactive diagram: https://gitdiagram.com/sanima2025/sanima-fichas
- Repository: https://github.com/sanima2025/sanima-fichas

## Overview

##### Project type and purpose
- This is a single‐page web application built with Streamlit (a Python web‐app framework) as indicated by the presence of app.py and the .streamlit folder.
- The project name (“sanima-fichas”) suggests it renders or manages “fichas” (records/cards), but the architecture is that of a lightweight, data‐driven Streamlit dashboard.

##### File structure
- Top level:
- app.py – main Streamlit application entry point
- requirements.txt – Python dependencies (e.g., streamlit, pandas, etc.)
- README.md – basic project metadata
- Config directories:
- .streamlit/config.toml – Streamlit runtime configuration (port, theme, etc.)
- .devcontainer/ – VS Code Dev Container config for reproducible development environment

##### Extract insights from README

a. Main components to represent:
- User (web browser)
- Streamlit Server (runs app.py inside a Python environment)
- Application Logic (modules and functions within app.py)
- Data Layer – local files (CSV/JSON) or external data sources/APIs if used
- Development Environment (VS Code Dev Container)
b. Relationships and interactions:
- Browser ↔ HTTP(S) ↔ Streamlit Server
- Streamlit Server → Python business‐logic functions → Data Layer
- Developer → VS Code in Dev Container → runs “streamlit run app.py”
c. Architectural patterns / design principles:
- Single‐process, event‐driven web server (Streamlit)
- MVC‐like separation:
– View = Streamlit UI elements in app.py
– Controller = user‐interaction callbacks
– Model = data ingestion/manipulation functions
- Containerized dev environment for reproducibility
d. Key technologies / libraries:
- Python 3.x
- Streamlit (UI + web server)
- Pandas / NumPy (common for data‐driven apps, check requirements.txt)
- VS Code Dev Container (Docker based)

##### Detail without over‐fragmentation
- Don’t break app.py into too many micro‐components unless it already has submodules.
- UI layer, application layer, data layer, and the dev environment boundary.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser / User Interface"]:::cloud
    StreamlitServer["Streamlit Server / app.py"]:::server
    DataLayer["Data Layer (CSV/JSON or API)"]:::database
    subgraph "Development Environment"
        DevContainer["Dev Container"]:::container
        Developer["Developer"]:::user
    end
    Config[".streamlit/config.toml"]:::config
    Requirements["requirements.txt"]:::doc
    README["README.md"]:::doc

    Developer -->|"launch 'streamlit run app.py'"| DevContainer
    DevContainer --> StreamlitServer
    Browser -->|"HTTP / WebSocket"| StreamlitServer
    StreamlitServer -->|"file I/O / API calls"| DataLayer
    StreamlitServer --> Config
    StreamlitServer --> Requirements
    Developer --> README

    click StreamlitServer "https://github.com/sanima2025/sanima-fichas/blob/main/app.py"
    click Config "https://github.com/sanima2025/sanima-fichas/blob/main/.streamlit/config.toml"
    click DevContainer "https://github.com/sanima2025/sanima-fichas/blob/main/.devcontainer/devcontainer.json"
    click Requirements "https://github.com/sanima2025/sanima-fichas/blob/main/requirements.txt"
    click README "https://github.com/sanima2025/sanima-fichas/blob/main/README.md"

    classDef cloud fill:#fdd835,stroke:#fbc02d,stroke-width:1px
    classDef server fill:#42a5f5,stroke:#1e88e5,stroke-width:1px
    classDef database fill:#66bb6a,stroke:#388e3c,stroke-width:1px
    classDef container fill:#B0BEC5,stroke:#78909C,stroke-width:1px
    classDef user fill:#fff59d,stroke:#f9a825,stroke-width:1px
    classDef doc fill:#ffcc80,stroke:#fb8c00,stroke-width:1px
    classDef config fill:#80cbc4,stroke:#009688,stroke-width:1px
```
