How aravindksk7/atom works
1. This repository is a single-process FastAPI application with a static Alpine.js front end. The browser talks to the API over HTTP/JSON, and the API also serves HTML, SVG badges, SSE progress streams, and generated report files.
2. The UI is intentionally thin. frontend/index.html, frontend/app.js, and frontend/styles.css implement a tabbed workspace for Config, Launch, Monitor, History, Adapters, Reports, and Compare. Most state and all business actions are delegated to /api/*.
3. The API layer is organized by domain routes in api/routes/: configs, jobs, runs, compare, lineage, audit, tokens, notifications, schedules, adapters, and health. api/middleware/auth.py enforces bearer-token auth on API routes, while api/dependencies.py and api/schemas.py provide request wiring and shared models.
4. The persistence boundary is handled through etl_framework.repository and the database engine in etl_framework.db. The app stores configs, jobs, runs, results, mismatch rows, tokens, notification hooks, schedules, lineage edges, and audit events in a SQLAlchemy-backed database, defaulting to SQLite but configurable via ETL_DATABASE_URL.
5. Run execution is centered in api/services/run_executor.py and the etl_framework.runner package. This is where job ordering, dependency resolution, retries, health checks, and progress/state tracking come together. The README indicates runs execute inside the API process, so there is no separate worker service.
6. The core comparison engine lives in etl_framework.reconciliation. It includes a reconciliation engine, a data-quality engine, chunking/normalization utilities, and selectable pandas or polars backends. This is the main computation boundary for row comparison, schema handling, hash prechecks, and DQ rule evaluation.
7. Job types and external adapters are modeled in the etl_framework.sap_bo, etl_framework.automic, and dbt-related services. The adapters allow the app to compare SAP BusinessObjects reports, look up Automic jobs/runs, and parse dbt run_results.json plus optional manifest.json into normal run results.
8. Reporting and observability are separate subsystems. etl_framework.reporting generates themed HTML reports and metrics, while api/services/log_parser.py and api/services/artifact_service.py expose run logs, metrics, and report views back to the UI. These outputs are written to ./reports and ./logs.
9. The compare workflows are first-class APIs rather than UI-only features. api/routes/compare.py and api/services/compare_service.py support BO report comparison, dual-environment run comparison, and file-based reconciliation comparison. The History tab also uses run comparison and baseline pinning to show deltas between stored runs.
10. Operational features are embedded around the core flow: api/services/scheduler.py wraps APScheduler for cron-driven runs, api/services/notifier.py sends webhook notifications, and api/services/audit_service.py records immutable mutation history. These side systems all write back into the same application database.
11. The runtime artifact model is simple and local-first. The app produces a SQLite database by default, plus log files, metrics JSON sidecars, and HTML reports on disk. When configured against live systems, the same API can switch from simulation mode to real SQL Server, SAP BO, and Automic connections without changing the frontend shape.
12. For architecture diagrams, the clearest boundaries are: browser/UI, FastAPI API/auth, execution and reconciliation core, repository/database, external adapters, and local artifacts. The arrows should show the UI driving domain routes, routes invoking services, services calling the core engine/repository/adapters, and the core persisting results and generated files.
Main entry points: main.py API App · repository.py Repository · compare.py Compare API · compare_service.py Compare Svc
Components 29
Browser UI
Static Alpine.js frontend for tabbed workflow and results viewing.
FastAPI API
HTTP/JSON routes, auth, request wiring, and domain services.
- API App · Application bootstrap and route assembly.
api/main.py - Auth · Bearer-token enforcement for API routes.
api/middleware/auth.py - Compare API · Report, run, and file comparison endpoints.
api/routes/compare.py - Runs API · Run launch, status, and history endpoints.
api/routes/runs.py - Configs API · Configuration CRUD and wiring endpoints.
api/routes/configs.py - Adapters API · Adapter discovery and integration endpoints.
api/routes/adapters.py
Execution Core
Run orchestration, reconciliation, comparison, and reporting engines.
- Executor · Orders jobs, resolves dependencies, retries, and tracks progress in-process.
api/services/run_executor.py - Compare Svc · Coordinates BO, run, and file-based comparisons.
api/services/compare_service.py - Reconcile · Core row comparison, schema handling, and hash prechecks.
etl_framework/reconciliation/engine.py - DQ Engine · Data-quality rule evaluation and validation.
etl_framework/reconciliation/dq_engine.py - Runner State · Run status and health tracking for in-process execution.
etl_framework/runner/state.py - Reports · HTML report and metrics generation.
etl_framework/reporting/generator.py
Persistence
Repository and database boundary for configs, runs, results, lineage, and audit.
- Repository · Application repository for configs, runs, results, lineage, tokens, schedules, and audit.
etl_framework/repository/repository.py - DB Engine · Database engine and SQLAlchemy-backed connectivity.
etl_framework/db/engine.py
Adapters
External system integrations and artifact parsing.
- SAP BO · BusinessObjects report and config access.
etl_framework/sap_bo/client.py - Automic · Automic job and run lookups.
etl_framework/automic/client.py - dbt Parser · Parses run_results.json and optional manifest.json.
api/services/dbt_artifact_parser.py
Operations
Scheduling, notifications, logs, and artifact views.
- Artifacts · Serves run logs, metrics, reports, and artifact views.
api/services/artifact_service.py - Scheduler · Cron-driven run scheduling.
api/services/scheduler.py - Notifier · Notification delivery for run events.
api/services/notifier.py - Local Files · Reports, logs, and metrics sidecars written to disk.
Other components
- SQL DB · Primary configured database backend, often SQLite or SQL Server.
- SAP BO Server · Live BusinessObjects source system.
- Automic Server · Live Automic source system.
- Source Systems · Compared data sources reached by adapters and reconciliation flows.
Connections 32
- Browser → Shell: loads · Browser opens the static shell.
- Shell → App UI: bootstraps · Page shell loads the Alpine.js application.
- App UI → API App: calls /api · UI actions are delegated to HTTP/JSON endpoints.
- API App → Auth: protects · API routes are wrapped with bearer-token auth.
- API App → Compare API: mounts · Registers compare endpoints.
- API App → Runs API: mounts · Registers run and history endpoints.
- API App → Configs API: mounts · Registers config endpoints.
- API App → Adapters API: mounts · Registers adapter endpoints.
- Runs API → Executor: starts · Launch requests invoke in-process execution.
- Compare API → Compare Svc: orchestrates · Compare routes delegate to comparison service.
- Compare Svc → Reconcile: uses · Comparison workflows call the reconciliation engine.
- Reconcile → DQ Engine: validates · DQ checks are part of reconciliation.
- Executor → Runner State: tracks · Execution updates live run state and health.
- Executor → Repository: persists · Run results and state are stored through the repository.
- Repository → DB Engine: writes · Repository is backed by the SQLAlchemy engine.
- DB Engine → SQL DB: connects · Database URL targets the configured backend.
- Compare Svc → SAP BO: reads BO · BO report comparison uses the SAP adapter.
- Compare Svc → dbt Parser: parses · File-based and dbt-based comparison inputs are parsed.
- SAP BO → SAP BO Server: connects · Live BusinessObjects connectivity.
- Automic → Automic Server: connects · Live Automic connectivity.
- Adapters API → SAP BO: exposes · Adapter APIs surface BO integration state.
- Adapters API → Automic: exposes · Adapter APIs surface Automic integration state.
- Runs API → Repository: reads history · Run history and stored state come from persistence.
- Configs API → Repository: stores config · Configurations are persisted through the repository.
- Compare API → Repository: reads baselines · Baseline and stored comparison data are retrieved from the repository.
- Scheduler → Executor: triggers · Scheduled jobs start the same execution path.
- Notifier → Repository: records · Notification settings and events are persisted.
- Artifacts → Reports: serves · Report generation and artifact views depend on reporting outputs.
- Reports → Local Files: writes · HTML reports and metrics are emitted to disk.
- Artifacts → Local Files: reads · Logs, metrics, and reports are read back for the UI.
- Compare API → Artifacts: shows output · Compare results can be surfaced as reports and artifacts.
- App UI → Artifacts: views reports · UI fetches logs, metrics, and generated report files.