How dhairyagoel05/aiticketgenerator works
Project Type and Purpose
• This is a full-stack, Python-based customer support ticket management application with a Streamlit UI (“main.py”/“app.py”), AI-powered backend services, and integrations with external APIs (Gmail, Google Sheets).
Core Components (to include as distinct blocks)
a. Frontend (Streamlit)
• register_ticket.py: Ticket submission form
• main.py: Dashboard showing incoming tickets and AI responses
b. Business Logic / AI Services (tools/)
• classify_ticket.py: AI classification of ticket type
• generate_reply.py: AI-generated response content
• (Optionally) testeuri.py: Test harness or utility scripts
c. Integration Layer
• gmail_sender.py: Gmail API wrapper for sending emails
• sheet_connector.py: Google Sheets API wrapper for logging/tracking tickets
d. Configuration
• .env: Environment variables (GMAIL_USERNAME, GMAIL_PASSWORD, SPREADSHEET_ID)
• requirements.txt: Python dependencies (Streamlit, google-api-python-client, OpenAI/other AI SDK)
Data Flows and Interactions
• User → Streamlit Frontend (register_ticket.py)
• Submits form → Form data passed to business logic
• Business Logic →
• classify_ticket.py → returns category + sentiment
• generate_reply.py → returns reply text
• Logging → sheet_connector.py → writes ticket + classification + reply to Google Sheet
• Outbound Email → gmail_sender.py → sends AI reply to user’s email
• Monitoring → main.py dashboard pulls from Google Sheets (via sheet_connector.py) to display ticket queue, statuses, and responses
Architectural Patterns & Design Principles
• Separation of concerns: UI, AI processing, and external integrations are modular
• Single-responsibility modules: each script in tools/ focuses on one integration or AI task
• External service adapters: wrap Gmail and Sheets APIs behind simple function calls
• Environment abstraction: .env file keeps secrets/config out of code