Universal Community Discussions, Smart Mentions & AI Hardware Technician Architecture
# Universal Community Discussions, Entity Threading & AI Hardware Technician Architecture
Complete system documentation covering Pixahunt's Universal Discussion Engine, Entity Polymorphic Threading, Friend-Gated Mentions, Automated Content Moderation, and AI Technician integration.
---
### 1. Architecture Overview & Canonical URLs
- **Canonical Discussion Directory:** `/discussions` and `/gadget/discussions`
- **Canonical Discussion Thread View:** `/discussions/{id}`
- **Entity Linking API:** `/discussions/entity-thread?entity_type={type}&entity_id={id}`
Every discussion thread can be embedded inside any product page, blog post, SVG page, or tool via the ` ` Blade component. This consolidates user engagement and gives immense SEO value through crawlable user-generated content.
---
### 2. Database Mapping (Zero Duplication)
- **`discussions` Table:**
- `id`: Primary ID
- `user_id`: Author
- `category_id`: Linked to `discussion_categories`
- `title`, `slug`, `content`: Markdown/Text post body
- `entity_type`, `entity_id`, `entity_name`, `entity_url`: Polymorphic target
- `views_count`, `likes_count`: Engagement analytics
- `is_pinned`: Pinned announcement flag
- `is_approved`: 1 = approved, 0 = pending moderation
- `status`: `'active'`, `'pending'`, `'spam'`, `'archived'`
- **`discussion_comments` Table:**
- `id`: Comment ID
- `post_id`: Associated discussion
- `user_id`: Comment author
- `parent_id`: Nested replies (threaded discussions)
- `content`: Comment text with `@username` mentions
- `is_approved`: Moderation approval flag
- `is_ai_reply`: True if posted by `@pixahunt_technician`
- `upvotes`, `downvotes`: Community score
---
### 3. Friend-Gated `@` Mentions & AI Summoning
- **Human User Gating:** Users can only tag `@` members who are confirmed mutual friends (`user_friends` status: `'accepted'`) or official staff. This strictly stops unsolicited spam tagging.
- **Universal AI Tagging:** Any user can tag `@pixahunt_technician` anywhere. When tagged, the AI Technician is summoned to inspect the thread and generate expert technical advice.
- **Notifications:** When mentioned, `user_notifications` creates an instant alert for the target user with a direct jump-link.
---
### 4. 24/7 Rotating Lab Personnel & Strict Hardware Scope
- **Rotating Shifts:**
1. *Morning Shift (06:00 - 14:00 BST):* Ariful Islam (Senior Hardware Specialist)
2. *Evening Shift (14:00 - 22:00 BST):* Tanveer Ahmed (PC Architect & Thermal Specialist)
3. *Night Shift (22:00 - 06:00 BST):* Fahim Chowdhury (System Optimizer & Power Engineer)
- **Identity Enforcement:** Strict human technician persona. Never reveals itself as a bot, Gemini, or language model.
- **Scope Restriction:** Strictly answers hardware, PC builds, cooling, overclocking, and tech troubleshooting. Declines non-hardware inquiries politely.
- **Cooldown Enforcement:** Continuous 60-minute chat triggers a polite 10-minute lab refreshment break.
---
### 5. Automated Moderation Pipeline
- `ContentModerationService::inspectContent` filters out gambling/betting promotions, profanities, and repeated spam floods.
- Suspect posts are placed in `status = 'pending'` for one-click admin approval or rejection at `/admin/discussions`.