Skip to content

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhishNet

An AI-powered phishing detection system that classifies emails/URLs as safe or suspicious. Uses machine learning and natural language processing to identify phishing attempts and protect users from online threats.

Run the project locally

The app has two parts you run separately: a Node/Express backend and a Vite/React frontend.

Prerequisites

  • Node.js 18+ (recommended for Vite 7 and Express 5)
  • Python 3.10+
  • Package managers:
    • Backend: npm (or pnpm/yarn if you prefer)
    • Frontend: pnpm (repo is configured for pnpm)
    • Python: pip
  • A MongoDB connection (local MongoDB or MongoDB Atlas URI)
  • Ollama installed and a local model pulled (e.g., llama3)

1) Backend (API)

Location: backend/

  1. Create or update a .env file in backend/ with at least:

    • PORT=5000
    • MONGO_URI=<your-mongodb-connection-string>
    • JWT_SECRET=<a-strong-random-string>
    • FRONTEND_ORIGIN=http://localhost:8080 (for Vite dev server CORS)
  2. Install dependencies:

    cd backend
    npm install
  3. Start the server:

    node server.js
    • The API will listen on http://localhost:5000 by default.

2) Frontend (Web app)

Location: frontend/

  1. Install dependencies (pnpm):

    cd frontend
    pnpm install
  2. Run the dev server:

    pnpm dev
    • The app runs at http://localhost:8080.
    • Ensure the backend is running and CORS allows http://localhost:8080 (see FRONTEND_ORIGIN above).

3) Python Services (FastAPI)

Location: python_services/

  1. Create and activate a virtual environment:

    cd python_services
    python -m venv .venv
    source .venv/Scripts/activate
  2. Install dependencies:

    python3 -m pip install -r requirements.txt
  3. Start the server:

    python3 main.py
    • The Python API will listen on http://localhost:9000 by default.

Running them together

  • Open three terminals:
    • Terminal A: start the backend (node server.js in backend/).
    • Terminal B: start the frontend (pnpm dev in frontend/).
    • Terminal C: start Python services (python main.py in python_services/).

Or, if you’ve already installed dependencies and set up env files, you can start all three at once:

chmod +x start_servers.sh
./start_servers.sh

Tip: After you’ve made the scripts executable once, you can simply run:

./start_servers.sh

About

AAn AI-powered phishing detection system that classifies emails/URLs as safe or suspicious. Uses machine learning and natural language processing to identify phishing attempts and protect users from online threats.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages