Skip to content

Uditpandya07/PhishX

Repository files navigation

Fsa

PhishX Threat Radar



PhishX Animated Subtitle



Live App Live API Docs Status License: PolyForm Noncommercial



FastAPI Next.js PostgreSQL Docker Python ML Celery Worker WebSockets



PhishX v2.0 is a sophisticated, full-stack cybersecurity platform engineered to neutralize phishing threats in real-time. Now powered by Next.js 15, a real-time WebSocket scanning engine, xAI heuristic analysis, Celery distributed task queues, and a GDPR/DPDP compliant legal framework β€” PhishX delivers enterprise-grade URL threat intelligence wrapped in a stunning, fully-responsive production-ready interface optimized for mobile and desktop.


✦ Core Capabilities


AI

🧠 AI-Driven Threat Detection

Custom ML model combined with a Zero-Latency Offline Top 10k Whitelist and a Dynamic Community Feedback loop. Identifies zero-day phishing attempts while organically adapting to prevent false positives β€” completely free of charge.


Speed

⚑ Zero-Latency Backend

Built on async FastAPI β€” every scan, auth check, and admin call is fully non-blocking. Engineered for high-throughput workloads with sub-100ms median response times.


Extension

🌐 Browser Extension

A custom Chromium extension that performs real-time URL scanning directly from your toolbar. No copy-paste β€” get threat verdicts on any URL in one click.


Security

πŸ” Hardened Authentication

End-to-end local JWT authentication with HttpOnly cookie sessions and bcrypt password hashing. Zero dependency on third-party auth providers β€” your data stays sovereign.


SaaS

πŸ’³ SaaS-Ready Payments

Fully scaffolded subscription management and payment endpoints ready for enterprise scaling. Plug in your payment processor and go live with tiered plans immediately.


Docker

☁️ Production-Containerized

Fully Dockerized with separate development and production docker-compose configurations. Automated CI/CD pipelines via GitHub Actions for zero-downtime deployments.


UI/UX

🎨 Immersive UI/UX

A sleek, responsive dark-mode interface with a full-screen scanning panel. The URL input and scan button are precisely parallel for a frictionless, focused user experience.


Rate Limiting

πŸ›‘οΈ Rate Limiting & Abuse Guard

Integrated API-level rate limiting prevents brute-force attacks and endpoint abuse. Alembic-managed database migrations ensure schema integrity across all environments.


Open Source

πŸ”“ Open & Auditable

No hardcoded secrets. No black boxes. All credentials managed via .env files with a comprehensive .env.example. Ready for CodeQL and GitHub Advanced Security scanning.


✦ System Architecture

The PhishX ecosystem is built as a set of fully decoupled services, each with a distinct responsibility:

graph TD
    subgraph CLIENT["πŸ–₯️  CLIENT LAYER"]
        A["βš›οΈ Next.js 15\nFrontend\n(Vercel)"]
        B["🧩 Browser Extension\n(Chromium)"]
    end

    subgraph BACKEND["βš™οΈ  BACKEND LAYER  Β·  FastAPI"]
        C["πŸ” Auth API\n/api/v1/auth"]
        D["πŸ” Scan API\n/api/v1/scans"]
        E["πŸ‘€ User API\n/api/v1/users"]
        F["πŸ’³ Payments API\n/api/v1/payments"]
        G["πŸ›‘οΈ Admin API\n/api/v1/admin"]
        N["πŸ“‘ News API\n/api/v1/news"]
        CT["🎫 Contact API\n/api/v1/contact"]
        WS["πŸ”Œ WebSocket\n/ws/scan"]
    end

    subgraph INTELLIGENCE["πŸ€–  ML INTELLIGENCE LAYER  Β·  Python"]
        H["πŸ“Š Feature Extractor\n(Lexical Analysis)"]
        I["🧠 Phishing Classifier\n(Trained ML Model)"]
        J["πŸ“ Dataset\nphishing_site_urls.csv"]
        W["⚑ Zero-Latency\nTop 10k & Feedback Whitelist"]
        XAI["πŸ”¬ xAI Heuristics\n(Zero-Day Detection)"]
    end

    subgraph DATA["πŸ—„οΈ  DATA LAYER"]
        K[("🐘 PostgreSQL\nDatabase")]
        L["πŸ“œ Alembic\nMigrations"]
    end

    A -- "HTTPS REST" --> C & D & E & F
    A -- "WebSocket" --> WS
    B -- "HTTPS REST" --> D
    D --> W --> H --> I --> J
    D --> XAI
    C & D & E & F & G & N & CT --> K
    L --> K

    style CLIENT fill:#0d1117,stroke:#00E676,color:#ffffff
    style BACKEND fill:#0d1117,stroke:#00BCD4,color:#ffffff
    style INTELLIGENCE fill:#0d1117,stroke:#7C4DFF,color:#ffffff
    style DATA fill:#0d1117,stroke:#FF6D00,color:#ffffff
