# vishvas-dubey/ai_event_bot architecture

> Architecture diagram of the GitHub repository vishvas-dubey/ai_event_bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishvas-dubey/ai_event_bot
- Repository: https://github.com/vishvas-dubey/ai_event_bot

## Overview

##### Project type and purpose
- This is a full-stack web application (“AI_EVENT_BOT”) that provides a conversational AI assistant for workshop participants.
- It uses a Python Flask backend, a simple HTML/CSS/JavaScript frontend, and integrates with Google Gemini for natural language understanding, resume processing, recommendations, and feedback collection.

##### File structure
Top level:
- app.py / main.py / newapp.py – Flask entry points and routing
- utils.py, audio.py – helper modules (e.g., audio handling, shared utilities)
- style.css – front­end styling
- resume/ – uploaded PDF resumes
- *.json / *.csv (registrations.csv, participants.json, agenda.json, location.json, confirmed_users.json) – flat-file data stores
- requirements.txt, Dockerfile – build & deployment

##### README for architecture insights
- Backend system broken into modules: Authentication, Resume Processing, Event Info, Recommendation Engine, Feedback Collection
- Frontend: chat UI, quick-access buttons, session display, feedback form
- AI integration: Google Gemini for language understanding and resume analysis

##### Main components
a. Users & Clients
- Web browser or mobile browser (UI)
b. Frontend Layer
- HTML/CSS/JavaScript chat interface
- Quick-access buttons & feedback form
c. Backend Layer (Flask Application)
- Authentication Service (verifies against registrations.csv/confirmed_users.json)
- Resume Processing Module (uploads to resume/, invokes Google Gemini API)
- Event Information Service (reads agenda.json, location.json, time logic)
- Recommendation Engine (matches extracted skills to sessions)
- Feedback Collection Service (stores star ratings and comments into CSV/JSON)
- Utility Services (audio processing, logging, configuration)
d. Data Stores
- Flat files: CSV/JSON for registration, participants, agendas, locations, feedback
- Resume file store (resume/*.pdf)
e. External Services
- Google Gemini API (NLP, resume analysis, context-aware responses)

##### Relationships and interactions
- User interacts via the Frontend → sends HTTP requests (AJAX/WebSocket) → Flask Backend
- Backend Authentication Service reads CSV/JSON → responds with access grant or denial
- On resume upload, Backend calls Google Gemini → parses response → stores skill profile
- Event Info Service monitors server time → replies to queries (current session, countdown, locations)
- Recommendation Engine reads skill profiles + agenda → returns recommended sessions
- Feedback Module captures ratings/comments → appends to feedback CSV/JSON
- All modules communicate internally via function calls or shared utils

##### Architectural patterns & design principles
- Layered architecture (Presentation / Application / Data)
- Modular services within the Flask app for separation of concerns
- Stateless HTTP endpoints, with state persisted in flat files (could evolve to a database)
- External AI service orchestration for NLP and resume analysis

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User and Frontend
    User["User Browser"]:::external
    subgraph "Frontend Layer"
        ChatUI["Frontend Chat UI (HTML/CSS/JS)"]:::frontend
    end

    %% Backend Services
    subgraph "Flask Backend" 
        Auth["Authentication Service"]:::backend
        Resume["Resume Processing Module"]:::backend
        EventInfo["Event Info Service"]:::backend
        Recommender["Recommendation Engine"]:::backend
        Feedback["Feedback Collection Service"]:::backend
        Utility["Utility/Audio Module"]:::backend
    end

    %% Data Stores
    subgraph "Data Stores"  
        direction TB
        RegCSV["registrations.csv"]:::data
        ConfUsers["confirmed_users.json"]:::data
        Participants["participants.json"]:::data
        Agenda["agenda.json"]:::data
        Location["location.json"]:::data
        ConfPart["confirmed_participants.csv"]:::data
        ResumeStore["Resume File Store (resume/*.pdf)"]:::data
    end

    %% External AI Service
    GoogleGemini["Google Gemini API"]:::external

    %% Connections
    User -->|"loads chat UI"| ChatUI
    ChatUI -->|"POST /auth"| Auth
    ChatUI -->|"POST /upload_resume"| Resume
    ChatUI -->|"GET /current_session"| EventInfo
    ChatUI -->|"GET /recommendations"| Recommender
    ChatUI -->|"POST /feedback"| Feedback

    Auth -->|"reads"| RegCSV
    Auth -->|"reads"| ConfUsers

    Resume -->|"store PDF"| ResumeStore
    Resume -->|"CALL Gemini NLU"| GoogleGemini

    EventInfo -->|"reads"| Agenda
    EventInfo -->|"reads"| Location

    Recommender -->|"calls utils"| Utility
    Recommender -->|"reads"| Participants
    Recommender -->|"reads"| Agenda

    Feedback -->|"writes"| ConfPart
    Feedback -->|"writes"| Participants

    Utility -->|"audio processing"| Utility
    Utility -->|"logging/config"| Utility

    GoogleGemini -->|"returns NLU & skills"| Resume
    GoogleGemini -->|"generates responses"| ChatUI

    %% Click Events
    click ChatUI "https://github.com/vishvas-dubey/ai_event_bot/blob/main/style.css"
    click Auth "https://github.com/vishvas-dubey/ai_event_bot/blob/main/registrations.csv"
    click Auth "https://github.com/vishvas-dubey/ai_event_bot/blob/main/confirmed_users.json"
    click ResumeStore "https://github.com/vishvas-dubey/ai_event_bot/tree/main/resume/"
    click Agenda "https://github.com/vishvas-dubey/ai_event_bot/blob/main/agenda.json"
    click Location "https://github.com/vishvas-dubey/ai_event_bot/blob/main/location.json"
    click Recommender "https://github.com/vishvas-dubey/ai_event_bot/blob/main/utils.py"
    click Feedback "https://github.com/vishvas-dubey/ai_event_bot/blob/main/confirmed_participants.csv"
    click Feedback "https://github.com/vishvas-dubey/ai_event_bot/blob/main/participants.json"
    click Utility "https://github.com/vishvas-dubey/ai_event_bot/blob/main/audio.py"
    click GoogleGemini "https://github.com/vishvas-dubey/ai_event_bot/blob/main/app.py"

    %% Styles
    classDef frontend fill:#D8BFD8,stroke:#000,stroke-width:1px
    classDef backend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef data fill:#90EE90,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px,stroke-dasharray: 2 2
```
