Skip to content

Feature Request Submission System

Welcome to the feature request submission system documentation!

📚 Documentation Overview

DocumentDescriptionAudience
QUICK_START.mdQuick setup guide and usage instructionsDevelopers & Users
FEATURE_REQUEST_SYSTEM.mdComplete technical specificationDevelopers
DISCORD_BOT_SETUP.mdDiscord bot implementation guideDevelopers

🚀 For Users

Submitting a Request

  1. Discord (Recommended): Use /feature or /bug slash commands in Discord
  2. In-App: Navigate to #/feedback or click "Submit Feedback" in Settings
  3. GitHub: Directly create an issue (advanced users)

Discord Commands

  • /feature - Submit a feature request
  • /bug - Report a bug
  • /mystatus - Check status of your submissions

Submissions appear in:

  • #features - Public feature request channel
  • #bugs - Public bug report channel

How to use: Simply type / in Discord and available commands will appear in autocomplete. Commands work in any channel.

Smart Prompts: If you post a regular message in #features or #bugs, the bot will automatically suggest using the appropriate slash command with a helpful guide that auto-deletes after 30 seconds.

What to Include

  • Title: Brief, specific summary (max 100 characters)
  • Description: Detailed explanation of what you want and why
  • Use Case: Real-world example of how you'd use it
  • Priority: How urgent is this?
  • Impact: Who would benefit from this?

🛠 For Developers

Quick Setup

bash
# 1. Install dependencies
cd functions
npm install

# 2. Configure Firebase
firebase use lantern-app-dev
firebase functions:config:set \
  github.token="ghp_YOUR_TOKEN" \
  github.repo="cattreedev/lantern_app" \
  discord.webhook_url="YOUR_WEBHOOK_URL"

# 3. Deploy
firebase deploy --only functions

# 4. Test
# Visit http://localhost:5173/#/feedback

See Discord Bot Setup for Discord bot installation.

Architecture

Discord Bot (Primary Method)

Discord User → /feature or /bug command → Discord Modal Form

    Bot validates & creates GitHub issue

    ┌────┴────┬────────────┐
    ↓         ↓            ↓
GitHub    Public       Admin
Issue     Channel      Monitor

Web Form (Alternative Method)

User → FeatureRequestForm (React) → Firebase Function

    GitHub Issue + Firestore Storage

    Admin Monitor (optional webhook)

Key Features

Automatic GitHub Issue Creation

  • Standardized formatting
  • Auto-labeling (type, priority, environment)
  • Direct links for tracking

Duplicate Detection

  • Real-time similarity checking
  • Prevents duplicate submissions
  • Shows related existing requests

Discord Integration

  • Webhook notifications
  • Separate dev/prod channels
  • Rich embeds with metadata

Environment Awareness

  • Automatic dev vs prod detection
  • Separate Discord channels
  • Environment-specific labels

Rate Limiting

  • 5 submissions per user per 24 hours
  • Per environment (dev and prod independent)
  • Prevents spam

Security

  • Input validation and sanitization
  • Firebase Auth required
  • Anonymous submission option
  • Secrets managed via Firebase config

📊 System Components

Frontend

  • Component: src/screens/feedback/FeatureRequestForm.jsx
  • Route: #/feedback
  • Features: Validation, character limits, duplicate warnings

Backend

  • Functions: functions/index.js
    • createFeatureRequest - Main submission handler
    • checkDuplicates - Similarity detection
  • Firestore: featureRequests collection
  • GitHub API: Issue creation via Octokit
  • Discord: Webhook notifications

Documentation

🔄 Workflow

User Submission

  1. User fills out form in app
  2. Client validates input
  3. Client checks for duplicates
  4. User submits request
  5. Firebase Function processes:
    • Creates GitHub issue
    • Stores in Firestore
    • Sends Discord notification
  6. User receives GitHub issue link

Team Triage

  1. Discord notification appears in channel
  2. Team reviews GitHub issue
  3. Issue labeled: needs-triage
  4. Team adds to project board
  5. Status updates tracked in Firestore

🚦 Roadmap

✅ Phase 1: Core System (COMPLETE)

  • [x] React form component
  • [x] Firebase Cloud Functions
  • [x] GitHub issue creation
  • [x] Discord notifications
  • [x] Duplicate detection
  • [x] Environment awareness

📝 Phase 2: Discord Bot (DOCUMENTED)

  • [ ] Discord slash command
  • [ ] Modal form integration
  • [ ] Direct submission from Discord

📝 Phase 3: AI Refinement (DOCUMENTED)

  • [ ] Copilot integration
  • [ ] Request improvement suggestions
  • [ ] Auto-classification

📝 Phase 4: Enhancements (FUTURE)

  • [ ] Voting system
  • [ ] Comments/discussion
  • [ ] Status notifications
  • [ ] Admin dashboard

🔒 Security

  • ✅ Input validation and sanitization
  • ✅ Rate limiting (5 per 24 hours)
  • ✅ Authentication required
  • ✅ Secrets in Firebase config (never committed)
  • ✅ GitHub token with minimal scope (repo only)
  • ✅ Discord webhook URLs kept secret

GitHub Repository Access

Current Setup: Private Repository

The repository is private to protect the codebase. For internal team members:

  1. Add to GitHub Organization

    • Grant "Read" access to all employees
    • Users can view issues and code but cannot modify
    • Safe for non-technical staff - GitHub prevents editing
  2. What Users Can Do

    • ✅ View all GitHub issues
    • ✅ Browse codebase (read-only)
    • ✅ Comment on issues
    • ✅ Track their submissions
    • ❌ Cannot push code (requires Write permission)
    • ❌ Cannot merge PRs or change settings
  3. Future: Public Submissions

    • Planned enhancement to support public community feedback
    • Separate public issues repository
    • See Discord Bot README for details
    • Will maintain codebase security while enabling community engagement

📈 Monitoring

Metrics to Track

  • Submissions per day/week
  • Request type distribution
  • Priority breakdown
  • Duplicate detection rate
  • Time to triage
  • Status progression

Firestore Queries

javascript
// Submissions in last 7 days
const recent = await db.collection('featureRequests')
  .where('submittedAt', '>', sevenDaysAgo)
  .get()

// By type
const bugs = await db.collection('featureRequests')
  .where('type', '==', 'bug')
  .where('status', '==', 'submitted')
  .get()

// High priority
const urgent = await db.collection('featureRequests')
  .where('priority', '==', 'critical')
  .where('status', '!=', 'completed')
  .get()

🐛 Troubleshooting

Common Issues

"GitHub token not configured" → Run: firebase functions:config:set github.token="ghp_xxx"

"Function not found" → Deploy: firebase deploy --only functions

Discord notifications not appearing → Check webhook URL is set and valid

Duplicate detection not working → Verify checkDuplicates function is deployed

See QUICK_START.md for more help.

🤝 Contributing

When adding features to this system:

  1. Update relevant documentation
  2. Test in dev environment first
  3. Deploy to both dev and prod
  4. Update CHANGELOG.md
  5. Document any new config requirements

📞 Support

Built with VitePress