Loading

✦ Project Structure

πŸ“‚ Click to expand the full directory tree
PhishX/
β”‚
β”œβ”€β”€ πŸ“ backend/                          # FastAPI Application Core
β”‚   β”œβ”€β”€ πŸ“ alembic/                      # Database migration scripts & env
β”‚   β”œβ”€β”€ πŸ“ app/
β”‚   β”‚   β”œβ”€β”€ πŸ“ api/v1/                   # Versioned API Endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py                  #   β†’ JWT Login / Register / OAuth (Google)
β”‚   β”‚   β”‚   β”œβ”€β”€ scans.py                 #   β†’ URL Threat Scanning (real-time + history)
β”‚   β”‚   β”‚   β”œβ”€β”€ users.py                 #   β†’ User Profile & Settings
β”‚   β”‚   β”‚   β”œβ”€β”€ payments.py              #   β†’ Subscription & Billing
β”‚   β”‚   β”‚   β”œβ”€β”€ admin.py                 #   β†’ Admin Operations & Safety Locks
β”‚   β”‚   β”‚   β”œβ”€β”€ contact.py               #   β†’ In-App Support Ticketing (NEW v2)
β”‚   β”‚   β”‚   β”œβ”€β”€ news.py                  #   β†’ CyberPulse News Proxy (NEW v2)
β”‚   β”‚   β”‚   └── ws.py                    #   β†’ WebSocket Telemetry (NEW v2)
β”‚   β”‚   β”œβ”€β”€ πŸ“ core/
β”‚   β”‚   β”‚   β”œβ”€β”€ config.py                #   β†’ Pydantic Settings & Env Vars
β”‚   β”‚   β”‚   β”œβ”€β”€ security.py              #   β†’ JWT, bcrypt, HttpOnly Cookies
β”‚   β”‚   β”‚   └── rate_limit.py            #   β†’ Abuse Prevention
β”‚   β”‚   β”œβ”€β”€ πŸ“ db/
β”‚   β”‚   β”‚   β”œβ”€β”€ models.py                #   β†’ SQLAlchemy ORM Models (incl. ContactQuery)
β”‚   β”‚   β”‚   β”œβ”€β”€ session.py               #   β†’ DB Session Factory
β”‚   β”‚   β”‚   └── seed.py                  #   β†’ Database Seeder Script
β”‚   β”‚   β”œβ”€β”€ πŸ“ schemas/                  # Pydantic Request/Response Contracts
β”‚   β”‚   └── πŸ“ services/
β”‚   β”‚       β”œβ”€β”€ feature_extractor.py     #   β†’ ML Lexical Feature Pipeline
β”‚   β”‚       β”œβ”€β”€ top_10k.py               #   β†’ Trusted Domain Whitelist
β”‚   β”‚       └── xai.py                   #   β†’ Zero-Day Heuristic Analysis (NEW v2)
β”‚   β”œβ”€β”€ worker.py                        # Async Celery Worker (NEW v2)
β”‚   └── Dockerfile                       # Backend Container Image
β”‚
β”œβ”€β”€ πŸ“ browser-extension/                # Chromium Real-Time Extension
β”‚
β”œβ”€β”€ πŸ“ phishx-frontend/                  # Next.js 15 Frontend (UPGRADED v2)
β”‚   β”œβ”€β”€ πŸ“ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“ app/                      #   β†’ Next.js App Router
β”‚   β”‚   β”œβ”€β”€ πŸ“ components/               #   β†’ UI Components
β”‚   β”‚   β”‚   β”œβ”€β”€ AdminPanel.jsx           #   β†’ Admin Dashboard + Diagnostics
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthModal.jsx            #   β†’ Auth with Consent Checkbox (v2)
β”‚   β”‚   β”‚   β”œβ”€β”€ ContactModal.jsx         #   β†’ In-App Support Form (NEW v2)
β”‚   β”‚   β”‚   β”œβ”€β”€ CookieBanner.jsx         #   β†’ GDPR Cookie Consent (NEW v2)
β”‚   β”‚   β”‚   └── ScanPanel.jsx            #   β†’ Real-time WebSocket Scanner
β”‚   β”‚   └── πŸ“ views/                    #   β†’ Page-level Views
β”‚   └── πŸ“ public/                       #   β†’ Static Assets & Logos
β”‚
β”œβ”€β”€ πŸ“ terraform/                        # Infrastructure as Code (NEW v2)
β”œβ”€β”€ πŸ“ .github/workflows/                # CI/CD Pipelines
β”‚   β”œβ”€β”€ ci-pipeline.yml
β”‚   └── cd-pipeline.yml
β”‚
β”œβ”€β”€ docker-compose.yml                   # Development Environment
β”œβ”€β”€ CHANGELOG_v2.md                      # v2.0.0 Full Release Notes
└── README.md

