A production-grade automated data quality monitoring system that detects schema changes, distribution drift, anomalies, and data quality issues in real-time.
Data quality issues break ML pipelines and corrupt analytics. This platform catches data problems before they cause damageβdetecting schema changes, distribution shifts, null spikes, and anomalies automatically.
βββββββββββββββββββ
β Upload Data β
β (CSV/Parquet) β
ββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Backend (FastAPI) β
β ββ Schema Validator β
β ββ Drift Detector (KS/Chi-Squared) β
β ββ Anomaly Detector β
β ββ Completeness Checker β
β ββ Alert Manager β
ββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Database (SQLite) β
β ββ Results β
β ββ Alerts β
β ββ Metrics History β
ββββββββββ¬ββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββ
β Frontend (React + Tailwind) β
β ββ Home (upload, run check, results)β
β ββ Alerts β
β ββ Reports β
β ββ Settings β
ββββββββββββββββββββββββββββββββββββββββ
Prerequisites:
- Python 3.11+
- pip
Setup:
-
Clone the repo:
git clone https://github.com/neethika12/data-quality-platform.git cd data-quality-platform -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Start Backend (Terminal 1):
python -m uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
API docs available at:
http://localhost:8000/docs -
Start Frontend (Terminal 2):
cd frontend-react npm install npm run devFrontend available at:
http://localhost:3000
Prerequisites:
- Docker
- Docker Compose
Run:
docker-compose upThen:
- Backend API: http://localhost:8000/docs
- Frontend: http://localhost:3000
| Service | Purpose | Methods |
|---|---|---|
| Schema Validator | Detect schema changes | Type changes, new/missing columns, versioning |
| Drift Detector | Statistical drift detection | Kolmogorov-Smirnov (numeric), Chi-Squared (categorical) |
| Anomaly Detector | Find data anomalies | Null rates, outliers (IQR/Z-score), domain rules |
| Completeness Checker | Monitor data freshness | Record counts, null percentages, update latency |
| Alert Manager | Generate & manage alerts | Severity levels, deduplication, acknowledgment |
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /api/datasets/upload |
Upload CSV/Parquet file |
| GET | /api/datasets |
List all datasets |
| POST | /api/datasets/{id}/analyze |
Run full quality check |
| GET | /api/datasets/{id}/latest-result |
Get latest analysis |
| GET | /api/alerts |
Get all alerts |
| POST | /api/alerts/{id}/acknowledge |
Mark alert as seen |
| GET | /api/health |
System health check |
- Home - Upload a file, run a check, and see the quality score, plain-English breakdown, and an expandable technical view (schema changes, drift scores, per-column anomalies)
- Alerts - Alert log, filtering, acknowledgment
- Reports - Download a text/JSON quality report
- Settings - View thresholds and alert configuration
- Go to Home β Upload a CSV/Excel/Parquet file
- System establishes a baseline (schema, distributions, a raw data sample for drift comparison)
- Click "Run Check" on Home
- Backend performs checks (30 sec for 100k rows)
- See the quality score and plain-English summary right on Home
- Expand "Show detailed technical breakdown" for drift scores, schema changes, and per-column stats
- Review Alerts for actionable issues
Overall Quality Score: 0.92/1.0
Completeness: 95%
Drift Score: 0.23 (INFO)
Anomalies: 12 detected
Schema Changes: 0
Feature Age:
- Drift Score: 0.68 (WARNING)
- P-Value: 0.001
- Test: Kolmogorov-Smirnov
- Interpretation: Distribution significantly changed
π΄ CRITICAL: 2 records (2%)
- Negative prices in purchase_amount
- Record count drop (10% below baseline)
π‘ WARNING: 5 features
- High null rate in email (8%)
- Distribution drift in age (p=0.001)
π΅ INFO: 3 records
- New column: user_segment added
- Data updated 2 hours ago (OK)
Run unit tests:
pytest tests/ -vTest coverage:
- Schema validation: 100%
- Drift detection: 95%
- Anomaly detection: 90%
data-quality-platform/
βββ backend/
β βββ main.py # FastAPI app
β βββ config.py # Settings
β βββ models.py # Pydantic schemas
β βββ database.py # SQLite ORM
β βββ routes/ # API endpoints
β βββ services/ # Quality check logic
βββ frontend-react/
β βββ src/pages/ # Home, Alerts, Reports, Configuration
β βββ src/components/ # Layout, Tour, Card, Alert, etc.
βββ tests/ # Unit tests
βββ requirements.txt # Dependencies
βββ docker-compose.yml # Container setup
βββ README.md # This file
Edit backend/config.py to adjust:
# Drift thresholds
DRIFT_WARNING_THRESHOLD = 0.3 # 0-1 scale
DRIFT_CRITICAL_THRESHOLD = 0.7
# Null rate thresholds
NULL_RATE_WARNING = 0.05 # 5%
NULL_RATE_CRITICAL = 0.10 # 10%
# Freshness thresholds
FRESHNESS_WARNING_HOURS = 24
FRESHNESS_CRITICAL_HOURS = 48
# Record drop alert
RECORD_DROP_WARNING_PERCENT = 0.10 # 10%- Upload β CSV/Parquet file β Backend validates & stores
- Baseline β First upload establishes baseline (schema, stats)
- Analysis β Run quality checks on new data
- Detection β Compare against baseline, detect changes
- Alerts β Generate alerts by severity
- Visualization β Home page shows results
| Metric | Description | Normal Range |
|---|---|---|
| Quality Score | Overall data quality | 0.80-1.00 |
| Completeness | Non-null records | >0.95 |
| Drift Score | Distribution change | 0.00-0.30 |
| Anomaly Score | Unusual records | 0.00-0.05 |
| Null Rate | Missing values per column | <5% |
# Check if port 8000 is in use
lsof -i :8000
# Kill process
kill -9 <PID>- Ensure backend is running on
localhost:8000 - Check CORS settings in
backend/main.py
# Remove old database
rm data_quality.db
# Restart backend (will recreate DB)- Schema Validation: O(columns) - ~2ms
- Drift Detection: O(features Γ n log n) - dominated by quantile calc
- Anomaly Detection: O(features Γ n) - linear scan
- Overall: O(n log n) - scales with data size
| Dataset Size | Analysis Time | Memory | Notes |
|---|---|---|---|
| 15 rows (sample) | <100ms | 5MB | Included sample data |
| 1,000 rows | 500ms | 10MB | ~5 features |
| 10,000 rows | 2s | 30MB | ~10 features |
| 100,000 rows | 15s | 150MB | Statistical bottleneck |
| 1,000,000 rows | 120s | 1.2GB | Quantile calculations |
File read (CSV): 2s ββββββββββββββββ
Schema validation: 200ms ββββββββββββββββ
Drift detection: 6s ββββββββββββββββ
Anomaly detection: 3s ββββββββββββββββ
Alert generation: 1s ββββββββββββββββ
Database storage: 1s ββββββββββββββββ
ββββββββββββββββββββββββββββββ
Total: 13s
- Horizontal: Multiple workers via task queue (future)
- Vertical: Optimized quantile calculations, vectorized NumPy operations
- Storage: SQLite <1GB for 1000+ analyses; migrate to PostgreSQL for enterprise
- Email alerts
- Scheduled monitoring jobs
- Comparison mode (before/after)
- PDF report generation
- Multi-user support
- Custom rule engine UI
- Drift trend analysis (time series)
- Impact scoring (which columns matter most)
- Automated remediation suggestions
Questions? Check the API docs at http://localhost:8000/docs or GitHub issues.