Dynamic FAQ Builder
- TYPE
- Full-stack search platform
- STACK
- 12 COMPONENTS
- STATUS
- SOURCE AVAILABLE
- FEATURED
- —
- LINKS
- SOURCE ↗
01 / OVERVIEW
An admin-managed FAQ system where a custom TF-IDF relevance engine and Gemini AI work together to find and generate the best answer to any question.
Built as a team project (Team Tesseract) for PES University's Software Engineering course, Dynamic FAQ Builder is a full-stack platform that lets admins manage question-answer pairs while users search them through a custom-built relevance engine rather than simple keyword matching. I worked across the stack: a React + MUI frontend, an Express/Node REST API, Firebase Firestore for persistence, and a hand-written TF-IDF-style search service that weights matches by field (keywords 5x, question 3x, answer/tags 1x) and blends in a popularity signal from views and helpful votes. On top of that sits a Gemini-powered layer that can answer questions with no matching FAQ, generate answer drafts and tags for admins, and suggest related questions — with the API layer hardened with JWT auth, brute-force lockouts, rate limiting, Helmet CSP, and input sanitization against XSS.
02/ STACK & ARCHITECTURE
FRONTEND
- React
- React Router
- Material UI
- Vite
- Tailwind CSS
BACKEND
- Node.js
- Express
- Firebase Firestore
- Firebase Auth
- Google Gemini API
- JWT
- bcryptjs
03 / WHAT WAS ACTUALLY HARD
- 01
Custom weighted relevance search engine
Built a TF-IDF-based ranking service from scratch (no external search library) that tokenizes and scores FAQs per field — a 5x boost for keyword matches, 3x for question matches, 1x baseline for answer and tag matches — then blends in a popularity boost from view counts and helpful/not-helpful votes. Also supports fuzzy matching via Levenshtein distance and live search-as-you-type suggestions.
- 02
Gemini AI answer generation and fallback
When a user's question doesn't closely match an existing FAQ, the AI search endpoint hands the top-ranked candidates to Gemini, which synthesizes a direct answer from that context or, if nothing relevant exists, generates a general response. Responses are cached in memory to cut redundant API calls.
- 03
Admin authoring tools powered by AI
The admin dashboard lets staff create, edit, and delete FAQs, with Gemini assisting by drafting answer suggestions, improving existing answers, auto-generating tags, and categorizing questions — plus a dashboard view of total FAQs, category distribution, and top-viewed entries.
- 04
Hardened Express API
JWT-based admin auth with brute-force lockout after repeated failed logins, per-route rate limiting (tighter on search, looser on admin CRUD), Helmet CSP headers, express-validator field rules, and a custom sanitizer that strips script/iframe/img tags and inline event handlers from submitted content.
- 05
Real-time Firestore sync and role-based access
FAQs and AI Q&A history are stored in Firestore with live onSnapshot subscriptions so admin and user views stay in sync without polling. Firebase Auth handles user signup/login, with a role field on each user document gating access to the admin dashboard.