Think of it as Stack Overflow meets Reddit, tailored for students. |
|
🏠 Landing & Discovery
- Dynamic landing page with real-time database statistics
- Animated floating gradient orbs on the landing page
- Trending FAQ categories with live question counts
- Category shortcuts from the landing page to filtered FAQs
🎨 UI / UX
- Fixed responsive header with FAQ search + search highlighting
- Dark mode and light mode support
- Infinite scroll on FAQ feed (IntersectionObserver)
- Heart-shaped upvote buttons on answers and comments
- Sticky footer layout across all pages
- Fully mobile-responsive layout
🔐 Authentication & Profiles
- Student registration and login with JWT authentication
- Admin login and protected moderation dashboard
- Password reset via email (forgot/reset flow)
- Email verification on registration
- Brute-force protection — lockout after 5 failed attempts
- User profiles with bio, reputation, branch, and semester
- Saved FAQ bookmarks and Followed FAQs on profile
- Follow and unfollow student profiles
- Private follower and following lists
📋 FAQ Management
- FAQ creation with categories, tags, company, role, branch, and semester
- Anonymous FAQ posting support
- Similar-question suggestions before posting
- Tag autocomplete with usage-based sorting
- Search FAQs by title, description, or tags
- Filter FAQs by category, company, role, and status
- Sort by latest, most answered, most upvoted, or unanswered
- Full FAQ detail page with views, tags, and AI summary
- FAQ upvotes, downvotes, bookmarks, follows, shares, and reports
- Edit history for all FAQs (append-only log)
- Question merge for duplicate FAQs
- Feature/pin important FAQs
💬 Answers & Interactions
- Answers with anonymous posting support
- Answer upvotes, downvotes, comments, mentions, and reports
- Comment likes (heart toggle)
- Edit history for all answers
- Users cannot answer or comment on their own FAQs
- FAQ owners can accept admin-verified best answers
- Reputation changes on accept (+25 / -25)
- Users can delete their own unverified answers
- Verified answer deletion requires admin action
🏅 Gamification
- Reputation ladder: 10→comment, 25→upvote, 50→downvote, 100→flag
- Leaderboard — top 50 contributors by reputation
- Badge system with 8 badges (auto-awarded on login/question/answer)
- First Steps, Curious Mind, Helping Hand, Top Contributor
- Rising Star, Expert, Popular Answer, Frequently Bookmarked
- Trending questions weighted by votes + recency
🤖 AI Features (Google Gemini)
- Automatic AI summaries generated from verified answers
- AI summaries refresh after verification, unverification, or deletion
- AI chatbot grounded in verified community answers
- Floating chatbot helper with personalized greeting
🔔 Notifications
- Notifications for answers, mentions, accepted answers, FAQ activity, and followers
- Duplicate prevention — unique index on (recipient, type, faq, answer)
- Optional email notifications via SMTP
- Unread count badge on navbar
🛡️ Moderator & Admin
- Moderator role — close/reopen FAQs, edit any FAQ, review reports queue
- Admin dashboard with stats, user/FAQ/answer/report management
- Admin user banning, unbanning, and deletion (with content cleanup)
- Admin answer verification, unverification, and convert-to-comment
- Admin FAQ pinning, closing, reopening, merging, and deletion
- Report review, dismissal, escalate, and content removal
- Edit history browsing for all content
🛡️ Security
- Helmet — HTTP security headers
- express-rate-limit — rate limiting per endpoint
- express-mongo-sanitize — NoSQL injection prevention
- zod — request body validation on all POST/PATCH routes
- Input sanitization — strips XSS, javascript: URLs, on-event handlers
- Brute-force protection — temporary 15-min lockout after 5 failures
- CSP headers configured via Helmet
Frontend → React 18 + Vite 6 + React Router DOM v7 + Lucide Icons
Backend → Node.js + Express 4 + MongoDB (Mongoose) + JWT + bcryptjs
AI → Google Gemini 2.5 Flash
Validation → zod
Testing → Vitest + mongodb-memory-server
Dev DX → Concurrently + Vite HMR + node --watch
node >= 18.x
npm >= 9.x
MongoDB Atlas account (or local MongoDB instance)
Google Gemini API key
git clone https://github.com/aavesh-k/cs50.git
cd cs50npm installcp .env.example .envOpen .env and fill in your values — refer to .env.example for all required fields. Keep your credentials private and never commit .env to version control.
# Starts both API server and frontend simultaneously
npm run dev:all| Service | URL |
|---|---|
| 🌐 Frontend | http://127.0.0.1:5174 |
| 🔌 API Server | http://localhost:3000 |
Tip: You can also run them separately using
npm run dev(frontend) andnpm run dev:server(backend).
npm testcs50/
├── server/ # Express.js API server
│ ├── config/ # DB connection, env vars
│ ├── models/ # Mongoose schemas (10 models)
│ ├── routes/ # API route handlers
│ ├── middleware/ # Auth, rate-limit, validator, brute-force
│ ├── services/ # Email, AI, notifications, badges, reputation
│ └── utils/ # Helpers, response wrapper
│
├── src/ # React frontend (Vite)
│ ├── pages/ # Route-level page components
│ ├── features/ # Feature-specific (faq, answer, auth, admin)
│ ├── components/ # Reusable UI (layout, common, ui)
│ ├── hooks/ # Custom hooks (useToast, useDebounced)
│ └── utils/ # Helpers (time, string, constants, highlight)
│
├── tests/ # Vitest test suites
├── index.html
├── package.json
├── .env.example
├── .gitignore
└── LICENSE
All contributions are welcome!
# 1. Fork the repository
# 2. Create your feature branch
git checkout -b feature/YourFeature
# 3. Commit your changes
git commit -m "Add: YourFeature"
# 4. Push to the branch
git push origin feature/YourFeature
# 5. Open a Pull RequestDistributed under the MIT License — see LICENSE for details.