ION AI Management System (Discord Bot + Dashboard)

Project Brief

Client: ION Agency (Internal Automation Project)
Timeline: March 31, 2026 β†’ April 7, 2026 (8 days active development)
Status: 🟑 In Progress β€” Backend 90% complete, Frontend in development
Budget: Internal resource allocation
Primary Developer: team-lexomee
Technical Support: team-krush91
Project Oversight: team-monte-cristos

Objective

Build an AI-powered management system to automate ION Agency’s internal operations and client relationship management. The system consists of two core components: (1) Employee Management β€” task tracking, workload monitoring, project board automation, and (2) Client Management β€” CRM automation, deal tracking, financial management. The goal is to eliminate manual administrative overhead and create a self-documenting, intelligent workspace using Discord as the interface layer.

Scope

In Scope β€” Employee Management Side

  • AI Discord bot for task tracking and workload monitoring
  • Automated project board creation and updates
  • Employee mention system for @notifications
  • Real-time progress queries (β€œWhat is [employee] working on?”)
  • Cross-channel posting capability
  • Intelligent follow-up question system
  • Date/time awareness for context
  • Concise, optimized responses (token efficiency)
  • Memory system using Supabase API

In Scope β€” Client Management Side

  • Deal tracking automation (closed deals, pending deals)
  • Client onboarding workflow
  • CRM data storage (client name, location, acquisition source, value, service, timeline)
  • Financial tracking (deal values, payment status)
  • Automated deal summary generation
  • Cross-channel announcement posting

In Scope β€” Technical Infrastructure

  • FastAPI backend
  • Discord bot integration
  • Supabase memory/database layer
  • NGINX reverse proxy
  • Cloudflare proxy for HTTPS
  • Web dashboard (HTML/CSS/JS)
  • API subdomain: api.ionagency.in

Out of Scope (Current Phase)

  • Public client-facing portal (future consideration)
  • Payment gateway integration
  • Multi-language support
  • Mobile app interface

Technical Architecture

Stack Overview

Backend:

  • FastAPI β€” Python web framework for API endpoints
  • Uvicorn β€” ASGI server
  • Discord.py β€” Discord bot library
  • Groq API β€” LLM inference (switched from Claude due to cost)
  • Supabase β€” Database + memory storage

Frontend:

  • HTML/CSS/JavaScript β€” Dashboard interface
  • Fetch API β€” Backend data retrieval

Infrastructure:

  • NGINX β€” Reverse proxy (attempted, facing configuration issues)
  • Cloudflare β€” DNS + HTTPS proxy
  • VIP2.HeavenCloud.in β€” Server hosting
  • Subdomain: api.ionagency.in

System Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Discord Server β”‚
β”‚  (ION Agency)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”‚ Bot Commands / Messages
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Discord Bot   β”‚
β”‚   (main.py)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”‚ POST /update
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  FastAPI Backendβ”‚
β”‚  (backend.py)   β”‚
β”‚  Port 2040      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β”œβ”€β”€β”€ Groq API (LLM Inference)
         β”‚
         β”œβ”€β”€β”€ Supabase (Memory/Database)
         β”‚
         └─── Dashboard (HTML) via /dashboard endpoint
                    β–²
                    β”‚ HTTPS Fetch Request
                    β”‚
              β”Œβ”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
              β”‚  Browser   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Request Flow (Current Implementation)

User (Discord) 
    β†’ Discord Bot (main.py)
        β†’ FastAPI Backend (backend.py)
            β†’ Groq API (LLM processing)
                β†’ Supabase (memory/data persistence)
                    β†’ Discord Bot (response)
                        β†’ User (Discord)

Dashboard (Browser)
    β†’ HTTPS Fetch β†’ api.ionagency.in (Cloudflare Proxy)
        β†’ vip2.heavencloud.in:2040 (HTTP)
            β†’ FastAPI /dashboard endpoint
                β†’ JSON Response

Key Technical Decisions

