# znarfm/infoman_project architecture

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

- Interactive diagram: https://gitdiagram.com/znarfm/infoman_project
- Repository: https://github.com/znarfm/infoman_project

## Overview

##### Main Components

a. Frontend Layer:
- Streamlit Web Interface
- Multiple Pages (organized in the /pages directory)
- CRUD Operations (add.py, read.py, update.py, delete.py)
- Form Management (form.py)
- Problem Reporting (problems.py)
- School Management (add_school.py)

b. Backend Layer:
- Main Application Logic (main.py)
- SQL Manager (sql_manager.py)

c. Data Layer:
- SQLite Database (projectdb.db)
- SQL Scripts Directory
- Schema Creation (create.sql)
- Sample Data (dummy.sql)
- Problem Categories (easy/medium/hard level problems)

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

##### Specific Elements

a. User Interface Layer (Top):
- Registration Forms
- CRUD Operations
- School Management
- Problem Management

b. Application Layer (Middle):
- Main Application Controller
- SQL Manager Component
- Business Logic Handlers

c. Data Layer (Bottom):
- SQLite Database
- SQL Scripts Repository
- Data Models

##### Additional Elements

- A configuration section showing:
- .streamlit/config.toml
- requirements.txt
- packages.txt

##### Important Relationships to Highlight

- How the pages interact with the SQL manager
- Flow from user input to database storage
- Demonstrate how the SQL scripts are used for database initialization

##### Specific Implementation Details

**[Streamlit Web Interface]**
- ↓↑
**[Page Router (main.py)] ←→ [SQL Manager]**
- ↓↑                       ↓↑
**[Database Operations] ←→ [SQLite DB]**

##### Notes for Implementation

- Related components together
- Clear separation of concerns
- Version information and dependencies
- Notes about the development environment (.devcontainer)

This system design should effectively communicate the application's architecture while maintaining the right balance between detail and clarity, focusing on the CRUD operations and data flow that are central to this Senior Citizen Information System.

Remember to emphasize the Streamlit-specific architecture patterns and how they integrate with the SQLite backend, as this is crucial for understanding the application's structure and flow.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        SF["Streamlit Frontend"]:::frontend
        subgraph Pages["Page Components"]
            direction TB
            CR["CRUD Operations"]:::pages
            FM["Form Management"]:::pages
            PR["Problem Reporting"]:::pages
            SM["School Management"]:::pages
        end
    end

    subgraph AL["Application Layer"]
        direction TB
        MA["Main Application"]:::backend
        SQ["SQL Manager"]:::backend
    end

    subgraph DL["Data Layer"]
        direction TB
        DB[(SQLite Database)]:::database
        subgraph SQL["SQL Scripts"]
            direction TB
            SC["Schema Creation"]:::sql
            SD["Sample Data"]:::sql
            subgraph PC["Problem Categories"]
                direction TB
                EP["Easy Level"]:::sql
                MP["Medium Level"]:::sql
                HP["Hard Level"]:::sql
            end
        end
    end

    subgraph CF["Configuration"]
        direction TB
        ST["Streamlit Config"]:::config
        RT["Requirements"]:::config
        PT["Packages"]:::config
        DC["Dev Container"]:::config
    end

    %% Relationships
    SF --> Pages
    CR --> MA
    FM --> MA
    PR --> MA
    SM --> MA
    MA <--> SQ
    SQ <--> DB
    SQL --> DB

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef pages fill:#2ecc71,stroke:#27ae60,color:white
    classDef backend fill:#e74c3c,stroke:#c0392b,color:white
    classDef database fill:#f1c40f,stroke:#f39c12,color:black
    classDef sql fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef config fill:#9b59b6,stroke:#8e44ad,color:white

    %% Click Events
    click MA "https://github.com/znarfm/infoman_project/blob/main/main.py"
    click SQ "https://github.com/znarfm/infoman_project/blob/main/sql_manager.py"
    click DB "https://github.com/znarfm/infoman_project/blob/main/projectdb.db"
    click SC "https://github.com/znarfm/infoman_project/blob/main/sql/create.sql"
    click SD "https://github.com/znarfm/infoman_project/blob/main/sql/dummy.sql"
    click EP "https://github.com/znarfm/infoman_project/blob/main/sql/project_easylevelprob.sql"
    click MP "https://github.com/znarfm/infoman_project/blob/main/sql/project_mediumlevelprob.sql"
    click HP "https://github.com/znarfm/infoman_project/blob/main/sql/project_hardlevelprob.sql"
    click ST "https://github.com/znarfm/infoman_project/blob/main/.streamlit/config.toml"
    click RT "https://github.com/znarfm/infoman_project/blob/main/requirements.txt"
    click PT "https://github.com/znarfm/infoman_project/blob/main/packages.txt"
    click DC "https://github.com/znarfm/infoman_project/blob/main/.devcontainer/devcontainer.json"
    click CR "https://github.com/znarfm/infoman_project/tree/main/pages"
    click FM "https://github.com/znarfm/infoman_project/blob/main/pages/form.py"
    click PR "https://github.com/znarfm/infoman_project/blob/main/pages/problems.py"
    click SM "https://github.com/znarfm/infoman_project/blob/main/pages/add_school.py"
```
