How ayshafidhakr/spamx works
What this project is (type + purpose)
From the README + tree, this is a cross‑platform Flutter application (“SpamX”) that lets a user paste/type an SMS and get a spam vs ham prediction. The ML is implemented in Python, with:
• model_train.py: offline training pipeline (builds artifacts)
• spam_model.pkl + vectorizer.pkl: trained model + text vectorizer artifacts
• app.py + requirements.txt + Procfile: strongly suggests a Python web service (commonly Flask/FastAPI) deployed as an API (Procfile often = Heroku-style process entrypoint)
The repository also contains two Flutter app roots:
• Root Flutter app (has lib/, android/, ios/, windows/, web/, etc.)
• A nested Flutter app under spam_detection_app/ with the same multi-platform structure and its own spam_detection_app/lib/main.dart
• Monorepo with two Flutter clients (or one is legacy/duplicate), plus a Python inference service and an offline training script; or
Use the tree to map code to runtime components:
Flutter Client(s)
Runtime component: “SpamX Client App” (Flutter/Dart)
• UI & app logic:
• lib/main.dart
• lib/splash_screen.dart (explicit app flow state: splash → main UI)
• Nested variant: spam_detection_app/lib/main.dart
• Platform wrappers (not business logic; represent as deployment targets):
• Android: android/… and spam_detection_app/android/…
• iOS: ios/… and spam_detection_app/ios/…
• Web: web/… and spam_detection_app/web/…
• Windows/macOS/Linux similarly
Python Inference Service
Runtime component: “Spam Detection API”
• Entry point: app.py
• Dependencies: requirements.txt
• Deployment process: Procfile
• Model artifacts loaded at runtime:
• spam_model.pkl
• vectorizer.pkl
Model Training (offline pipeline)
Non-runtime / offline component: “Training Pipeline”
• model_train.py
• Outputs: spam_model.pkl, vectorizer.pkl
API
• preprocess text
• vectorize via vectorizer.pkl
• classify via spam_model.pkl
• returns prediction (+ probability if implemented)
Key architectural patterns present (or strongly implied)
• Client–Server inference: Flutter UI separated from ML inference via a Python service.
• Artifact-based ML deployment: serialized vectorizer/model (*.pkl) loaded by the inference runtime.
• Multi-platform packaging (Flutter): same Dart code deployed to multiple OS targets with thin platform runners.
• Offline training vs online serving separation: model_train.py is distinct from app.py.
• Flutter/Dart: lib/*, pubspec.yaml
• Android/iOS/Web/Desktop targets: android/, ios/, web/, windows/, macos/, linux/
• Python API: app.py, requirements.txt, Procfile
• ML artifacts: spam_model.pkl, vectorizer.pkl
• Training: model_train.py
Clear labels
• Subtitle: “Builds: Android/iOS/Web/Desktop”
• Endpoint labels: “POST /predict”
• “SMS text”
• “JSON request/response”
• “Loads model artifacts”
Explicit boundaries
• Client Device / Browser
• Backend Hosting (PaaS/VM/Container)
And optionally a third:
• Developer/CI Environment (training + build)