MindBridge is a university wellbeing and counseling platform that supports:
- student appointment booking and tracking
- counselor queue/availability management
- admin approval and operational oversight
- mood analysis and mood tracking workflows
- AI mental wellbeing chatbot guidance (Groq)
- React (Vite)
- Tailwind CSS
- React Router
- Go (Golang)
- Gin
- PostgreSQL
- GORM
- JWT authentication
- Brevo SMTP email notifications
- Groq API (
llama-3.1-8b-instant/ fallback-ready)
MindBridge
├── backend
│ ├── controllers
│ ├── email
│ ├── initializers
│ ├── middleware
│ ├── models
│ ├── routes
│ └── main.go
├── frontend
│ ├── public
│ └── src
└── README.md
Create backend/.env:
PORT=3000
SECRET_KEY=replace_with_secure_secret
DB=host=localhost user=postgres password=yourpassword dbname=itpmDB port=5432 sslmode=disable
# Optional email notifications (Brevo SMTP)
BREVO_SMTP_HOST=smtp-relay.brevo.com
BREVO_SMTP_PORT=587
BREVO_SMTP_USER=your_brevo_smtp_user
BREVO_SMTP_KEY=your_brevo_smtp_key
BREVO_SMTP_FROM="MindBridge <no-reply@yourdomain.com>"
# AI chatbot (Groq)
GROQ_API_KEY=your_groq_api_key
# Optional override model
GROQ_MODEL=llama-3.1-8b-instantNotes:
- If Brevo vars are not set, APIs still work, but email sending is skipped/fails safely.
PORTdefaults to3000when not provided.- If
GROQ_MODELis not set, backend tries built-in supported models automatically.
cd backend
go mod tidy
go run main.goBackend URL: http://localhost:3000
cd frontend
npm install
npm run devFrontend URL: typically http://localhost:5173 (or http://localhost:5174 if 5173 is occupied)
Most protected APIs require:
Authorization: Bearer <jwt-token>Use POST /api/login to obtain token.
All routes are registered from:
routes.SetupRoutes(r)routes.EventRoutes(r)
POST /api/signup- register userPOST /api/login- login and get JWTGET /api/validate- validate token and return authenticated user
POST /api/counsellor/apply(auth) - submit counselor applicationGET /api/counsellor/all- list approved counselorsGET /api/counsellor/profile/:userId- get counselor profilePUT /api/counsellor/profile/:userId- update counselor profilePOST /api/counsellor/profile-image/:userId- upload profile imageDELETE /api/counsellor/profile-image/:userId- remove profile image
GET /api/counsellor/location/all(auth) - list counselors for assignmentGET /api/counsellor/location/me(auth) - current counselor assigned locationPUT /api/counsellor/location/:userId(auth) - assign/update counselor location
Base group: /api/admin (all auth protected)
GET /api/admin/applications- list counselor applicationsPUT /api/admin/applications/:id/approve- approve counselorPUT /api/admin/applications/:id/reject- reject counselorGET /api/admin/appointments- list all appointments for admin dashboards
This module is available in Admin Dashboard as:
Counselor Vivatab (src/components/admin/CounselorVivaShowCase.jsx)
Purpose:
- review pending counselor applications
- schedule/reschedule viva interviews
- mark viva status as completed or cancelled
- track interview mode (online/onsite) and optional interview notes
Main API calls used by this module:
GET /api/admin/applications- fetch pending applications and interview metadataPUT /api/admin/applications/:id/interview- schedule or reschedule interviewPUT /api/admin/applications/:id/interview/complete- mark interview as completedPUT /api/admin/applications/:id/interview/cancel- cancel interview
Scheduling rules in UI:
- interview date/time is required
- interview date/time cannot be in the past
- minimum selectable time is current time + ~1 minute
GET /api/counsellor/availability/:id- get counselor availabilityPOST /api/counsellor/availability- add slotPUT /api/counsellor/availability/:id- update slotDELETE /api/counsellor/availability/:id- delete slot
Base group: /api/appointments
POST /api/appointments/create(auth) - create student appointmentGET /api/appointments/booked-slots- get booked slots for counselor/dateGET /api/appointments/student(auth) - student appointment listGET /api/appointments/counselor(auth) - counselor appointment queuePUT /api/appointments/:id/student(auth) - student edits pending appointmentDELETE /api/appointments/:id/student(auth) - student delete/request cancelPUT /api/appointments/:id/status(auth) - counselor status flow (Pending -> Confirmed -> Completed)PUT /api/appointments/:id/counselor-cancel(auth) - counselor cancels with notePUT /api/appointments/:id/cancellation/approve(auth) - counselor approves student cancel request
Triggered from appointment controller:
- Student gets email when counselor confirms appointment.
- Student gets email when counselor cancels appointment.
Base group: /api/appointments
POST /api/appointments/waitlist(auth) - join waitlistGET /api/appointments/waitlist/student(auth) - student's waitlist entriesGET /api/appointments/waitlist/counselor(auth) - counselor waitlist entriesDELETE /api/appointments/waitlist/:id(auth) - leave waitlist
When a slot opens, the waitlist pipeline can notify students by email.
Base group: /api/mood
POST /api/mood/analyze- rules-based mood analysis- returns mood, suggested counselor category, urgency
GET /api/mood/tracker(auth) - list recordsPOST /api/mood/tracker(auth) - upsert record for a dayPUT /api/mood/tracker/:id(auth) - update record by IDDELETE /api/mood/tracker/:id(auth) - delete record by IDDELETE /api/mood/tracker?date=YYYY-MM-DD(auth) - compatibility delete path
Each record stores:
- daily wellbeing metrics (sleep, social, physical, mindfulness, stress, energy)
- recommended counselor category
- recommendation urgency
- matched approved counselors by specialization
POST /api/treatment-plans- create planGET /api/treatment-plans(auth) - list plansGET /api/treatment-plans/student/:studentId(auth) - student-specific plansPUT /api/treatment-plans/:id- update planDELETE /api/treatment-plans/:id- delete plan
POST /api/events/register- register student to eventGET /api/student/events- get student's event registrationsDELETE /api/registration/:id- remove event registration
POST /api/events- create eventGET /api/events- list eventsGET /api/events/:id- get event by idPUT /api/events/:id- update eventDELETE /api/events/:id- delete eventGET /api/events/registrations- list all registrationsGET /api/events/:id/registrations- list registrations for one eventGET /api/events/:id/analytics- event analytics
Base route:
POST /api/chatbot/message
Request:
{
"message": "I feel stressed before exams and cannot focus."
}Response:
{
"reply": "supportive response from chatbot...",
"model": "llama-3.1-8b-instant"
}Notes:
- Chatbot endpoint is proxied through backend; API key is never exposed to frontend.
- Frontend widget is mounted globally in
src/App.jsxviasrc/components/MentalHealthChatbot.jsx. - This is supportive guidance, not emergency care; users in immediate danger should contact local emergency services.
- Mood tracker enforces one record per student per day using a composite unique index:
(student_id, date)
- Appointment workflow stores status progression and cancellation notes.
- Uploaded reports are served from:
GET /uploads/...
- Auth: signup -> login -> validate token.
- Student flow: create appointment -> counselor confirms -> student receives confirmation email.
- Counselor flow: cancel appointment with note -> student receives cancellation email.
- Mood flow: save daily tracker -> verify recommended category/counselors in response.
- Admin flow: approve/reject counselor applications.
- Chatbot flow: open widget -> send message -> receive AI response with model in payload.
SLIIT - IT Project Management (ITPM)
University Student Wellbeing Counselling Management System
- Aaisha Shahani
- Pravinath
- Dheena
- Sadhushan