How donvaktor1/dataguard-py works
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: app.py App · constants.py Constants · main_page.py Main · auth.py Auth
Components 12
Presentation
Streamlit screens and UI styling
- Login · Login screen and credential collection
src/views/login_page.py - Register · User registration screen
src/views/register_page.py - Main · Primary authenticated workflow screen
src/views/main_page.py - Settings · Configuration and preference screen
src/views/settings_page.py - Styles · Shared Streamlit styling and presentation helpers
src/styles.py
App & Auth
App bootstrap and authentication boundary
Data Quality Core
Validation and reporting logic
Data Integration
External data connectivity and shared app values
- Connectors · External SQL and source connection boundary
src/connectors.py - Constants · Central app-wide values and labels
src/constants.py
Other components
- Dev Container · Containerized local development setup
.devcontainer/devcontainer.json
Connections 17
- 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