# k0laa/veterinerlik_uygulamasi architecture

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

- Interactive diagram: https://gitdiagram.com/k0laa/veterinerlik_uygulamasi
- Repository: https://github.com/k0laa/veterinerlik_uygulamasi

## Overview

##### Main Components
- User Interface (UI) Components:
– The UI is implemented using PyQt5. Its structure is split between two directories:
▪ Windows – Contains the main window files for login, appointment management, doctor dashboard, and signup.
▪ ui – Contains the autogenerated UI code (with files ending in _ui), as well as further UI logic, styles, and component modularizations (tabs and widgets such as patient cards, forms, statistics, etc.).
- Application Logic:
– The main.py file likely serves as the entry point that ties together the UI and business logic.
- Data Management:
– The utils/database.py file indicates usage of SQLite3 for storing application data such as patient records, appointments, and user information.
- External Resources:
- Dependencies:
– Requirements (PyQt5 and SQLite3) as per the README show which technology stack supports the functionality.

##### Relationships and Interactions
– The main.py script initializes the application, loads the initial window (login window), and handles navigation among UI components.
– Upon user actions (e.g., login, appointment creation), the UI components call underlying functions and modules, possibly defined across the Windows and ui directories.
– The Database component (in utils) is accessed to create, update, or retrieve records from the SQLite3 database, ensuring persistence of data.
– The UI layer (split between Windows and ui subdirectories) encapsulates the presentation logic, whereas business logic (if any) should reside in main.py or be separated in function calls.

##### Architectural Patterns and Design Principles
– Separation of concerns is observed: Presentation (UI components), Application Initialization/Control (main.py), and Data Management (utils/database.py).
– The UI uses modular components (widgets, tabs) that may reflect principles similar to MVC or MVVM, although in this small project the separation is more practically oriented rather than a strict pattern.
– The project is designed to be extendable—new windows, widgets, or tabs can be added without affecting the overall system architecture.

##### Technologies and Libraries
– Python is used as the programming language, with key external libraries including PyQt5 for the GUI and SQLite3 for the database.
– The file tree indicates a clear separation of GUI design (via autogenerated UI files in the ui directory) from logic and data layers.

##### Essential Elements
– Clear labels for each component:
- Login Window (Windows/login_window.py & ui/login_window_ui.py)
- Signup Window (Windows/signup_window.py & ui/singup_window_ui.py)
- Doctor Main Window (Windows/doctor_main_window.py & ui/doctor_main_window_ui.py)
- Appointment Window (Windows/oppointment_window.py & ui/oppointment_window_ui.py)
- Report and Statistics Tabs (under ui/tabs and ui/widgets)
- Database (utils/database.py)
- Main Application Entry (main.py)
- UI components vs. backend/data components.
- Static assets (from resources) if needed.

##### Putting It All Together
– Branch out to the UI layer on one side, showing separate windows and UIs that interact with the user.
– On the other side, connect the application logic to the database component.
– Show a flow from user login to the dashboard and subsequent operations (e.g., appointment setting, report generation), emphasizing the integration points.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Main Logic"
        Main("Main Application Entry"):::logic
    end

    subgraph "UI Components"
        subgraph "Login Window"
            login_py("Login Window (Logic)"):::ui
            login_ui("Login Window (UI)"):::ui
        end
        subgraph "Signup Window"
            signup_py("Signup Window (Logic)"):::ui
            signup_ui("Signup Window (UI)"):::ui
        end
        subgraph "Doctor Main Window"
            doctor_py("Doctor Main Window (Logic)"):::ui
            doctor_ui("Doctor Main Window (UI)"):::ui
        end
        subgraph "Appointment Window"
            appoint_py("Appointment Window (Logic)"):::ui
            appoint_ui("Appointment Window (UI)"):::ui
        end
        subgraph "Report and Statistics Tabs"
            reports("Reports Tab"):::ui
            waiting("Waiting List Tab"):::ui
            stats("Statistics Widget"):::ui
            patientCard("Patient Card"):::ui
            formElem("Form Elements"):::ui
            status("Status Tracker"):::ui
            medicine("Medicine List"):::ui
            menu("Menu"):::ui
        end
        uiStyle("UI Styles & Logic"):::ui
    end

    subgraph "Data Management"
        db("Database (SQLite3)"):::db
    end

    subgraph "External Resources"
        resources("Assets"):::external
        app_photos("App Photos"):::external
        icons("Icons"):::external
    end

    %% Connections
    Main -->|"triggers"| login_py
    login_py -->|"navigatesTo"| signup_py
    login_py -->|"navigatesTo"| doctor_py
    doctor_py -->|"opens"| appoint_py
    doctor_py -->|"loads"| reports

    login_ui -->|"fetchesData"| db
    signup_ui -->|"fetchesData"| db
    doctor_ui -->|"fetchesData"| db
    appoint_ui -->|"fetchesData"| db
    reports -->|"queries"| db
    waiting -->|"queries"| db

    uiStyle -->|"appliesStylesFrom"| resources

    resources -->|"contains"| app_photos
    resources -->|"contains"| icons

    %% Click Events
    click Main "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/main.py"
    click login_py "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/Windows/login_window.py"
    click login_ui "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/login_window_ui.py"
    click signup_py "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/Windows/signup_window.py"
    click signup_ui "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/singup_window_ui.py"
    click doctor_py "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/Windows/doctor_main_window.py"
    click doctor_ui "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/doctor_main_window_ui.py"
    click appoint_py "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/Windows/oppointment_window.py"
    click appoint_ui "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/oppointment_window_ui.py"
    click reports "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/tabs/raporlar_tab.py"
    click waiting "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/tabs/bekleyen_hastalar_tab.py"
    click stats "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/statistics.py"
    click patientCard "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/hasta_karti.py"
    click formElem "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/form_elements.py"
    click status "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/durum_takip.py"
    click medicine "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/ilac_listesi.py"
    click menu "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/widgets/menu.py"
    click uiStyle "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/ui/styles.py"
    click db "https://github.com/k0laa/veterinerlik_uygulamasi/blob/main/utils/database.py"
    click resources "https://github.com/k0laa/veterinerlik_uygulamasi/tree/main/resources"
    click app_photos "https://github.com/k0laa/veterinerlik_uygulamasi/tree/main/resources/app_photos"
    click icons "https://github.com/k0laa/veterinerlik_uygulamasi/tree/main/resources/icons"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef logic fill:#F9E79F,stroke:#B9770E,stroke-width:2px;
    classDef db fill:#82E0AA,stroke:#1D8348,stroke-width:2px;
    classDef external fill:#F5B041,stroke:#9A7D0A,stroke-width:2px;
```
