End-to-end technical map of the Expired Solutions platform: from iOS CoreML inference to Python/Azure backend and the marketing web layer.
Expired Solutions is a hybrid AI platform. It combines instant on-device computer vision (CoreML) for shopper convenience with a powerful server-side pipeline (PyTorch + GPT-4o) for high-accuracy verification and training data collection.
| Component | Tech Stack | Primary Responsibility | Key Data |
|---|---|---|---|
| iOS App (Shopper) | SwiftUI, Vision, CoreML | User interface, real-time scanning, inventory management, local notifications | Local CoreData, Keychain secrets |
| Backend API | Python, FastAPI, Uvicorn | Auth, sync, heavy inference, recipe generation, admin tools | Azure Cosmos DB (MongoDB API) |
| ML Models | PyTorch -> CoreML | Produce ID & Freshness scoring (EfficientNet-B0 backbone) | Azure Blob (Training Data) |
| Marketing Site | Static HTML, Vercel Functions | Landing pages, waitlist signups, legal docs | Firebase Firestore (Signups) |
| Infrastructure | Azure App Service, Vercel | Hosting, scaling, serverless execution | Resend (Email), Redis (Cache) |
The "HoverScan" experience prioritizes speed using local models, falling back to the server only when confidence is low.
Camera Frame (CVPixelBuffer)
|
v
FreshnessAnalyzer (CoreML)
|-- ProduceClassifier (EfficientNet-B0) -> { type: "apple", conf: 0.95 }
|-- FreshnessClassifier (MobileNetV3) -> { score: 85, days: 7 }
|
v
Decision Gate
|
|-- High Confidence (>0.85)?
| -> Show result immediately (Green Flash)
|
`-- Low Confidence?
-> Trigger "/api/v1/hover/quick-analyze"
-> Backend runs TwoModelService (PyTorch)
-> If still ambiguous -> GPT-4 Vision (Fallback)
Pilot/HoverScanView.swift: Real-time camera & UI coordinatorPilot/FreshnessAnalyzer.swift: CoreML inference wrapperServices/SyncEngine.swift: Offline-first inventory syncThe Python backend handles complex logic, user data sync, and the continuous learning pipeline.
POST /api/v1/shopper/analyze
|
|-- Auth Middleware (JWT Validation)
|-- Rate Limit (Redis/Memory)
|
|-- Image Upload -> Azure Blob Storage (Permanent Archive)
|
|-- Inference Pipeline:
| 1. TwoModelService (PyTorch - Fast)
| 2. If Low Confidence -> HybridClassifier (GPT-4o Vision)
|
|-- Data Enrichment:
| - Fetch Nutrition Data (Local DB)
| - Check Diet Compatibility (User Prefs)
| - Fetch Storage Tips
|
`-- Return JSON + Async Training Log
1. Data Ingestion
- User scans (Azure Blob)
- Open Datasets (Kaggle/Fruits360)
- Timelapse Frames
2. Automated Labeling
- High conf -> Auto-label
- Medium conf -> GPT-4o Labeling
- Low conf -> Human Review Queue
3. Weekly Retraining (Azure ML Pipeline)
- Train EfficientNet-B0 on new data
- Eval vs Gold Set (Must pass gates: F1 > 0.85)
- Export .mlpackage for iOS
This repository (ExpiredSolutionsWeb). Lightweight, high-performance static site with serverless hooks.
User submits form (Shoppers/Interest/Contact)
|
v
Vercel Serverless Function (/api/*.js)
|
|-- Validation (Honeypot, Email Regex)
|-- Auth (Service Account via Env Vars)
|
|-- Firestore Write
| -> "shoppers_waitlist" / "contact_submissions"
|
`-- Resend Email
-> To User: "Welcome to Waitlist"
-> To Admin: "New Submission Alert"
GET /admin-shoppers.html
|
v
Client JS requests /api/shoppers-signups
|-- Header: x-admin-token
|
v
API validates token vs Env Var
-> Fetches Firestore collection
-> Returns JSON list
-> Rendered in browser (Table + CSV Export)
How the system gets smarter over time.