DecisionRationaleAlternatives ConsideredDateOwner
Groq API over ClaudeCost efficiency (Claude expensive, Groq free tier)Gemini, Claude2026-04-02Lexomee
FastAPI for backendAsync support, modern Python, API-firstDjango, Flask2026-04-02Lexomee
Supabase for memoryManaged database, easy integration, PostgreSQL backendMongoDB, Custom DB2026-04-02Lexomee
Discord as interfaceTeam already uses Discord, zero friction adoptionSlack, Custom web UI2026-04-01Monte_Cristos
Subdomain api.ionagency.inProfessional, branded API endpointDirect IP access2026-04-06Lexomee
Skip NGINX (temporarily)Configuration issues blocking progressCaddy, direct uvicorn2026-04-07Lexomee + Krush91

Development Timeline

gantt
    title ION AI Management System Development
    dateFormat YYYY-MM-DD
    section Planning
    Initial concept : 2026-03-31, 1d
    section Bot Development
    Test #1-3 (Basic functionality) : 2026-04-02, 1d
    Test #4 (Channel awareness) : 2026-04-03, 1d
    Test #5 (Cross-posting, mentions) : 2026-04-05, 1d
    Test #6 (Progress tracking) : 2026-04-05, 1d
    section Backend
    FastAPI setup : 2026-04-02, 1d
    Supabase integration : 2026-04-02, 1d
    API endpoints : 2026-04-06, 2d
    section Infrastructure
    Cloudflare proxy setup : 2026-04-06, 1d
    NGINX troubleshooting : 2026-04-07, 1d
    section Frontend
    Dashboard HTML/CSS : 2026-04-07, 1d

Bot Capabilities (Testing Evolution)

Test #3 β†’ Test #4 (April 2-3, 2026)

Flaws Identified:

  • ❌ Mentions live channel list every message
  • ❌ Cannot post text to other channels

Fixes Implemented:

  • βœ… Knows all channels passively (no system prompt hardcoding)
  • βœ… Knows current conversation context

Test #4 β†’ Test #5 (April 3-5, 2026)

Additional Issues:

  • ❌ No date/time awareness
  • ❌ Cannot @mention members
  • ❌ Excessive output tokens (verbose responses)
  • ❌ Cannot interpret β€œright now” or time-related keywords

Test #5 Final Capabilities (April 5, 2026)

Flaws Fixed:

  • βœ… Can send messages to other channels (cross-posting)
  • βœ… Understands difference between channels and project posts
  • βœ… Knows date/time of messages
  • βœ… Interprets temporal keywords (β€œright now”, β€œjust now”, etc.)
  • βœ… Can @mention employees
  • βœ… Tracks employee activity and prompts for documentation
  • βœ… Creates project board posts automatically
  • βœ… Can query other employees and summarize responses
  • βœ… Concise, optimized responses (token efficiency)

Test #6 Goals (April 5, 2026)

Targeted Improvements:

  • Accurate work progress reporting for any team member
  • Enhanced cross-employee communication

Deal Tracking System

Deal Intake Flow (Implemented)

The bot conducts a structured interview when a deal is announced:

User: β€œwe secured a deal lets fucking goooo”

Bot Sequence:

  1. β€œWhat is the client’s name?”
  2. β€œWhere is [client] from, or how did they find us?”
  3. β€œHow did we acquire this client?”
  4. β€œHow much is [client] going to pay us?”
  5. β€œWhat service is [client] looking to hire us for?”
  6. β€œWhen did [client] first contact us?”
  7. β€œWhat’s the expected due date?”
  8. β€œWho is going to handle the work?”
  9. β€œIs this a one-time deal or monthly retainer?”

Deal Summary Template

───────────────────────────────
βœ… CLOSED DEAL SUMMARY
───────────────────────────────
Client: [Name]
Location: [City/Country]
Acquired via: [Method]
Brought in by: [Team Member]
Deal value: [Amount]
Service: [Service Type]
First contact: [Date]
Due date: [Timeline]
Handled by: [Assignee]
Deal type: [One-time/Retainer]
───────────────────────────────

