Skip to content

Feature Request System - Quick Start Guide

Last Updated: 2026-01-12

This guide will help you set up and use the Feature Request submission system.

For Users (In-App Submission)

Accessing the Form

  1. From Dashboard: Navigate to Settings → "Submit Feedback"
  2. Direct Link: #/feedback route in the app

Submitting a Request

  1. Choose Request Type

    • ✨ Feature Request: New capability
    • 🐛 Bug Report: Something broken
    • ⚡ Improvement: Enhancement to existing feature
    • ❓ Question: How does something work?
  2. Fill Out the Form

    • Title: Brief summary (max 100 chars)
    • Description: Detailed explanation (max 1000 chars)
    • Use Case (optional): Real-world example (max 500 chars)
    • Priority: How urgent is this?
    • Impact: Who does this affect?
  3. Review Similar Requests

    • The system automatically checks for duplicates
    • If similar requests exist, you'll see them
    • You can still submit if yours is different
  4. Submit

    • Click "Submit Request"
    • You'll receive a GitHub issue link to track progress

For Developers (Setup)

1. Firebase Functions Setup

Install Dependencies

bash
cd functions
npm install

Configure GitHub Token

You need a GitHub Personal Access Token with repo scope:

  1. Go to GitHub Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
  2. Click "Generate new token (classic)"
  3. Give it a name: "Lantern Feature Request Bot"
  4. Select scope: repo (full control of private repositories)
  5. Click "Generate token"
  6. Copy the token (starts with ghp_)

Set the token in Firebase:

bash
# For production
firebase functions:config:set github.token="ghp_YOUR_TOKEN_HERE"
firebase functions:config:set github.repo="cattreedev/lantern_app"

# For development (local testing)
# Create .runtimeconfig.json in functions/ directory
cat > functions/.runtimeconfig.json << EOF
{
  "github": {
    "token": "ghp_YOUR_TOKEN_HERE",
    "repo": "cattreedev/lantern_app"
  }
}
EOF

⚠️ IMPORTANT: Add .runtimeconfig.json to .gitignore - never commit tokens!

Configure Discord Webhook (Optional)

  1. Create a Discord webhook (see Discord Webhooks Guide)
  2. Set the webhook URL:
bash
# For production
firebase functions:config:set discord.webhook_url="https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"

# For development (add to .runtimeconfig.json)
{
  "github": {
    "token": "ghp_YOUR_TOKEN_HERE",
    "repo": "cattreedev/lantern_app"
  },
  "discord": {
    "webhook_url": "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"
  }
}

2. Deploy Functions

Deploy to Firebase

bash
# Deploy all functions
firebase deploy --only functions

# Deploy specific function
firebase deploy --only functions:createFeatureRequest
firebase deploy --only functions:checkDuplicates

Test Locally with Emulator

bash
# Start functions emulator
cd functions
npm run serve

# In another terminal, run the app
cd ..
npm run dev

The functions will be available at http://localhost:5001/YOUR_PROJECT_ID/us-central1/createFeatureRequest

3. Firestore Security Rules

Add rules for the featureRequests collection:

javascript
// In firestore.rules
match /featureRequests/{requestId} {
  // Anyone authenticated can read their own requests
  allow read: if request.auth != null && 
              (resource.data.submittedBy == request.auth.uid || 
               resource.data.submittedBy == 'anonymous');
  
  // Only Cloud Functions can write
  allow create, update: if false;
  
  // Only admins can delete
  allow delete: if request.auth.token.admin == true;
}

Deploy rules:

bash
firebase deploy --only firestore:rules

4. Testing

Manual Testing

  1. Start the app: npm run dev
  2. Navigate to feedback form: http://localhost:5173/#/feedback
  3. Fill out and submit
  4. Check:
    • ✅ GitHub issue created
    • ✅ Discord notification sent (if configured)
    • ✅ Firestore document created
    • ✅ Success message with issue link

Test Duplicate Detection

  1. Submit a request with title "Test Feature"
  2. Start another request with similar title
  3. You should see a warning about similar requests

For Discord Integration

Setting Up Discord Bot

Instead of the web form, you can also allow submissions from Discord using a bot.

Create a Discord bot with slash command /feature-request:

javascript
// Discord bot code (separate project)
client.on('interactionCreate', async interaction => {
  if (!interaction.isCommand()) return
  
  if (interaction.commandName === 'feature-request') {
    // Show modal with form fields
    await interaction.showModal({
      title: 'Submit Feature Request',
      customId: 'featureRequestModal',
      components: [
        {
          type: 1,
          components: [{
            type: 4,
            customId: 'title',
            label: 'Title',
            style: 1,
            maxLength: 100,
            required: true
          }]
        },
        // ... more fields
      ]
    })
  }
})

Option 2: Webhook Submission

Users can post requests to a specific Discord channel, and a bot parses them and calls the Firebase function.

AI Refinement with GitHub Copilot

How It Works

Users can ask GitHub Copilot to help refine their request before submission.

Using Copilot for Refinement

  1. In the form: User clicks "Refine with AI" button
  2. Copilot analyzes:
    • Title clarity
    • Description completeness
    • Use case specificity
    • Priority/impact appropriateness
  3. User reviews suggestions and can accept/reject

Implementation (Future)

This requires:

  • GitHub Copilot API access
  • Additional Cloud Function for refinement
  • UI updates to show suggestions

Currently documented but not implemented - marked as Phase 5 in roadmap.

Troubleshooting

"GitHub token not configured" Error

Solution: Set the GitHub token in Firebase Functions config:

bash
firebase functions:config:set github.token="ghp_YOUR_TOKEN"

"Rate limit exceeded" Error

Cause: User has submitted 5+ requests in 24 hours
Solution: Wait 24 hours or contact admin to reset

Duplicate Check Not Working

Check:

  1. checkDuplicates function is deployed
  2. Firestore has existing requests to check against
  3. Browser console for errors

Discord Notification Not Sending

Check:

  1. Discord webhook URL is configured
  2. Webhook is still active in Discord
  3. Function logs for errors: firebase functions:log

Function Deployment Fails

Common issues:

  • Node version mismatch (requires Node 20)
  • Missing dependencies: cd functions && npm install
  • Invalid config: firebase functions:config:get

Security Notes

⚠️ Never commit:

  • GitHub tokens
  • Discord webhook URLs
  • .runtimeconfig.json
  • Any API keys

Always:

  • Use Firebase Functions config for secrets
  • Add sensitive files to .gitignore
  • Rotate tokens if compromised
  • Use least-privilege tokens (only repo scope needed)

Monitoring

View Submissions

Firestore Console:

  1. Go to Firebase Console → Firestore Database
  2. Navigate to featureRequests collection
  3. View all submissions with metadata

GitHub Issues:

  • Filter by label: user-submitted
  • Sort by creation date
  • Check needs-triage label for new requests

Discord Channel:

  • All submissions appear in configured channel
  • Includes direct link to GitHub issue

Analytics

Track metrics:

  • Submissions per day
  • Request types distribution
  • Priority breakdown
  • Duplicate detection rate

Query Firestore for analytics:

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

Next Steps

  1. ✅ Set up GitHub token and Discord webhook
  2. ✅ Deploy functions to Firebase
  3. ✅ Test submission flow end-to-end
  4. ✅ Add navigation item in app
  5. ⏳ Implement AI refinement (Phase 5)
  6. ⏳ Add voting system (Future)
  7. ⏳ Create admin dashboard (Future)

Support

Issues? Open a GitHub issue with label feature-request-system

Questions? Ask in Discord #dev-questions channel

Built with VitePress