Skip to content

feat: add FAQ Embed Widget feature - #230

Open
saniyakousar12 wants to merge 2 commits into
vicharanashala:mainfrom
saniyakousar12:main
Open

feat: add FAQ Embed Widget feature#230
saniyakousar12 wants to merge 2 commits into
vicharanashala:mainfrom
saniyakousar12:main

Conversation

@saniyakousar12

Copy link
Copy Markdown

🧩 FAQ Embed Widget

Overview

This PR adds a new FAQ Embed Widget that allows external websites to display FAQs from the Yaksha FAQ Portal by simply copying and pasting a script tag.

Features

  • ✅ Public embed API endpoint (/csfaq/api/embed/faqs)
  • ✅ Lightweight JavaScript widget (/csfaq/widget.js)
  • ✅ Interactive accordion-style FAQ display
  • ✅ Customization via data attributes:
    • data-limit - Number of FAQs to show
    • data-title - Custom widget title
    • data-theme - Light/dark mode
    • data-batch-id - Filter by batch
    • data-show-tags - Show/hide tags
    • data-show-date - Show/hide dates
  • ✅ Embed page (/csfaq/embed) with code generator
  • ✅ Rate-limited public API

Files Added

  • apps/backend/src/modules/embed/ - Embed module
  • apps/frontend/public/widget.js - Widget JavaScript
  • apps/frontend/src/pages/EmbedPage.tsx - Embed page UI
  • PRODUCT.md - Product documentation

Files Modified

  • apps/backend/src/bootstrap/routes.ts - Added embed routes
  • apps/frontend/src/routes/AppRoutes.tsx - Added /embed route

Testing

  • ✅ API returns FAQs in JSON format
  • ✅ Widget renders FAQs correctly
  • ✅ Toggle functionality works
  • ✅ Theme options work (light/dark)
  • ✅ Tags displayed (if enabled)

Submission Details

This PR is for the CSFAQ Project Submission phase.

Added Embed module for FAQ integration and updated routes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant