A complete AI-powered client acquisition and engagement system built for ZehraSec, a cybersecurity company. This system includes lead generation, client engagement (chatbot), product recommendation, CRM, analytics dashboard, and email automation.
- AI-Powered Chatbot: Intelligent conversation handling with OpenAI integration
- Lead Generation: Automated lead capture and scoring system
- CRM Integration: Complete customer relationship management
- Email Automation: Automated email campaigns and nurture sequences
- Analytics Dashboard: Real-time insights and performance metrics
- Product Recommendations: AI-driven product suggestions
- Appointment Scheduling: Integrated booking system
- Real-time Chat: WebSocket-based live communication
- Flask Backend: RESTful API with comprehensive endpoints
- SQLite Database: Local storage with ORM-like data models
- WebSocket Support: Real-time communication with Socket.IO
- Modern UI: Bootstrap-based responsive design
- Admin Dashboard: Complete management interface
- Export Functionality: CSV/PDF export capabilities
- Search & Filtering: Advanced search and filtering options
- Python 3.8+
- Flask 2.3.3 - Web framework
- SQLite - Database
- OpenAI API - AI integration
- Socket.IO - Real-time communication
- Pandas - Data processing
- Scikit-learn - Machine learning
- HTML5/CSS3/JavaScript
- Bootstrap 5.1.3 - UI framework
- Chart.js - Data visualization
- Font Awesome - Icons
- Socket.IO Client - Real-time communication
- Flask-SQLAlchemy
- Flask-CORS
- Flask-SocketIO
- OpenAI
- Requests
- Schedule
- APScheduler
- And more (see requirements.txt)
zeo/
βββ app.py # Main Flask application
βββ config.py # Configuration settings
βββ models.py # Database models and ORM
βββ requirements.txt # Python dependencies
βββ routes/
β βββ api_routes.py # REST API endpoints
β βββ chat_routes.py # Chat functionality
β βββ dashboard_routes.py # Admin dashboard
βββ services/
β βββ ai_service.py # AI and OpenAI integration
β βββ analytics_service.py # Analytics and reporting
β βββ crm_service.py # CRM functionality
β βββ email_service.py # Email automation
β βββ lead_service.py # Lead management
βββ templates/
β βββ index.html # Main website
β βββ chat.html # Chat interface
β βββ admin/
β βββ dashboard.html # Admin dashboard
β βββ leads.html # Lead management
β βββ analytics.html # Analytics page
β βββ campaigns.html # Email campaigns
βββ static/
βββ css/
β βββ style.css # Main website styles
β βββ admin.css # Admin dashboard styles
βββ js/
βββ main.js # Main website scripts
βββ admin.js # Admin dashboard scripts
- Python 3.8 or higher
- pip (Python package manager)
- OpenAI API key (optional, for AI features)
git clone <repository-url>
cd zeopython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory:
SECRET_KEY=your-secret-key-here
OPENAI_API_KEY=your-openai-api-key
DATABASE_URL=sqlite:///zehrasec.db
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASSWORD=your-email-passwordpython -c "from models import init_db; init_db()"python app.pyThe application will be available at http://localhost:5000
- Visit
http://localhost:5000for the main website - Use the chat widget in the bottom-right corner to start conversations
- Fill out contact forms to generate leads
- Visit
http://localhost:5000/admin/dashboardfor the admin interface - Manage leads, view analytics, and create email campaigns
- Monitor real-time chat activity and system performance
The system provides comprehensive REST API endpoints:
GET /api/leads- Get all leadsPOST /api/leads- Create new leadPUT /api/leads/<id>- Update leadDELETE /api/leads/<id>- Delete lead
POST /api/chat/start- Start new conversationPOST /api/chat/message- Send messageGET /api/chat/history- Get chat history
GET /api/analytics- Get analytics dataGET /api/dashboard/stats- Get dashboard statistics
GET /api/campaigns- Get all campaignsPOST /api/campaigns- Create new campaignPUT /api/campaigns/<id>- Update campaign
- Intent recognition and response generation
- Context-aware conversations
- Product recommendations based on user needs
- Fallback handling for complex queries
- Automatic lead scoring based on multiple factors
- Lead qualification and prioritization
- Engagement tracking and analytics
- Automated welcome sequences
- Nurture campaigns based on lead behavior
- Personalized product recommendations
- A/B testing capabilities
- Real-time performance metrics
- Lead generation trends
- Conversion funnel analysis
- Email campaign performance
- Input validation and sanitization
- SQL injection prevention
- Cross-site scripting (XSS) protection
- CORS configuration
- Rate limiting (configurable)
- Database indexing for faster queries
- Caching for frequently accessed data
- Optimized API responses
- Efficient WebSocket handling
- Static file optimization
python -m pytest tests/- Unit tests for all services
- Integration tests for API endpoints
- Frontend functionality tests
Currently, the system uses session-based authentication. API keys can be implemented for programmatic access.
All API responses follow this format:
{
"success": true,
"data": {...},
"message": "Success message",
"timestamp": "2025-01-13T10:30:00Z"
}Errors are returned with appropriate HTTP status codes:
{
"success": false,
"error": "Error message",
"code": "ERROR_CODE",
"timestamp": "2025-01-13T10:30:00Z"
}- Set up production environment variables
- Configure production database (PostgreSQL recommended)
- Set up email service (SendGrid, AWS SES, etc.)
- Configure web server (Nginx + Gunicorn)
- Set up SSL certificates
- Configure monitoring and logging
# Build the image
docker build -t zehrasec-app .
# Run the container
docker run -p 5000:5000 zehrasec-appSECRET_KEY: Flask secret keyOPENAI_API_KEY: OpenAI API key for AI featuresDATABASE_URL: Database connection stringEMAIL_HOST: SMTP server hostEMAIL_PORT: SMTP server portEMAIL_USER: Email usernameEMAIL_PASSWORD: Email password
Configure in config.py:
- Database settings
- Email settings
- AI service settings
- Product information
- Company information
- Fork the repository
- Create a feature branch
- Make your changes
- Write tests for new functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- User authentication and role-based access
- Advanced analytics and reporting
- Integration with popular CRM systems
- Mobile app for iOS and Android
- Advanced AI features (sentiment analysis, etc.)
- Multi-language support
- Advanced email templates
- Integration with social media platforms
- Video chat capabilities
- Advanced security features
For support and questions:
- Email: support@zehrasec.com
- Documentation: [Link to documentation]
- Issues: GitHub Issues
- OpenAI for AI capabilities
- Flask community for the excellent framework
- Bootstrap for UI components
- All contributors and testers
ZehraSec AI-Powered Client Acquisition System - Building the future of cybersecurity sales and engagement.