# donvaktor1/dataguard-py architecture

> Architecture diagram of the GitHub repository donvaktor1/dataguard-py, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/donvaktor1/dataguard-py
- Repository: https://github.com/donvaktor1/dataguard-py

## Overview

1. **Project type and runtime**
   - This is a **Python + Streamlit** application focused on **automating data quality control**.
   - The repository is structured as a single interactive app, not as separate frontend/backend services.

2. **Application entrypoint**
   - `src/app.py` is the top-level startup point and likely coordinates page routing and session state.
   - In architectural terms, this is the root of the UI flow and the place where the Streamlit app is assembled.

3. **UI/page layer**
   - The `src/views/` package contains the main user-facing screens:
     - `login_page.py`
     - `register_page.py`
     - `main_page.py`
     - `settings_page.py`
   - These are presentation-layer modules that render screens and collect user input, while delegating business logic to other modules.

4. **Authentication boundary**
   - `src/auth.py` is the authentication subsystem.
   - It likely handles login, registration, and session-related checks used by the login/register pages and by app navigation.
   - This is the clearest separation between public access and authenticated app functionality.

5. **Data source / connection layer**
   - `src/connectors.py` is the integration layer for external data systems.
   - Given the README mentions SQL, this module likely encapsulates database connections and any source/target connectivity needed for data validation and reporting.
   - This module forms the boundary between the app and external data stores.

6. **Validation / quality rules**
   - `src/validator.py` is the core data-quality engine.
   - It likely runs checks against imported or connected data, producing validation results that drive the main workflow.
   - In the architecture diagram, this sits between data connectors and reporting/output.

7. **Report generation**
   - `src/report_generator.py` converts validation outcomes into a consumable report format.
   - This is the output/presentation processing layer for data quality findings, distinct from the live UI pages.
   - It likely consumes results from `validator.py` and formats them for display or export.

8. **Configuration and shared constants**
   - `src/constants.py` centralizes app-wide fixed values such as labels, defaults, or rule names.
   - `src/styles.py` contains UI styling concerns for Streamlit pages.
   - These are supporting modules used across multiple views rather than standalone subsystems.

9. **Overall data flow**
   - Typical flow appears to be: user opens the app → authenticates via login/register → reaches the main page → configures data source/settings → connector retrieves SQL data → validator evaluates quality rules → report generator summarizes results → UI displays findings.
   - The settings page likely influences either connection parameters, validation options, or app preferences.

10. **Subsystem boundaries to draw**
   - **Presentation boundary:** `views/`, `styles.py`
   - **Application/session boundary:** `app.py`, `auth.py`
   - **Data integration boundary:** `connectors.py`
   - **Business logic boundary:** `validator.py`
   - **Output/reporting boundary:** `report_generator.py`
   - **Shared configuration:** `constants.py`

11. **Infrastructure and tooling**
   - `.devcontainer/devcontainer.json` suggests a containerized development setup for consistent local environments.
   - `requirements.txt` indicates a Python dependency-managed project; Streamlit is the key runtime dependency implied by the README.

12. **Architecture summary**
   - The codebase is a compact, layered Streamlit application where the UI pages are thin wrappers around authentication, SQL/data connectivity, validation logic, and report generation.
   - The main architectural idea is separation between **user interaction**, **data access**, **quality analysis**, and **report output**.

