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
| Decision | Rationale | Alternatives Considered | Date | Owner |
|---|---|---|---|---|
| Groq API over Claude | Cost efficiency (Claude expensive, Groq free tier) | Gemini, Claude | 2026-04-02 | Lexomee |
| FastAPI for backend | Async support, modern Python, API-first | Django, Flask | 2026-04-02 | Lexomee |
| Supabase for memory | Managed database, easy integration, PostgreSQL backend | MongoDB, Custom DB | 2026-04-02 | Lexomee |
| Discord as interface | Team already uses Discord, zero friction adoption | Slack, Custom web UI | 2026-04-01 | Monte_Cristos |
Subdomain api.ionagency.in | Professional, branded API endpoint | Direct IP access | 2026-04-06 | Lexomee |
| Skip NGINX (temporarily) | Configuration issues blocking progress | Caddy, direct uvicorn | 2026-04-07 | Lexomee + 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:
- βWhat is the clientβs name?β
- βWhere is [client] from, or how did they find us?β
- βHow did we acquire this client?β
- βHow much is [client] going to pay us?β
- βWhat service is [client] looking to hire us for?β
- βWhen did [client] first contact us?β
- βWhatβs the expected due date?β
- βWho is going to handle the work?β
- β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 checkPort: 2040 (non-standard, requires NGINX/proxy for HTTPS)
Deployment Command:
uvicorn backend:app --host 0.0.0.0 --port 2040Discord 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)
- Bug: Screenshot showing error condition (details not transcribed)
- Status: Under investigation
- Priority: Unknown (visual evidence only)
Resolved Issues
-
Channel List Spam (Test #4)
- Issue: Bot mentioned live channel list in every message
- Fix: Passive channel awareness without explicit listing
-
No Cross-Channel Posting (Test #4)
- Issue: Bot confined to single channel
- Fix: Multi-channel posting capability implemented
-
Temporal Awareness (Test #5)
- Issue: No understanding of βright nowβ, βjust nowβ, dates, times
- Fix: Date/time context injection + temporal keyword parsing
-
Token Inefficiency (Test #5)
- Issue: Verbose, generic AI responses wasting tokens
- Fix: Concise, context-aware prompting + output optimization
-
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
- tech-discord β Bot platform
- tech-fastapi β Backend framework
- tech-groq β LLM inference API
- tech-supabase β Database + memory
- tech-nginx β Reverse proxy (pending configuration)
- tech-cloudflare β DNS + HTTPS proxy
- tech-uvicorn β ASGI server
- process-client-onboarding β CRM workflow automation
Blockers
- NGINX Configuration: Cannot listen on port 443 (HTTPS), blocking Cloudflare CNAME integration
- Server Limitations: Current VPS lacks SSL/TLS termination capability
- Mixed Content Blocking: Browser security prevents HTTPS β HTTP requests
- 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
- Security: No authentication on dashboard endpoints
- Infrastructure: Temporary workaround for HTTPS/HTTP (browser settings hack)
- Error Handling: Limited error recovery in bot
- Documentation: Code/prompts not yet documented for team
- Testing: No dedicated testing channel (development in production)
Lessons Learned
What Worked
- Groq API Selection: Cost-effective alternative to Claude without sacrificing quality
- Discord Interface: Zero friction adoption β team already uses platform daily
- Iterative Testing: Test #3 β #5 rapid iteration identified and fixed core issues quickly
- Structured Deal Intake: Bot-driven interview ensures consistent CRM data
- FastAPI Choice: Async support critical for Discord bot + web dashboard hybrid
What Didnβt Work
- NGINX Setup: Infrastructure complexity underestimated, blocked progress
- Initial API Choice: Gemini tested and rejected, Claude too expensive
- Server Selection: Current VPS lacks NGINX/SSL support, forcing migration plan
Future Improvements
- Infrastructure-First Planning: Validate server capabilities before development
- Authentication from Day 1: Security should be integrated, not added later
- Testing Environment: Dedicated channel for bot development (reduce production noise)
- Documentation Culture: Document prompts/code in parallel with development
Related Entities
- team-lexomee β Primary developer
- team-krush91 β Infrastructure consultant
- team-monte-cristos β Project oversight
- team-wana-be-sidey β QA testing, VFX assignee
- tech-discord β Bot platform
- tech-fastapi β Backend framework
- tech-groq β LLM API
- tech-supabase β Database
- tech-nginx β Reverse proxy
- tech-cloudflare β DNS + HTTPS
- process-client-onboarding β CRM automation
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.