Production-ready FastAPI system focused on container shipment tracking using part number and tracking pin lookups.
- Admin login can upload shipment CSV files.
- Customer login can only track assigned
part_number+tracking_pin. - Customer login can view multiple assigned parts with QC status.
- Tracking response includes
qc_status.
- Open
data/customer_access.json(create it fromdata/customer_access.example.jsonif you do not have one). - Find the user object with
"role": "admin"(or add one). - Set
usernameandpasswordto whatever you want — that is what you use on/admin. - Restart the API after saving the file (
uvicornonly loads this file at startup;--reloaddoes not watch JSON). data/customer_access.jsonis gitignored — do not commit real passwords.
If that file is missing or empty, the app falls back to demo users (e.g. admin / admin123).
UI pages:
- Admin page:
/admin - Customer page:
/customer
- CSV ingestion via upload or file path
- Automated profiling (shape, dtypes, nulls, uniqueness, stats)
- Data quality checks (missing values, mismatch rules, date sequence, outliers, duplicates)
- Schema drift detection and optional Evidently drift
- AI issue explanation and fix recommendations via OpenAI/Azure OpenAI-compatible endpoint
- Optional self-healing actions
- JSON + CSV + HTML reporting
- Structured JSON logging
cd /Users/pavithrareddy/projects/data-quality-ai-system
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reloadOPENAI_API_KEY(optional; fallback explanations used if omitted)OPENAI_BASE_URL(optional; set for Azure/OpenAI-compatible endpoints)OPENAI_MODEL(defaultgpt-4o-mini)
POST /auth/login(form:username,password)POST /upload-data(multipart form:auth_token,file; admin only)POST /run-quality-checks(multipart form with eitherfile_pathorfile, optionalself_heal)POST /detect-drift(multipart form with eitherfile_pathorfile)POST /explain-issues(multipart form with eitherfile_pathorfile)POST /suggest-fixes(multipart form with eitherfile_pathorfile)POST /generate-report(multipart form with eitherfile_pathorfile, optionalself_heal)POST /track-container(multipart form withpart_number,tracking_pin, and eitherfile_pathorfile)POST /my-parts-status(multipart form:auth_token, and eitherfile_pathorfile; customer view)POST /admin/all-parts-status(multipart form:auth_token, and eitherfile_pathorfile; admin view)POST /customer/track-by-part(multipart form:auth_token,part_number, and source input; customer view)
{
"data_quality_score": 78,
"issues": [
{
"type": "missing_value",
"column": "qc_status",
"count": 12,
"explanation": "QC status is missing for some containers which may delay approvals.",
"suggested_fix": "Fill with 'Pending' or verify from QC team"
}
]
}