How manhquydev/student-forum-web works
Project type and purpose
• This is a full-stack web application called “Diễn Đàn Sinh Viên” (Student Forum).
• Frontend: React SPA that provides UI for students to register, login, create/join forums, post, comment, etc.
• Backend: Node.js + Express REST API with JWT-based authentication, connecting to MongoDB for data persistence.
File structure
• Top-level folders:
• frontend/ – React source: components, pages, contexts, services, static assets.
• backend/ – Express API: config, models (Mongoose), controllers, routes, middleware, scripts, server entry, environment files.
• Patterns & conventions:
• Backend: MVC-style layering – routes → middleware → controllers → models → MongoDB.
• Frontend: Component-based UI, React Router for navigation, Context API for auth & DB status, a thin service layer (apiService.js) for HTTP.
• Config & Deployment:
• .env files in both frontend and backend for runtime variables (API URL, DB URI, JWT secret).
• vercel.json indicates deployment on Vercel.
README for additional insights
• Tech stack: Node.js 14+, MongoDB 4+, React.
• Features: Auth (student & admin), forum/post/comment CRUD, search, admin scripts (create/reset admin).
• Runtime flow:
• Frontend (http://localhost:3000) → calls → Backend (http://localhost:5001) → queries → MongoDB.