Granth is a crowd-sourced MERN stack FAQ management and community learning platform. Designed with sleek visuals, dark mode compatibility, and high interactivity, Granth allows community members to search for FAQs, raise peer-to-peer queries, upvote answers, and unlock gamified reputation scores.
Granth also features a state-of-the-art RAG (Retrieval-Augmented Generation) Chat Widget that queries the local database and streams semantic FAQ answers directly to users in real-time, accompanied by a custom fading bottom mask for smooth scrolling physics.
| Layer | Technologies & Implementations |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS, React Router v6, CSS Canvas Transitions, Dynamic Dark/Light Mode. |
| Backend | Express.js REST API, Node.js, JWT Authentication (x-auth-token headers), Express Rate Limiting. |
| Database | MongoDB & Mongoose schemas with custom collection indexing. |
| AI (RAG) | Custom Chunk-level text similarity search + stream-buffer response. |
| Search Engine | Advanced case-insensitive regex-based partial and substring matching query pipeline. |
- Instant Substring Search: Instantly look up FAQs with smart, partial-word search that matches titles, answers, and tags.
- Community Forum: Ask open questions, submit answers, and mark verified solutions.
- Reputation System: Earn reputation points (+10 on accepted answers, +2 per upvote) displayed on a global leaderboard.
- AI FAQ Assistant: Floating RAG-based AI chat bot with ChatGPT-style streaming text blocks and modern fading viewport masks.
- Duplicate Prevention: Detects similar queries before submission using a hybrid similarity algorithm.
- Moderation Console: Verify answers, ban bad actors, and resolve pending query logs.
- Hero Spotlights: Pin Announcements, system Overviews, or high-value FAQs to the home landing board.
- Audit Trails: Complete historical version tracking (
FAQHistory) for edited FAQs to capture prior revisions and reasons. - SLA Breaches: Automated systems to detect, track, and close stale, unfulfilled query claims.
Run the following root script to install node packages across both client and server automatically:
npm run install:allCreate a .env configuration file in the server folder:
cp server/.env.example server/.envEnsure your configuration points to the Granth local database:
MONGO_URI=mongodb://localhost:27017/Granth
JWT_SECRET=your-secret-key-goes-here
PORT=5000
RESET_DB=falseWipe existing tables and populate the 118 parsed academic/program FAQs:
# On Windows PowerShell:
$env:RESET_DB="true"; npm run seed- Default Admin Credentials:
admin@faqapp.com/admin123
Launch the client and server processes concurrently inside Vite's dev sandbox:
npm run devGranth is now running at http://localhost:5173 (Client) and http://localhost:5000 (Server)!
cs16/
├── client/
│ └── src/
│ ├── components/
│ │ ├── Layout.jsx # Header, footer, & platform branding
│ │ ├── CommunityBoard.jsx # Pinned announcements carousel
│ │ ├── RAGChatWidget.jsx # AI assistant with viewport gradient mask
│ │ ├── RichTextEditor.jsx # Markdown editor with image clipboard support
│ │ └── TagInput.jsx # Chip-style tag selector
│ └── pages/
│ ├── FAQsPage.jsx # FAQ search and topic browser
│ ├── CommunityPage.jsx # Q&A board
│ ├── LeaderboardPage.jsx # Gamified rankings
│ └── AdminDashboard.jsx # Moderation analytics and pins
└── server/
├── controllers/ # Auth, FAQ, Query, Search & RAG logic
├── models/ # Mongoose Schemas (FAQ, User, Query, Answer, FAQHistory)
├── seed.js # Database seeder script
└── tests/ # Jest tests
Granth is licensed under the MIT License. Built with ❤️ by Vicharanashala.
