A full-stack FAQ management system with AI-powered semantic matching, built with React, Node.js, and MongoDB.
- Features
- Tech Stack
- Project Structure
- Live Demo
- Quick Start
- Screenshots
- API Endpoints
- Database Schema
- Deployment
- Contributing
- License
- Authors
- Semantic Similarity: Uses embeddings to understand user intent
- Smart Matching: Finds relevant FAQs even with different wording
- Configurable Threshold: Adjustable similarity matching (0.1-1.0)
- Real-time Statistics: Total FAQs, unanswered questions, accuracy rates
- Activity Tracking: Monitor bot performance and user interactions
- Visual Charts: Beautiful graphs showing usage patterns
- FAQ Management: Add, edit, delete FAQs with rich text editor
- Settings Configuration: Customize bot behavior and appearance
- User Management: Team collaboration with role-based access
- Unknown Question Tracking: Automatically saves questions that don't match
- AI Suggestions: Generates suggested answers for frequent questions
- Admin Training: Notifies admins when questions are asked 3+ times
- JWT Authentication: Secure login system
- Role-based Access: Admin and member permissions
- Team Invitations: Secure team member onboarding
- React 19 — Modern UI framework
- Tailwind CSS — Utility-first styling
- Vite — Fast build tool
- React Router — Client-side routing
- React Hot Toast — Beautiful notifications
- Node.js — JavaScript runtime
- Express.js — Web framework
- JWT — Authentication
- Nodemailer — Email notifications
- OpenAI/Gemini — AI embeddings
- MongoDB Atlas — Cloud database
- Mongoose — ODM for MongoDB
- MongoDB Driver — Database connectivity
- Vercel — Frontend hosting
- Render — Backend hosting
- MongoDB Atlas — Database hosting
Agent-FAQ/
├── 📁 frontend/ # React frontend application
│ ├── 📁 components/ # Reusable UI components
│ ├── 📁 pages/ # Page components
│ ├── 📁 src/ # Source files
│ ├── package.json # Frontend dependencies
│ └── vite.config.js # Vite configuration
├── 📁 api/ # API route handlers
│ ├── login.js # Authentication
│ ├── settings.js # App settings
│ ├── suggestions.js # AI suggestions
│ ├── accept-invite.js # Team invitations
│ └── ai-suggest.js # AI generation
├── 📁 models/ # Database models
│ ├── User.js # User schema
│ ├── Faq.js # FAQ schema
│ ├── Settings.js # Settings schema
│ ├── Analytics.js # Analytics schema
│ └── TeamMember.js # Team member schema
├── 📁 backend/ # Core backend logic
│ ├── embedding.js # AI embeddings
│ ├── similarity.js # Semantic matching
│ └── db.js # Database utilities
├── 📁 utils/ # Utility functions
│ ├── sendEmail.js # Email functionality
│ └── db.js # Database helpers
├── server.js # Main server file
├── package.json # Backend dependencies
└── README.md # This file
http://agent-faq.vercel.app
https://agent-faq.onrender.com
- Node.js 18+ installed
- MongoDB Atlas account
- GitHub account
- Vercel account (free)
- Render account (free)
git clone https://github.com/DakshN07/Agent-FAQ.git
cd Agent-FAQ# Install backend dependencies
npm install
# Install frontend dependencies
cd frontend
npm install
cd ..Create a .env file in the root directory:
# Database
MONGO_URI=your_mongodb_atlas_connection_string
# Authentication
JWT_SECRET=your_super_secret_jwt_key
# AI Services
GEMINI_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
# Discord Bot (optional)
DISCORD_TOKEN=your_discord_bot_token
# Email (optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASS=your_app_password
SMTP_FROM=your_email@gmail.com# Start backend server
npm run dev
# Start frontend (in another terminal)
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
POST /api/login # User login
POST /api/accept-invite # Accept team invitationGET /api/faqs # Get all FAQs
POST /api/faqs # Create new FAQ
PUT /api/faqs/:id # Update FAQ
DELETE /api/faqs/:id # Delete FAQGET /api/analytics # Get analytics data
GET /api/settings # Get app settings
PUT /api/settings # Update settings
GET /api/suggestions # Get AI suggestionsGET /api/health # Health check
GET /api/unknown-questions # Get unknown questions{
email: String, // User email
password: String, // Hashed password
name: String, // User name
role: String, // 'admin' | 'member'
createdAt: Date
}{
question: String, // FAQ question
answer: String, // FAQ answer
guildId: String, // Discord server ID
embedding: [Number], // AI embedding vector
createdAt: Date
}{
similarityThreshold: Number, // Matching threshold (0.1-1.0)
maxSuggestions: Number, // Max AI suggestions
autoRespond: Boolean, // Auto-response setting
notificationEmail: String, // Admin email
createdAt: Date,
updatedAt: Date
}-
Connect to Vercel
- Go to vercel.com
- Sign in with GitHub
- Click "New Project"
-
Import Repository
- Select your
Agent-FAQrepository - Set root directory to
frontend/ - Vercel auto-detects React + Vite
- Select your
-
Deploy
- Click "Deploy"
- Get your live URL
-
Create Web Service
- Go to render.com
- Click "New Web Service"
- Connect your GitHub repo
-
Configure Settings
- Root Directory:
/(leave blank) - Build Command:
npm install - Start Command:
node server.js - Environment: Node
- Root Directory:
-
Environment Variables
MONGO_URI=your_mongodb_atlas_connection JWT_SECRET=your_jwt_secret GEMINI_API_KEY=your_gemini_key
-
Deploy
- Click "Create Web Service"
- Wait for build completion
-
Create Cluster
- Go to mongodb.com/atlas
- Create free cluster (M0)
-
Database Access
- Create database user
- Set username/password
-
Network Access
- Allow access from anywhere (0.0.0.0/0)
-
Get Connection String
- Click "Connect" on cluster
- Choose "Connect your application"
- Copy connection string
If you get CORS errors, update your backend:
app.use(cors({
origin: ['https://your-frontend.vercel.app', 'http://localhost:5173'],
credentials: true
}));Make sure all required environment variables are set in Render:
MONGO_URI- MongoDB Atlas connection stringJWT_SECRET- Secret key for JWT tokensGEMINI_API_KEY- Google Gemini API keyDISCORD_TOKEN- Discord bot token (optional)
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Commit your changes
git commit -m 'Add amazing feature' - Push to the branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow the existing code style
- Add tests for new features
- Update documentation
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 DakshN07
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Daksh Nayak - Frontend development, database & deployment
- Ayush Burde - Main project concept, backend & architecture
- OpenAI for AI embeddings and suggestions
- Google Gemini for alternative AI services
- Vercel for frontend hosting
- Render for backend hosting
- MongoDB Atlas for database hosting
- Discord.js for Discord bot integration
If you need help or have questions:
- Email: [dakshnayak635@gmail.com] [aayuworks7@gmail.com]
- Issues: GitHub Issues
- Discussions: GitHub Discussions
** Star this repository if you found it helpful!**
** Built with ❤️ for the developer community**