This repository contains a full-stack FAQ and forum platform for a student cohort. The app is built with:
- Frontend: React + Vite + Tailwind CSS
- Backend: Express.js + MongoDB + Socket.IO + node-cron
- Authentication: JWT-based student sessions and admin login
- Search: client-side FAQ search with highlighted matches
- Forum workflow: query submission, answer review, and admin moderation
The project is split into:
Frontend/— public FAQ, student forum, admin dashboard UIBackend/— API server, database models, auth, admin tooling, cron jobs
- Searchable FAQ page at
/faq - Live query matching across question, answer, and category text
- Highlighted search terms in results
- Categorized FAQ listing with accordion view
- Helpful count and peer footnote display for approved community notes
- Secure student forum at
/forum - Student login and session management using JWT in
httpOnlycookies - Discussion tabs for Samvaad, raising queries, and solving queries
- Password reset flow for first-time or expired student sessions
- Inactivity warning and automatic logout after inactivity
- Separate admin portal at
/admin - Admin login with email/password
- Query detail review, answer approval, rejection, and promotion to FAQ
- Trusted student answer review and override options
- File screenshot preview support inside admin review
- Express API routes for FAQs, auth, queries, categories, uploads, and notifications
- MongoDB models for
FAQ,User,Query,Category, and more - Rate limiting, CORS, Helmet security headers, and no-cache API policy
- Cookie-backed JWT refresh on each authenticated request
- Daily cron digest email generation and hourly cache cleanup
- Category-based FAQ organization and content sorting
- Query and answer flagging support in the backend workflow
- Admin queue and query status tracker in the dashboard
- File upload endpoint for screenshot attachments
- Daily backend cron tasks for maintenance and digest generation
FAQ_SOFTWARE/
├── Frontend/ # React app and UI code
│ ├── src/
│ │ ├── components/ # UI components and forum widgets
│ │ ├── lib/ # axios instances and socket helpers
│ │ ├── pages/ # React route pages
│ │ └── store/ # auth and application state
│ └── package.json
├── Backend/ # Express API server and services
│ ├── middleware/ # auth guards and socket auth
│ ├── models/ # Mongoose schema definitions
│ ├── routes/ # API route handlers
│ ├── scripts/ # seed and setup helpers
│ ├── services/ # email, similarity, cron, and backend utilities
│ └── server.js # server bootstrap
├── package.json # root workspace config
└── README.md
- Node.js 18+ / 20+
- npm 10+
- MongoDB Atlas or local MongoDB
- A web browser for the frontend
-
Open a terminal in
Backend/ -
Install dependencies:
cd Backend npm install -
Create a
.envfile inBackend/with values for:MONGODB_URICLIENT_URLJWT_STUDENT_SECRETJWT_ADMIN_SECRETBASE_URLJWT_INACTIVITY_MINUTES(optional, default:10)
-
Seed initial data (optional):
npm run seed npm run seed:admin npm run seed:categories
-
Start the backend server:
npm run dev
- Open a terminal in
Frontend/ - Install dependencies:
cd Frontend npm install - Start the frontend development server:
npm run dev
- Open the app in the browser at the URL shown by Vite (typically
http://localhost:5173).
npm run dev— start Vite development servernpm run build— build production assetsnpm run preview— preview production build locallynpm run lint— run ESLint
npm run dev— start Express servernpm run start— start production servernpm run seed— seed FAQ datanpm run seed:admin— seed admin user datanpm run seed:categories— seed category data
Required variables:
MONGODB_URI— MongoDB connection stringCLIENT_URL— allowed frontend originJWT_STUDENT_SECRET— student auth JWT secretJWT_ADMIN_SECRET— admin auth JWT secretBASE_URL— public backend base URLJWT_INACTIVITY_MINUTES— session expiration window (default10)
The frontend uses Vite and expects the API base URL to match the backend origin.
- The frontend app includes a public FAQ page and a protected forum page.
- Student authentication is managed via secure cookies and JWT session refresh.
- Admin users have a dedicated dashboard separate from student flows.
- The backend enforces rate limits, CORS, and no-cache headers on API endpoints.
- Cron jobs handle background tasks such as digest emails and cache cleanup.
- Fork the repo or clone it locally.
- Install dependencies in both
Frontend/andBackend/. - Follow the feature implementation order in the project spec when adding new functionality.
- Keep frontend components reusable and backend routes thin.
This repository is currently private and intended for the cohort FAQ and forum project.