Example Deal (Test Case)

Client: Daniyal
Location: India
Acquired via: Cold call through website
Brought in by: Lexomee
Deal value: 45-50k INR (potentially up to 1 lakh)
Service: Music video production
First contact: April 2, 2026
Due date: Next month (May 2026)
Handled by: TBD (Lexomee or Sidey β€” both do VFX)
Deal type: One-time

Technical Implementation Details

API Keys & Credentials (REDACTED IN PRODUCTION)

APIs Used:

  • Discord Bot Token: [REDACTED]
  • Gemini API (tested, rejected): [REDACTED]
  • Claude API (tested, too expensive): [REDACTED]
  • Groq API (production): [REDACTED]

Rationale for Groq:

β€œclaude goated but im gareeb” β€” Lexomee (budget constraints favored Groq’s free tier)

FastAPI Backend Structure

File: backend.py

Endpoints:

POST /update          # Discord bot message handling
GET  /dashboard       # Dashboard data retrieval
GET  /health          # Server health check

Port: 2040 (non-standard, requires NGINX/proxy for HTTPS)

Deployment Command:

uvicorn backend:app --host 0.0.0.0 --port 2040

Discord Bot Structure

File: main.py

Core Functions:

  • Message listener (on_message event)
  • Channel detection
  • Member mention system
  • Cross-channel posting
  • Project board thread creation
  • API communication (POST to backend)

Supabase Integration

Purpose: Persistent memory storage for bot context

Implementation:

  • Stores conversation history
  • Maintains employee activity logs
  • Tracks deal data
  • Enables context-aware responses

Example Query:

-- Store employee activity
INSERT INTO employee_activity (name, project, timestamp, notes)
VALUES ('Lexomee', 'AI Management System', NOW(), 'Backend 90% complete');

Infrastructure Challenges & Solutions

Challenge 1: HTTPS to HTTP Communication

Problem:

  • Dashboard (HTTPS) cannot fetch from backend (HTTP) due to mixed content blocking
  • Browsers block HTTP requests from HTTPS pages for security

Attempted Solution:

Browser (HTTPS)
    β†’ api.ionagency.in (Cloudflare HTTPS Proxy)
        β†’ vip2.heavencloud.in:2040 (HTTP Backend)

Blocker:

  • NGINX not configured on server
  • Cannot listen on port 443 (HTTPS default)
  • Forced to use port 2040 with HTTP

Workaround:

  • Temporarily allow mixed content in browser settings
  • Direct HTTP requests (bypasses NGINX/Cloudflare chain)
  • Plan to migrate to proper server with NGINX support

Challenge 2: Cloudflare CNAME Limitations

Problem:

Cloudflare CNAME records cannot specify ports
Example: api.ionagency.in β†’ vip2.heavencloud.in:2040 (INVALID)

Solution Required:

  • NGINX must listen on default HTTPS port 443
  • Reverse proxy to backend on port 2040
  • Cloudflare proxies api.ionagency.in β†’ vip2.heavencloud.in:443

Current Status: Bypassing NGINX entirely for testing

Challenge 3: Server Architecture Limitations

Ideal Flow:

Website (HTTPS)
    β†’ Fetch data from api.ionagency.in (HTTPS)
        β†’ Cloudflare proxies to vip2.heavencloud.in (HTTPS)
            β†’ NGINX listens on port 443
                β†’ Forwards to backend (uvicorn) on port 2040
                    β†’ Backend processes request
                        ← Response flows backward

Current Reality:

  • NGINX unavailable on current server
  • Cannot configure SSL/TLS termination
  • Forced to use HTTP on non-standard port

Future Solution (Per Team Discussion):

β€œbad me fir poora backend + discord bot ek acche server me host krenge” β€” Lexomee
Translation: β€œLater we’ll host the entire backend + Discord bot on a proper server”

Dashboard Development

Dashboard Requirements (April 7, 2026)

