Fsa
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.
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
π 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
| Requirement | Version | Purpose |
|---|---|---|
| Docker + Docker Compose | Latest | Full stack orchestration |
| Python | 3.10+ | Backend & ML model development |
| Node.js | 18+ | Frontend & extension development |
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 --buildThe API is live at
http://localhost:8000
Interactive Swagger UI is available athttp://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 --reloadThe API will be available at http://localhost:8000.
π Installing the Browser Extension
- Open your Chromium-based browser and navigate to
chrome://extensions/ - Toggle Developer mode ON in the top-right corner
- Click Load unpacked and select the
browser-extension/folder from the repository root - The PhishX shield icon will appear in your toolbar β click it to scan any URL instantly
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 |
|
π 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. |
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.