Main entry points: [`src/app.py`](https://github.com/donvaktor1/dataguard-py/blob/main/src/app.py) (App), [`src/constants.py`](https://github.com/donvaktor1/dataguard-py/blob/main/src/constants.py) (Constants), [`src/views/main_page.py`](https://github.com/donvaktor1/dataguard-py/blob/main/src/views/main_page.py) (Main), [`src/auth.py`](https://github.com/donvaktor1/dataguard-py/blob/main/src/auth.py) (Auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_login_page["Login<br/>view<br/>[login_page.py]"]
  node_register_page["Register<br/>view<br/>[register_page.py]"]
  node_main_page["Main<br/>view<br/>[main_page.py]"]
  node_settings_page["Settings<br/>view<br/>[settings_page.py]"]
  node_styles["Styles<br/>ui styling<br/>[styles.py]"]
end

subgraph group_session["App & Auth"]
  node_src_app["App<br/>streamlit entrypoint<br/>[app.py]"]
  node_src_auth["Auth<br/>[auth.py]"]
end

subgraph group_core["Data Quality Core"]
  node_validator{{"Validator<br/>quality engine<br/>[validator.py]"}}
  node_report_generator["Reports<br/>reporting"]
end

subgraph group_integration["Data Integration"]
  node_connectors[("Connectors<br/>data access<br/>[connectors.py]")]
  node_constants["Constants<br/>shared config<br/>[constants.py]"]
end

node_devcontainer["Dev Container<br/>dev environment<br/>[devcontainer.json]"]

node_src_app -->|"guards"| node_src_auth
node_src_app -->|"shows"| node_login_page
node_src_app -->|"shows"| node_register_page
node_src_app -->|"loads"| node_main_page
node_src_app -->|"opens"| node_settings_page
node_src_app -->|"applies"| node_styles
node_login_page -->|"authenticates"| node_src_auth
node_register_page -->|"registers"| node_src_auth
node_main_page -->|"reads"| node_connectors
node_main_page -->|"runs"| node_validator
node_main_page -->|"presents"| node_report_generator
node_settings_page -->|"uses"| node_constants
node_connectors -->|"configures"| node_constants
node_validator -->|"rules"| node_constants
node_report_generator -->|"formats"| node_constants
node_src_auth -->|"uses"| node_constants
node_src_app -.->|"developed in"| node_devcontainer

click node_src_app "https://github.com/donvaktor1/dataguard-py/blob/main/src/app.py"
click node_src_auth "https://github.com/donvaktor1/dataguard-py/blob/main/src/auth.py"
click node_login_page "https://github.com/donvaktor1/dataguard-py/blob/main/src/views/login_page.py"
click node_register_page "https://github.com/donvaktor1/dataguard-py/blob/main/src/views/register_page.py"
click node_main_page "https://github.com/donvaktor1/dataguard-py/blob/main/src/views/main_page.py"
click node_settings_page "https://github.com/donvaktor1/dataguard-py/blob/main/src/views/settings_page.py"
click node_styles "https://github.com/donvaktor1/dataguard-py/blob/main/src/styles.py"
click node_connectors "https://github.com/donvaktor1/dataguard-py/blob/main/src/connectors.py"
click node_validator "https://github.com/donvaktor1/dataguard-py/blob/main/src/validator.py"
click node_report_generator "https://github.com/donvaktor1/dataguard-py/blob/main/src/report_generator.py"
click node_constants "https://github.com/donvaktor1/dataguard-py/blob/main/src/constants.py"
click node_devcontainer "https://github.com/donvaktor1/dataguard-py/blob/main/.devcontainer/devcontainer.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login_page,node_register_page,node_main_page,node_settings_page,node_styles toneBlue
class node_src_app,node_src_auth toneAmber
class node_validator,node_report_generator toneMint
class node_connectors,node_constants toneRose
class node_devcontainer toneNeutral
```

## Components

### Presentation

Streamlit screens and UI styling

- [Login](https://github.com/donvaktor1/dataguard-py/blob/main/src/views/login_page.py): view · Login screen and credential collection · `src/views/login_page.py`
- [Register](https://github.com/donvaktor1/dataguard-py/blob/main/src/views/register_page.py): view · User registration screen · `src/views/register_page.py`
- [Main](https://github.com/donvaktor1/dataguard-py/blob/main/src/views/main_page.py): view · Primary authenticated workflow screen · `src/views/main_page.py`
- [Settings](https://github.com/donvaktor1/dataguard-py/blob/main/src/views/settings_page.py): view · Configuration and preference screen · `src/views/settings_page.py`
- [Styles](https://github.com/donvaktor1/dataguard-py/blob/main/src/styles.py): ui styling · Shared Streamlit styling and presentation helpers · `src/styles.py`

### App & Auth

App bootstrap and authentication boundary

- [App](https://github.com/donvaktor1/dataguard-py/blob/main/src/app.py): streamlit entrypoint · Top-level Streamlit startup and page flow assembly · `src/app.py`
- [Auth](https://github.com/donvaktor1/dataguard-py/blob/main/src/auth.py): session auth · Login, registration, and access checks · `src/auth.py`

### Data Quality Core

Validation and reporting logic

- [Validator](https://github.com/donvaktor1/dataguard-py/blob/main/src/validator.py): quality engine · Runs data quality checks and produces validation results · `src/validator.py`
- [Reports](https://github.com/donvaktor1/dataguard-py/blob/main/src/report_generator.py): reporting · Formats validation outcomes into reports · `src/report_generator.py`

### Data Integration

External data connectivity and shared app values

- [Connectors](https://github.com/donvaktor1/dataguard-py/blob/main/src/connectors.py): data access · External SQL and source connection boundary · `src/connectors.py`
- [Constants](https://github.com/donvaktor1/dataguard-py/blob/main/src/constants.py): shared config · Central app-wide values and labels · `src/constants.py`

### Other components

- [Dev Container](https://github.com/donvaktor1/dataguard-py/blob/main/.devcontainer/devcontainer.json): dev environment · Containerized local development setup · `.devcontainer/devcontainer.json`

## Connections

- App → Auth: guards · App checks authentication state and routes accordingly
- App → Login: shows · Unauthenticated users are routed to login
- App → Register: shows · App exposes registration flow
- App → Main: loads · Authenticated users enter the main workflow
- App → Settings: opens · App can route to configuration screen
- App → Styles: applies · Shared styling is used across screens
- Login → Auth: authenticates · Login submits credentials to auth logic
- Register → Auth: registers · Registration screen delegates account creation
- Main → Connectors: reads · Main workflow pulls data through connectors
- Main → Validator: runs · Main screen triggers quality validation
- Main → Reports: presents · Results are summarized for display or export
- Settings → Constants: uses · Settings relies on shared labels and defaults
- Connectors → Constants: configures · Connection behavior depends on shared configuration
- Validator → Constants: rules · Validation behavior uses centralized rule values
- Reports → Constants: formats · Report output uses shared naming and labels
- Auth → Constants: uses · Auth logic depends on shared app values
- App → Dev Container: developed in · Repository includes containerized development environment
