A lightweight FastAPI server for phishing detection, deployable on Render.
- Domain Reputation Check: Checks against a MongoDB database.
- Advanced Analysis: Uses Playwright and heuristic analysis for unknown domains.
- LLM Verification: Uses Groq (or OpenAI) to verify suspicious content.
- API Key Authentication: Secured via
X-API-Keyheader.
-
Install Dependencies:
pip install -r requirements.txt playwright install chromium
-
Environment Variables: Create a
.envfile:API_KEY=your_secret_key GROQ_API_KEY=your_groq_key MONGO_URI=your_mongodb_uri -
Initialize Database:
python scripts/init_db.py
-
Run Server:
uvicorn app.main:app --reload
-
Test Endpoint:
curl -X POST "http://localhost:8000/check-phishing" \ -H "X-API-Key: your_secret_key" \ -H "Content-Type: application/json" \ -d '{"url": "http://example.com"}'
- Push this repository to GitHub/GitLab.
- Create a new Web Service on Render.
- Connect your repository.
- Render should automatically detect
render.yaml(or you can manually configure).- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port 10000
- Build Command:
- Environment Variables:
API_KEY: Set a strong secret.GROQ_API_KEY: Add your Groq API Key.
Once running, visit /docs for the Swagger UI.