✦ Getting Started

Prerequisites

Requirement Version Purpose
Docker + Docker Compose Latest Full stack orchestration
Python 3.10+ Backend & ML model development
Node.js 18+ Frontend & extension development

🐳 Quickstart with Docker (Recommended)

The fastest way to run the complete PhishX stack locally.

# 1. Clone the repository
git clone https://github.com/Uditpandya07/PhishX.git
cd PhishX

# 2. Configure environment variables
cp .env.example .env
# β†’ Open .env and fill in: DB credentials, JWT secret, SMTP config

# 3. Launch the full stack
docker-compose up -d --build

The API is live at http://localhost:8000
Interactive Swagger UI is available at http://localhost:8000/docs


πŸ› οΈ Local Development Setup (Backend without Docker)
# Navigate to the backend directory
cd backend

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate       # macOS / Linux
# venv\Scripts\activate        # Windows

# Install all dependencies
pip install -r requirements.txt

# Run database migrations
alembic upgrade head

# (Optional) Seed the database with sample data
python app/db/seed.py

# Start the development server with hot-reload
uvicorn app.main:app --reload

The API will be available at http://localhost:8000.


🌐 Installing the Browser Extension
  1. Open your Chromium-based browser and navigate to chrome://extensions/
  2. Toggle Developer mode ON in the top-right corner
  3. Click Load unpacked and select the browser-extension/ folder from the repository root
  4. The PhishX shield icon will appear in your toolbar β€” click it to scan any URL instantly

✦ Security Standards

PhishX is engineered with a security-first philosophy at every layer of the stack.

Standard Implementation
πŸ”‘ No Hardcoded Secrets All keys and passwords managed exclusively via .env files; excluded from version control via .gitignore
πŸͺ Secure Session Management JWT tokens delivered via HttpOnly + Secure cookies β€” immune to XSS token theft
πŸ”’ Password Security bcrypt adaptive hashing with configurable work factors β€” future-proof against brute force
🚦 API Rate Limiting Per-endpoint rate limiting middleware blocks credential stuffing and scan abuse
πŸ—„οΈ Schema Integrity All database changes managed through Alembic migration scripts β€” no ad-hoc mutations
πŸ” Static Analysis Ready Codebase structured for seamless integration with GitHub Advanced Security and CodeQL

✦ Documentation


πŸš€ Deployment Guide
docs/DEPLOYMENT.md

Step-by-step instructions for pushing PhishX to a production environment with Docker.


πŸ“– Development Journey
docs/JOURNEY.md

The history, architecture decisions, and trade-offs made throughout the build.


✍️ Rule Authoring
docs/RULE_AUTHORING.md

Guidelines for writing custom threat detection rules for the scanning engine.


βš–οΈ Rule Precedence
docs/RULE_PRECEDENCE.md

How conflicting rules are evaluated and resolved by the detection pipeline.


✦ License

PhishX is released under the PolyForm Noncommercial License 1.0.0.

Permission Details
βœ… Personal use Free to use for personal, educational, and research purposes
βœ… Modification Fork, modify, and adapt the source code
βœ… Distribution Share the software in its original or modified form
❌ Commercial use Using PhishX or any derivative in a paid product, SaaS, or commercial service is not permitted

For commercial licensing enquiries, please open an issue or contact the maintainer directly.



PhishX



Built with precision. Deployed for impact. Defending the web β€” one URL at a time.


Live App



Β© PhishX β€” Open Source Cybersecurity Intelligence

About

PhishX is a minimal full-stack phishing URL detection platform that uses machine learning to analyze URLs, generate risk scores, and explain potential threats in real time.

Resources

License

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Sponsor this project

 

Packages

 
 
 

Contributors