Lexomee’s Specifications:

  • Incorporate all features from demo.html
  • Better UI design (premium aesthetic)
  • Comprehensive management system panels:
    • Employee workload overview
    • Active project status
    • Client deal pipeline
    • Financial metrics
    • Task distribution charts

Current Status:

  • Dashboard HTML file created
  • Backend integration pending
  • Fetch API implementation in progress

Frontend Architecture

File: dashboard.html

Fetch Logic:

// On page load, fetch data from backend
fetch('http://vip2.heavencloud.in:2040/dashboard')
  .then(response => response.json())
  .then(data => {
    // Populate dashboard with employee data, deals, tasks
    renderEmployeePanel(data.employees);
    renderDealPipeline(data.deals);
    renderTaskMetrics(data.tasks);
  })
  .catch(error => console.error('Backend fetch failed:', error));

Security Note (Per Krush91’s Feedback):

β€œsecure it with login etc"
"also inspect se bypass na ho aisa banana”
Translation: Add authentication layer + prevent inspect element bypass

Team Collaboration & Dynamics

Developer Velocity

Lexomee’s Work Ethic:

  • Multiple all-night development sessions (5:00 AM - 7:00 AM active coding)
  • Rapid iteration (Test #3 β†’ Test #5 in 3 days)
  • Backend 90% completion in 6 days
  • Self-directed problem-solving (infrastructure debugging at 5 AM)

Team Recognition:

β€œNvm I take it back your boss is strong fuck it we doing it” β€” Monte_Cristos (April 7, 5:10 AM)

Cross-Team Support

Krush91’s Contributions:

  • Infrastructure consultation (NGINX, Caddy suggestions)
  • Security recommendations (authentication, inspect blocking)
  • CSS/frontend guidance
  • Late-night problem-solving support (5:00 AM responses)

Wana_be_sidey’s Role:

  • QA testing observations
  • VFX work assignment (potential handler for Daniyal music video)
  • Team morale (concerned about all-night work sessions)

Communication Patterns

Hindi-English Code-Switching:

  • Technical discussions in English
  • Troubleshooting in Hindi
  • Casual banter mixed throughout
  • Example: β€œnga abhi backend 90% done h” (Translation: β€œYeah, backend is 90% done now”)

Problem-Solving Style:

  • Live debugging in Discord
  • Stream-of-consciousness technical explanations
  • Visual architecture diagrams shared mid-conversation
  • Immediate peer review and feedback loops

Known Issues & Bugs

Active Bugs (April 7, 2026)

  1. Bug: Screenshot showing error condition (details not transcribed)
    • Status: Under investigation
    • Priority: Unknown (visual evidence only)

Resolved Issues

  1. Channel List Spam (Test #4)

    • Issue: Bot mentioned live channel list in every message
    • Fix: Passive channel awareness without explicit listing
  2. No Cross-Channel Posting (Test #4)

    • Issue: Bot confined to single channel
    • Fix: Multi-channel posting capability implemented
  3. Temporal Awareness (Test #5)

    • Issue: No understanding of β€œright now”, β€œjust now”, dates, times
    • Fix: Date/time context injection + temporal keyword parsing
  4. Token Inefficiency (Test #5)

    • Issue: Verbose, generic AI responses wasting tokens
    • Fix: Concise, context-aware prompting + output optimization
  5. Member Mentions (Test #5)

    • Issue: Could not @mention team members
    • Fix: Discord mention syntax integration

Deliverables

Completed

  • Discord bot basic functionality (Test 1-3)
  • Channel awareness system (Test #4)
  • Cross-channel posting (Test #5)
  • Date/time awareness (Test #5)
  • Member mention system (Test #5)
  • Deal tracking workflow (Test case: Daniyal)
  • FastAPI backend structure
  • Supabase memory integration
  • Groq API integration
  • Backend 90% complete
  • Cloudflare subdomain setup (api.ionagency.in)

In Progress

  • NGINX reverse proxy configuration
  • HTTPS/HTTP communication fix
  • Dashboard UI implementation
  • Frontend-backend data integration
  • Authentication system

Pending

  • Dashboard authentication (login system)
  • Inspect element bypass protection
  • Production server migration
  • Client-side management portal (visual + trustworthy design)
  • Testing channel for bot development (per Monte_Cristos request)
  • Code/prompt documentation for team collaboration

Dependencies

Blockers

  1. NGINX Configuration: Cannot listen on port 443 (HTTPS), blocking Cloudflare CNAME integration
  2. Server Limitations: Current VPS lacks SSL/TLS termination capability
  3. Mixed Content Blocking: Browser security prevents HTTPS β†’ HTTP requests
  4. Authentication Not Implemented: Dashboard currently unprotected

Next Actions

Immediate (< 48 hours)

  • Resolve NGINX configuration (try Caddy as alternative)
  • Complete dashboard UI design
  • Implement authentication layer
  • Add inspect element bypass protection

Short-term (1 week)

  • Migrate to production server with proper NGINX support
  • Deploy HTTPS-enabled backend
  • Create dedicated testing channel for bot development
  • Document prompts and code for team collaboration
  • Build client-facing management portal

Medium-term (2-4 weeks)

  • Implement financial tracking dashboard
  • Add automated reporting (weekly summaries)
  • Expand bot capabilities (Test #6 improvements)
  • Integrate payment tracking
  • Create employee performance analytics

Technical Debt

  1. Security: No authentication on dashboard endpoints
  2. Infrastructure: Temporary workaround for HTTPS/HTTP (browser settings hack)
  3. Error Handling: Limited error recovery in bot
  4. Documentation: Code/prompts not yet documented for team
  5. Testing: No dedicated testing channel (development in production)

Lessons Learned

What Worked

  1. Groq API Selection: Cost-effective alternative to Claude without sacrificing quality
  2. Discord Interface: Zero friction adoption β€” team already uses platform daily
  3. Iterative Testing: Test #3 β†’ #5 rapid iteration identified and fixed core issues quickly
  4. Structured Deal Intake: Bot-driven interview ensures consistent CRM data
  5. FastAPI Choice: Async support critical for Discord bot + web dashboard hybrid

What Didn’t Work

  1. NGINX Setup: Infrastructure complexity underestimated, blocked progress
  2. Initial API Choice: Gemini tested and rejected, Claude too expensive
  3. Server Selection: Current VPS lacks NGINX/SSL support, forcing migration plan

Future Improvements

  1. Infrastructure-First Planning: Validate server capabilities before development
  2. Authentication from Day 1: Security should be integrated, not added later
  3. Testing Environment: Dedicated channel for bot development (reduce production noise)
  4. Documentation Culture: Document prompts/code in parallel with development

Notes

Development Hours: Extensive all-night sessions (evidence: 5:00 AM - 7:00 AM active development)

Team Culture: High-velocity execution, immediate problem-solving, peer support despite unconventional hours

Budget Constraints: API selection driven by cost (β€œim gareeb” β€” chose Groq over Claude)

Technical Ambition: Building production-grade AI automation system with 8 days of development time

Monte_Cristos’ Initial Skepticism Reversed:

  • Initial directive: β€œmake another channel for testing”
  • Later: β€œNvm I take it back your boss is strong fuck it we doing it” (recognition of execution quality)

Infrastructure Philosophy: β€œBackend first, frontend later” β€” prioritize core functionality over UI polish

Future Vision: Dual system (employee management + client management) with visual, trustworthy client-facing portal


Status Summary: Project is in active development with backend 90% complete. Core bot functionality operational (cross-posting, mentions, deal tracking, memory). Infrastructure challenges (NGINX, HTTPS) require server migration. Frontend dashboard in progress. Team velocity high, execution quality recognized. Expected completion: 1-2 weeks pending infrastructure resolution.

This project represents ION’s first major internal automation effort β€” if successful, establishes template for AI-driven workflow optimization across all agency operations.