A full-stack ACE forum for university communities where users can register, log in, ask questions, comment on questions, and manage their profile.
- Frontend: React + Vite
- Backend: Node.js + Express.js
- Database: MongoDB (local)
UNIACE/
├── client/
│ ├── public/
│ └── src/
│ ├── components/
│ ├── context/
│ ├── lib/
│ └── pages/
└── server/
└── src/
├── middleware/
├── models/
└── routes/
- Register with:
- unique username
- password
- confirm password
- Login with:
- username
- password
Users can view and update optional profile fields:
- name
- phone number
- role (
student,senior student,lecturer)
- Post text-only questions
- Edit own questions
- Delete own questions
- Comment on questions
- MongoDB URI:
mongodb://127.0.0.1:27017/quiz - Collections:
- users
- questions
- comments
Base URL: http://localhost:5000/api
POST /register- create new userPOST /login- authenticate user
GET /questions- fetch all questionsGET /questions/:id- fetch one question with commentsPOST /questions- create new question (auth required)PUT /questions/:id- update own question (auth required)DELETE /questions/:id- delete own question (auth required)
POST /comments- create new comment (auth required)
GET /profile- fetch current user profile (auth required)PUT /profile- update current user profile (auth required)
username(String, required, unique)password(String, required, hashed)name(String, optional)phone(String, optional)role(String, optional:student|senior student|lecturer)
text(String, required)author(ObjectId -> User, required)- timestamps
text(String, required)author(ObjectId -> User, required)question(ObjectId -> Question, required)- timestamps
- Node.js 18+ recommended
- npm 9+ recommended
- MongoDB running locally
cd server
npm install
Create server/.env with:
PORT=5000
MONGODB_URI=mongodb://127.0.0.1:27017/quiz
JWT_SECRET=quiz_jwt_secret_key_change_in_productioncd ../client
npm install
cd server
npm run dev
cd client
npm run dev
Frontend URL:
http://localhost:3000
Backend URL:
http://localhost:5000
- Questions can only be edited/deleted by their author.
- Deleting a question also deletes its comments.