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