Commit Graph

8 Commits

Author SHA1 Message Date
salvacybersec
fa6259e0bd Mail scheme updated v2 2025-11-11 04:09:45 +03:00
salvacybersec
06136294da Mail schemes updated auto system 2025-11-11 03:02:11 +03:00
salvacybersec
a8bedc7fbc feat: Significantly improve AI prompt quality for template generation
Enhanced system prompt:
- Professional cyber security expert role
- Modern HTML/CSS styling instructions
- Responsive design requirements
- Persuasive and urgent tone guidance
- Turkish language grammar emphasis
- Realistic corporate email appearance

Enhanced user prompt:
- Better structured input with emojis (📌)
- Clear field labels (HEDEF ŞİRKET, SENARYO, etc.)
- Detailed HTML example with inline CSS
- Button styling, footer, responsive design
- Max 70 char subject line guidance
- Multiple warnings for quality output

All user inputs are sent to AI:
 company_name (Şirket Adı)
 scenario (Senaryo)
 employee_info (Çalışan Bilgisi) - optional
 custom_prompt (Ek Talimatlar) - optional

template_name and template_type are for DB only, NOT sent to AI.

This will produce much higher quality, styled HTML emails.
2025-11-11 02:49:12 +03:00
salvacybersec
1b3d6f263f fix: Remove unique constraint from template_type and improve AI response handling
Database Changes:
- Remove UNIQUE constraint from mail_templates.template_type
- Allow multiple templates with same type (e.g., multiple bank templates)

Ollama Service Improvements:
- Add detailed logging for AI responses (first 500 chars)
- Check multiple field name variations (subject/Subject/konu/title, body/Body/html/content)
- Improve error messages with actual field names
- Better JSON parsing with fallback
- Clearer prompt instructions to AI

This fixes:
- 400 Validation Error when creating templates with existing type
- AI response parsing issues with different field names
2025-11-10 23:40:46 +03:00
salvacybersec
af0510e486 feat: Add Ollama AI integration for automatic mail template generation
 New Features:
- 🤖 AI-powered mail template generation with Ollama
- 📧 Test mail sending with preview
- 🔧 Ollama server and model management
- 🎨 Beautiful AI generation dialog in Templates page
- ⚙️ Ollama settings panel with connection test

Backend:
- Add ollama.service.js - Ollama API integration
- Add ollama.controller.js - Template generation endpoint
- Add ollama.routes.js - /api/ollama/* routes
- Support for multiple Ollama models (llama3.2, mistral, gemma)
- JSON-formatted AI responses with subject + HTML body
- Configurable server URL and model selection

Frontend:
- Settings: Ollama configuration panel
  - Server URL input
  - Model selection
  - Connection test with model listing
- Templates: AI generation dialog
  - Company name, scenario, employee info inputs
  - Custom prompt for AI instructions
  - Auto-save to database
  - Test mail sending functionality

Documentation:
- OLLAMA_SETUP.md - Comprehensive setup guide
- Installation instructions
- Model recommendations
- Usage examples
- Troubleshooting

Tech Stack:
- Ollama API integration (REST)
- Axios HTTP client
- React dialogs with MUI
- Self-hosted AI (privacy-friendly)
- Zero external API dependencies

Example Usage:
  Company: Garanti Bankası
  Scenario: Account security warning
  → AI generates professional phishing test mail in seconds!
2025-11-10 21:13:58 +03:00
salvacybersec
f86cda2978 Domain support 2025-11-10 20:01:41 +03:00
salvacybersec
dea1b874b5 feat: Send actual test email instead of just verifying connection
- testConnection now sends a real test email to the configured Gmail address
- User receives actual email confirmation that setup works
- Email contains success message and system info
2025-11-10 19:31:42 +03:00
salvacybersec
19e551f33b first commit: Complete phishing test management panel with Node.js backend and React frontend 2025-11-10 17:00:40 +03:00