A high-performance, semantic query-resolution and FAQ generation platform featuring a QP (Quality Point) reputation economy, role-based access control, Qdrant Cloud vector search, local Sentence Transformers, and admin-controlled email whitelist signup. Users raise real-time queries (RTQs), get peer/moderator/senior answers, and high-quality content graduates into an approved FAQ knowledge base.
Stack: React + Vite | Express.js + MongoDB | Qdrant Cloud | Sentence Transformers (all-MiniLM-L6-v2)
- Email whitelist-gated signup with OTP verification
- Role-based access control β Student, Moderator, Senior, Admin
- JWT authentication with role + QP payload
- Access request flow for non-whitelisted users (admin approval required)
- Re-access request system for blocked users
- 100 QP welcome bonus on account activation
| Page | Feature | Description |
|---|---|---|
| Dashboard | Quick Stats | Personal QP score, rank, recent activity, quick links to all features |
| RTQ Page | Real-Time Questions | Browse, search, filter by status/category, expand answers inline |
| Raise Question | Ask a Question | Submit questions through RAG duplicate detection engine |
| Track Questions | Personal Tracker | Track own submitted questions with interactive status selectors |
| FAQ Page | Knowledge Base | Browse approved FAQs by category, upvote, search |
| Leaderboard | Rankings | Peer leaderboard (Student/Moderator) with crown & trophy badges |
| Notifications | Activity Feed | QP changes, approvals, rejections, promotions |
| QP History | Transaction Log | Full history of QP earnings and deductions |
| Page | Feature | Description |
|---|---|---|
| Dashboard | Command Center | Senior-specific stats, quick actions, pending reviews |
| RTQ Management | Full Control | Accept/reject questions, approve/reject answers, flag for review, permanently remove |
| Add to FAQ | Controlled Conversion | Multi-step review modal to convert resolved RTQs into approved FAQs |
| Add New FAQ | Manual Creation | Directly create new FAQ entries with category and tags |
| Working History | Personal Audit Trail | Track all RTQβFAQ conversions performed by the senior |
| Leaderboard | Senior Rankings | Independent senior/admin leaderboard track |
| FAQ Conversion Requests | Review Panel | Approve/reject FAQ conversion requests from moderators |
| User Management | Admin Controls | Whitelist management, access request approvals, role assignments, block/unblock users |
- Semantic Embeddings via local
@xenova/transformers(all-MiniLM-L6-v2, 384-dim vectors) - Qdrant Cloud ANN Search with HNSW indexes and cosine distance
- Decision Tree evaluates FAQ + RTQ similarity to accept, reject, or penalize duplicate submissions
- LRU Embedding Cache (500 entries) for sub-10ms repeated queries
- Auto-Upvote Engine β duplicate submissions automatically upvote matching FAQ/RTQ entries
- Granular point system rewarding quality contributions across all roles
- Automatic penalties for duplicate/low-quality submissions
- QP < 50 β Question-raising restricted
- QP β₯ 500 β Auto-promotion request to Moderator
- 100 QP welcome bonus on first signup
- Full transaction history with notifications
The UI follows a premium academic-tech aesthetic inspired by Linear and Notion β minimal, structured, and trustworthy.
| Font | Usage |
|---|---|
| Playfair Display | Brand accent, logo, elegant headings |
| Outfit | Body text, navigation, UI elements |
- Glassmorphism β Frosted-glass overlays with backdrop blur for modals and search
- Gradient Accents β Accent-to-violet gradient buttons, badges, and icon containers
- Micro-Animations β Accordion transitions, scale-in modals, hover effects, floating elements
- Card-Based Layout β Consistent card design with subtle shadows and border accents
- Status-Coded Borders β Left border color coding (green/amber/red) for question status
| Component | Description |
|---|---|
Nav |
Persistent navbar with PippaQ branding, QP animation, and global search |
GlobalSearch |
"/" shortcut overlay searching FAQ + RTQ simultaneously |
UpvoteButton |
Toggleable upvote with optimistic updates |
Avatar |
Role-colored avatar with initials |
StatusBadge |
Dynamic role-aware status badges (moderator=blue, senior=purple) |
EmptyState |
Illustrated empty state with optional action button |
SkeletonLoader |
Shimmer loading placeholders for all page layouts |
BackToTop |
Smooth scroll-to-top floating button |
Breadcrumb |
Navigation breadcrumb trail |
MiniChart |
SVG sparkline for 7-day trend charts |
![]() Sign Up |
![]() Login |
![]() Request Approval |
![]() Profile |
![]() Peer Dashboard |
![]() Real-Time Questions |
![]() RAG Duplicate Check |
![]() Track Questions |
![]() Peer Leaderboard |
![]() FAQ Page (Moderator View) |
![]() RTQ Moderation |
![]() RTQ Moderation Actions |
![]() FAQ Conversion Request Modal |
![]() Senior Dashboard |
![]() FAQ Management |
![]() RTQ Management |
![]() Senior RTQ Actions |
![]() Add to FAQ Modal |
![]() Working History |
![]() Senior Leaderboard |
![]() Admin Whitelist Management |
![]() Admin Access Requests |
FAQ/
βββ SPEC.md # Project specification
βββ CONTEXT.md # Detailed implementation context
βββ README.md
β
βββ client/ # React + Vite frontend
β βββ src/
β βββ App.jsx # Role-based dashboard routing
β βββ index.css # Design system (Playfair Display & Outfit)
β βββ components/
β β βββ Nav.jsx # Persistent navbar with QP animation
β β βββ GlobalSearch.jsx # "/" shortcut β overlay search FAQ+RTQ
β β βββ UpvoteButton.jsx # Toggleable upvote with optimistic UI
β β βββ Avatar.jsx # Role-colored avatar
β β βββ Badge.jsx # Status badges (accepted/rejected/review)
β β βββ MiniChart.jsx # SVG sparkline for trend charts
β β βββ ... # EmptyState, BackToTop, Breadcrumb, etc.
β βββ context/
β β βββ AuthContext.jsx # JWT auth with role + QP
β β βββ QPContext.jsx # QP state management
β βββ pages/
β β βββ LoginPage.jsx # PippaQ branded login
β β βββ SignupPage.jsx # Whitelist signup + access request flow
β β βββ StudentDashboard.jsx # Student/Moderator dashboard
β β βββ SeniorDashboard.jsx # Senior/Admin dashboard
β β βββ FAQPage.jsx # Knowledge base with categories & upvotes
β β βββ RTQPage.jsx # Real-time questions list
β β βββ RTQDetailPage.jsx # Full question detail + answers
β β βββ RaiseQuestionPage.jsx # Submit question (RAG-evaluated)
β β βββ TrackQuestionPage.jsx # Track own questions
β β βββ UserListPage.jsx # Leaderboard + Admin user management
β β βββ WorkingHistoryPage.jsx # Senior's conversion history
β β βββ AboutPage.jsx # Interactive About page with symbolism
β β βββ ... # Profile, QP History, Add FAQ, etc.
β βββ services/
β βββ api.js # Axios instance with interceptors
β βββ auth.service.js # Auth API methods
β βββ faq.service.js # FAQ CRUD + conversion requests
β βββ rtq.service.js # RTQ operations
β βββ dashboard.service.js # Dashboard stats + activity feed
β
βββ server/ # Express.js backend
β βββ src/
β βββ config/
β β βββ db.js # MongoDB connection
β β βββ env.js # Environment config
β β βββ qdrant.js # Qdrant Cloud singleton client
β βββ controllers/
β β βββ auth.controller.js # Signup, OTP, login
β β βββ faq.controller.js # FAQ CRUD + review/trending
β β βββ faq-conversion.controller.js # Conversion request workflow
β β βββ rtq.controller.js # RTQ submit + moderation + QP loops
β β βββ rag.controller.js # RAG evaluation + vector rebuild
β β βββ admin.controller.js # User CRUD, roles, block/unblock
β β βββ admin.whitelist.controller.js # Whitelist + access requests
β β βββ categoryUpvote.controller.js # Category ranking + upvotes
β β βββ qp.controller.js # QP score + history
β βββ models/
β β βββ User.model.js # Roles: student|moderator|senior|admin
β β βββ FAQ.model.js # FAQ with review & trending flags
β β βββ RTQ.model.js # RTQ with bidirectional FAQ link
β β βββ Answer.model.js # Approvals/rejections + review flag
β β βββ QPTransaction.model.js # QP earn/deduct ledger
β β βββ Notification.model.js # Role-scoped notifications
β β βββ FAQConversionRequest.model.js # ModeratorβSenior conversion requests
β β βββ EmailWhitelist.model.js # Admin-controlled signup gate
β β βββ AccessRequest.model.js # Non-whitelisted signup requests
β β βββ ... # CategoryUpvote, RoleRequest, Question
β βββ services/
β β βββ auth.service.js # Signup + OTP + JWT generation
β β βββ qp.service.js # Award/deduct QP + auto-promotion
β β βββ autoupvote.service.js # Atomic auto-upvote on duplicates
β β βββ notification.service.js # Notification creation
β β βββ vector/ # Qdrant vector services
β β β βββ transformer.service.js # Local Sentence Transformer + LRU cache
β β β βββ embedding.service.js # Embedding pipeline
β β β βββ faq.vector.service.js # FAQ vector CRUD in Qdrant
β β β βββ rtq.vector.service.js # RTQ vector CRUD in Qdrant
β β βββ sync/ # MongoDB β Qdrant sync
β β βββ faq.sync.service.js # FAQ sync + rollback
β β βββ rtq.sync.service.js # RTQ sync + rollback
β β βββ sync.repair.service.js # Missing/stray vector detection
β βββ routes/ # Express route definitions
β
βββ rag-engine/ # RAG Decision Engine
β βββ decision-engine/
β βββ decision.tree.js # Semantic duplicate detection via Qdrant ANN
β
βββ shared/
β βββ constants.js # FAQ_CATEGORIES, QP_RULES, ROLES, RAG_THRESHOLDS
β
βββ scripts/
β βββ migrate-categories.js # Category normalization migration
β βββ bulk-import.js # Bulk FAQ import utility
β
βββ assets/
βββ UI_Visuals/ # App screenshots for README
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, React Router v6, Axios |
| Styling | Tailwind CSS + Premium Typography (Playfair Display & Outfit via Google Fonts) |
| Backend | Express.js, Mongoose ODM, JWT (bcryptjs) |
| Database | MongoDB (Atlas) |
| Vector Store | Qdrant Cloud (HNSW indexes, cosine distance, 384-dim, metadata payload filters) |
| Embeddings | @xenova/transformers β local WebAssembly/ONNX execution of all-MiniLM-L6-v2 |
| Dev Tools | concurrently (parallel client + server), Vite HMR |
Questions are evaluated semantically against the FAQ and RTQ collections stored in Qdrant:
User Question
β
βΌ
Generate Embedding βββΊ Local Sentence Transformer (all-MiniLM-L6-v2, 384-dim)
β
βΌ
Qdrant HNSW ANN Search βββΊ Compare with FAQ/RTQ Collections
β
βΌ
Apply Decision Tree Rules:
βββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β F1: FAQ similarity > 80% β REJECT, -5 QP, upvote FAQ β
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β F2: FAQ similarity 50β80% β β
β βββ R1: RTQ > 60% β REJECT, -5 QP, upvote FAQ β
β βββ R2: RTQ 20β60% β REJECT (no penalty) β
β βββ R3: RTQ β€ 20% β ACCEPT β Route to RTQ β
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ€
β F3: FAQ similarity β€ 50% β β
β βββ R1: RTQ > 60% β REJECT (no penalty), upvote β
β βββ R2/R3: RTQ β€ 60% β ACCEPT β Route to RTQ β
βββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββ
Performance: Includes an LRU Embedding Cache (500 entries) and model warmup on server startup for sub-10ms semantic queries.
| Role | Key Capabilities |
|---|---|
| Student | Ask RTQ questions, answer (1Γ/question), upvote, track own questions |
| Moderator | + Approve/reject answers, accept/reject questions, request FAQ conversions |
| Senior | + Create FAQs, convert RTQβFAQ via review panel, delete content, manage working history |
| Admin | + Manage email whitelist, approve access requests, assign/revoke roles, block/unblock users |
| Action | QP |
|---|---|
| Answer a question | +2 |
| Answer approved by Moderator/Senior | +5 |
| Answer selected for FAQ | +10 |
| Question accepted (valid RTQ) | +5 |
| Question promoted to FAQ | +20 |
| Senior converts RTQβFAQ | +10 |
| Senior creates new FAQ manually | +15 |
| Welcome bonus (account activation) | +100 |
| Action | QP |
|---|---|
| Duplicate FAQ match (F1) | -5 |
| F2+R1 match | -5 |
| Answer removed by Senior | -3 |
| Question removed | -5 |
- QP < 50 β Cannot raise questions
- QP β₯ 500 β Auto-request Moderator promotion
| Route | Description |
|---|---|
POST /api/auth/signup |
Register + email OTP verification |
POST /api/auth/login |
JWT login |
POST /api/auth/request-access |
Request signup approval (non-whitelisted) |
GET /api/faq |
List approved FAQs (paginated, searchable) |
POST /api/faq |
Create FAQ (Senior/Admin) |
GET /api/rtq |
List RTQs with filters |
POST /api/rtq/question |
Submit question through RAG engine |
POST /api/rtq/:id/answer |
Add answer to RTQ |
POST /api/rag/evaluate-question |
Run RAG decision tree |
POST /api/faq/request-conversion |
Moderator: request FAQ conversion |
GET /api/faq/conversion-requests |
Senior/Admin: list pending conversions |
GET /api/users |
User list / leaderboard |
GET /api/qp/my-score |
Current QP balance |
PATCH /api/admin/assign-role |
Admin: change user role |
Whitelisted Email β Signup β OTP Verification β 100 QP Welcome Bonus β Login
Non-Whitelisted β Access Request β Admin Approval β Account Created β Login
Blocked User β Re-Access Request β Admin Approval β Account Reactivated
Student submits question
β
βΌ
RAG Engine evaluates (FAQ + RTQ similarity)
β
βββ REJECT (duplicate) β -5 QP penalty, auto-upvote match
β
βββ ACCEPT β Added to RTQ pool
β
βββ Peers answer β Moderators approve/reject β QP awarded
β
βββ Moderator requests FAQ conversion β Senior reviews β Approved/Rejected
β
βββ Senior converts to FAQ directly β Published to Knowledge Base
Moderator Action on Question:
βββ Accept β Status: resolved, +5 QP to questioner, +3 QP to moderator
βββ Reject (1st) β Status: rejected, +3 QP to moderator
βββ Reject (2nd, different moderator) β Permanent deletion, -5 QP to questioner
- Node.js (>= 18)
- MongoDB (local or Atlas)
- Qdrant Cloud account (or local Qdrant instance)
-
Clone the repository
git clone https://github.com/vicharanashala/cs20.git cd cs20 -
Install all dependencies
npm run install:all
-
Configure environment
cp server/.env.example server/.env # Edit server/.env β set MONGO_URI, JWT_SECRET, QDRANT_URL, QDRANT_API_KEY -
Run the app
npm run dev
- Client: http://localhost:3000
- Server: http://localhost:5000
- β Semantic duplicate detection via Qdrant ANN before any question is accepted
- β Atomic QP transactions with rollback-safe decision changes
- β Bidirectional RTQβFAQ traceability for all conversions
- β Multi-moderator approval/rejection with collusion prevention (max 2 per moderator)
- β Auto-upvote on duplicate detection rewards original authors
- β Role-based UI constraints β actions are hidden from unauthorized roles
- β Idempotent decision rollbacks when moderators change their verdict
- β MongoDB β Qdrant sync with automatic rollback on vector store failures
- β 100 QP welcome bonus across all account activation paths
- β Email whitelist gate prevents unauthorized signups
Authors: Vicharanashala Team
Built with β€οΈ using React, Express, MongoDB & Qdrant





















