Skip to content

yashab-cyber/zeo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ZehraSec AI-Powered Client Acquisition System

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.

πŸš€ Features

Core Features

  • 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

Technical Features

  • 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

πŸ› οΈ Technology Stack

Backend

  • 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

Frontend

  • HTML5/CSS3/JavaScript
  • Bootstrap 5.1.3 - UI framework
  • Chart.js - Data visualization
  • Font Awesome - Icons
  • Socket.IO Client - Real-time communication

Dependencies

  • Flask-SQLAlchemy
  • Flask-CORS
  • Flask-SocketIO
  • OpenAI
  • Requests
  • Schedule
  • APScheduler
  • And more (see requirements.txt)

πŸ“ Project Structure

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

πŸ”§ Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • pip (Python package manager)
  • OpenAI API key (optional, for AI features)

1. Clone the Repository

git clone <repository-url>
cd zeo

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

Create 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-password

5. Initialize Database

python -c "from models import init_db; init_db()"

6. Run the Application

python app.py

The application will be available at http://localhost:5000

πŸ“Š Usage

Main Website

  • Visit http://localhost:5000 for the main website
  • Use the chat widget in the bottom-right corner to start conversations
  • Fill out contact forms to generate leads

Admin Dashboard

  • Visit http://localhost:5000/admin/dashboard for the admin interface
  • Manage leads, view analytics, and create email campaigns
  • Monitor real-time chat activity and system performance

API Endpoints

The system provides comprehensive REST API endpoints:

Lead Management

  • GET /api/leads - Get all leads
  • POST /api/leads - Create new lead
  • PUT /api/leads/<id> - Update lead
  • DELETE /api/leads/<id> - Delete lead

Chat System

  • POST /api/chat/start - Start new conversation
  • POST /api/chat/message - Send message
  • GET /api/chat/history - Get chat history

Analytics

  • GET /api/analytics - Get analytics data
  • GET /api/dashboard/stats - Get dashboard statistics

Email Campaigns

  • GET /api/campaigns - Get all campaigns
  • POST /api/campaigns - Create new campaign
  • PUT /api/campaigns/<id> - Update campaign

🎯 Key Features Detail

AI-Powered Chatbot

  • Intent recognition and response generation
  • Context-aware conversations
  • Product recommendations based on user needs
  • Fallback handling for complex queries

Lead Scoring System

  • Automatic lead scoring based on multiple factors
  • Lead qualification and prioritization
  • Engagement tracking and analytics

Email Automation

  • Automated welcome sequences
  • Nurture campaigns based on lead behavior
  • Personalized product recommendations
  • A/B testing capabilities

Analytics Dashboard

  • Real-time performance metrics
  • Lead generation trends
  • Conversion funnel analysis
  • Email campaign performance

πŸ”’ Security Features

  • Input validation and sanitization
  • SQL injection prevention
  • Cross-site scripting (XSS) protection
  • CORS configuration
  • Rate limiting (configurable)

πŸ“ˆ Performance Optimization

  • Database indexing for faster queries
  • Caching for frequently accessed data
  • Optimized API responses
  • Efficient WebSocket handling
  • Static file optimization

πŸ§ͺ Testing

Running Tests

python -m pytest tests/

Test Coverage

  • Unit tests for all services
  • Integration tests for API endpoints
  • Frontend functionality tests

πŸ“š API Documentation

Authentication

Currently, the system uses session-based authentication. API keys can be implemented for programmatic access.

Response Format

All API responses follow this format:

{
  "success": true,
  "data": {...},
  "message": "Success message",
  "timestamp": "2025-01-13T10:30:00Z"
}

Error Handling

Errors are returned with appropriate HTTP status codes:

{
  "success": false,
  "error": "Error message",
  "code": "ERROR_CODE",
  "timestamp": "2025-01-13T10:30:00Z"
}

πŸ”„ Deployment

Production Deployment

  1. Set up production environment variables
  2. Configure production database (PostgreSQL recommended)
  3. Set up email service (SendGrid, AWS SES, etc.)
  4. Configure web server (Nginx + Gunicorn)
  5. Set up SSL certificates
  6. Configure monitoring and logging

Docker Deployment

# Build the image
docker build -t zehrasec-app .

# Run the container
docker run -p 5000:5000 zehrasec-app

πŸ“ Configuration

Environment Variables

  • SECRET_KEY: Flask secret key
  • OPENAI_API_KEY: OpenAI API key for AI features
  • DATABASE_URL: Database connection string
  • EMAIL_HOST: SMTP server host
  • EMAIL_PORT: SMTP server port
  • EMAIL_USER: Email username
  • EMAIL_PASSWORD: Email password

Application Settings

Configure in config.py:

  • Database settings
  • Email settings
  • AI service settings
  • Product information
  • Company information

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Write tests for new functionality
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ’‘ Future Enhancements

  • 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

πŸ†˜ Support

For support and questions:

πŸ™ Acknowledgments

  • 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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors