A full-stack, futuristic web application that uses Machine Learning to detect and visualize spam threats in real-time.
NeuroSentry is a specialized end-to-end spam detection pipeline. It features a hardened FastAPI Python Backend running a pre-trained Scikit-Learn LogisticRegression model, paired with a sleek, Cyber-Futuristic React Frontend.
Instead of relying on standard 50/50 prediction splits, this engine intercepts the raw probability matrices and enforces a custom 0.4 strict threshold to aggressively filter out sophisticated spam payloads.
- ⚡ Blazing Fast API: Built on standard ASGI Python architecture (FastAPI + Uvicorn).
- 🛡️ Custom ML Thresholds: Programmatically intercepts
predict_probato enforce strict spam classifications. - 🎨 Glassmorphism UI: A visually stunning dark-mode interface (
#0B1A12&#B4FF00) with deep blur effects. - 🎬 Micro-Interactions: Fully animated using
framer-motionfor a premium, futuristic user experience (dynamic probability fill-bars, shrinking UI states). - 📱 Fully Responsive: Locks perfectly to the viewport without breaking format, rendering beautifully on smartphones and 4K monitors alike.
- Framework: FastAPI
- Machine Learning: Scikit-Learn, Joblib (TF-IDF Vectorization)
- Validation: Pydantic
- Server: Uvicorn
- Framework: React 18 (Initialized via Vite)
- Styling: Pure Vanilla CSS (No bloat, absolute control)
- Animations: Framer Motion
- Icons: Lucide-React
📦 spammessagedetector
┣ 📂 backend # Python API & ML Engine
┃ ┣ 📂 app
┃ ┃ ┣ 📂 core # App Config (Thresholds, Paths)
┃ ┃ ┣ 📂 schemas # Pydantic validation contracts
┃ ┃ ┣ 📂 services # ML Pickle loading & Prediction Logic
┃ ┃ ┗ 📜 main.py # FastAPI Router & CORS initialization
┃ ┣ 📂 dataset # Training data and spam_detector.pkl
┃ ┣ 📜 README.md # Backend specific docs
┃ ┣ 📜 requirements.txt # Python dependencies
┃ ┗ 📜 test_api.py # Endpoint integration testing
┃
┣ 📂 frontend # Cyber-Futuristic React UI
┃ ┣ 📂 src
┃ ┃ ┣ 📜 App.jsx # Core animated interface
┃ ┃ ┣ 📜 index.css # Global theme variables & Glassmorphism
┃ ┃ ┗ 📜 main.jsx # React root injection
┃ ┣ 📜 index.html # Entry point & Google Fonts
┃ ┣ 📜 package.json # Node dependencies (configured via npx)
┃ ┗ 📜 vite.config.js # Vite bundler settings
┗ 📜 README.md # You are here!
To run this full-stack application locally, you will need two terminal windows open.
cd backend
# Create a virtual env (Optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Boot the server
uvicorn app.main:app --reloadThe api is now listening on http://127.0.0.1:8000
Open a new terminal tab:
cd frontend
# Install Node modules
npm install
# Start the Vite development server
npm run devThe UI is now live at http://localhost:5173
This backend is optimized for Render's Web Service environment.
- Connect this repo to Render.
- Set Root Directory to
backend. - Set Build Command to
pip install -r requirements.txt. - Set Start Command to
uvicorn app.main:app --host 0.0.0.0 --port $PORT.
This frontend is configured to bypass common permission bugs heavily prevalent in Vite/Vercel migrations.
- Connect this repo to Vercel.
- Set Root Directory to
frontend. - The Build settings will auto-detect Vite. The
package.jsonhas already been hardened usingnpx vite buildto ensure cloud-compilation works flawlessly. (Note: Be sure to update the fetch URL inApp.jsxfrom127.0.0.1to your live deployed backend URL once your Render API instance is live).