STAGE 1-4
PROTOTYPE

Complaint Classifier System

Role ML-focused role (did not handle frontend)
Timeline 2025
Platform Web Application (Node.js + Python FastAPI Microservice)
Team Size 2
Node.jsExpressPythonFastAPIscikit-learnTF-IDF
STAGE 1-4 // SYSTEMS COMPLAINT CLASSIFIER SYSTEM Node.js Express Python FastAPI scikit-learn TF-IDF SYSTEM_INIT: OK | MEMORY: ALLOCATED | RENDERING: ONLINE

Mission Brief

Automate campus complaint routing by predicting complaint category, location, and priority from free-form student text using locally trained machine-learning models, while guaranteeing 100% system availability even if the ML service times out or fails.

Key Systems Engineered

Multi-Output TF-IDF + 3 Independent scikit-learn Classifiers (model_server.py)

Loads four serialized joblib artifacts at FastAPI startup: tfidf_vectorizer.joblib, model_complaint_type.joblib, model_location.joblib, and model_priority.joblib (trained on a ~4,000-row dataset, cleaned_complaints_dataset.csv). Vectorizes incoming text once and runs inference across all three classifiers, extracting predict_proba().max() as a confidence score alongside an auto-generated 12-word summary.

Two-Layer Independent Graceful Degradation (server.js & model_server.py)

Layer 1 (Python): If joblib artifacts fail to load at startup, FastAPI automatically falls back to a deterministic rule_based_classify() keyword engine covering 8 campus categories. Layer 2 (Node.js): Express wraps every HTTP call to FastAPI in an 8-second AbortController timeout; if the Python service is unreachable or slow, Node falls back to its own dummyClassify() engine and tags the payload with fallback: true and an explicit fallback_reason.

Zero-Restart Runtime Configuration API (/config & /health)

Exposes GET/POST /config endpoints backed by a mutable in-memory configuration store so administrators can hot-swap between real ML inference and dummy fallback modes or update the FastAPI endpoint URL at runtime without restarting the Node server.

Boss Fight: Preventing Cascading Failures Between the Node API Gateway and Python Inference Process

In a microservice split, a hung Python worker or missing model artifact can block the main web server indefinitely. Enforcing an 8-second AbortController timeout on the Node client paired with dual independent rule-based fallbacks ensured the student submission flow never breaks and transparently reports degraded predictions via fallback_reason.

Implementation Details

Architecture Diagram

Architecture & Deep Dive

The system is split into two independent services communicating over HTTP: a Node.js/Express API gateway handling student requests, and a Python FastAPI inference server running the ML models.

ML Pipeline

At startup, the FastAPI server loads a pre-fitted TF-IDF vectorizer and three independent scikit-learn classifiers from joblib artifacts. Incoming complaint text is vectorized once and passed through all three models (complaint type, location, priority) in parallel, with confidence scores extracted from predict_proba().

Resilience Architecture

The two-layer fallback design ensures the system never goes down. If Python’s model artifacts fail to load, FastAPI falls back to a deterministic keyword-based classifier. If the entire Python service is unreachable, the Node.js layer has its own independent fallback classifier. Every degraded response is transparently tagged with fallback: true and a human-readable fallback_reason.

Runtime Configuration

The /config API allows administrators to hot-swap between real ML inference and dummy mode, or update the Python service URL, all without restarting either service.

Media Gallery

Loot & Rewards

  • 4 serialized production artifacts verified in Models/ trained on ~4,000 synthetic/cleaned student complaint records covering Electricity, Water Supply, IT/Network, Hostel, Civil/Infrastructure, Mess/Canteen, Library, and Transport.
  • 6 REST endpoints verified: POST /classify, POST /submit, GET /complaints, DELETE /complaints/:id, GET /health, and GET/POST /config.

Select Player Class

Your class determines which skills and projects are highlighted throughout the site.

Achievements (0/11)

Press Start
Skipped or clicked through the boot sequence.
Class Act
Selected a Player Class to customize project ordering.
Efficient
Opened the 60-second Recruiter Mode summary.
Level Up
Opened your first engineering project Case File.
Completionist
Cleared all 12 project Case Files.
Coin Collector
Found and collected all 7 hidden coins across the site.
Old School
Entered the Konami Code or activated Arcade Mode.
Snake Charmer
Scored 10 or more points in the 404 Game Over Snake mini-game.
Hello, World
Copied the contact email address to your clipboard.
Curious
Opened the Keyboard Controls (?) overlay.
Bonus Round
Entered the hidden Bonus Stage development lab.

System Settings

Theme
Motion
Audio
Sound Effects
Advanced
Keyboard Shortcuts
Show Hidden Coins
Arcade Mode (CRT)

Keyboard Shortcuts

Navigate Sections
1 2 3 4
Open Achievements
A
Open Settings
S
Toggle Audio
M
Close Modal
Esc
Konami Code
↑ ↑ ↓ ↓ ← → ← → B A