How om-singh-d/sih25092 works
This is a Next.js mental-health support platform with student-facing resources, mood assessment, chat, peer forum and consultation, plus account and admin functions. The apparent user journey begins at the landing page and branches into those support features; the available evidence does not establish a single end-to-end client-to-API workflow. The shown backend evidence covers account operations and MongoDB persistence. Other major routes are represented from the tree, but their internal behavior and connections are not inferred from unsampled source.
Main entry points: users-repo.js User repository · landing/page.jsx Landing page · resources/page.jsx Resource library · header.jsx Site header
Components 28
Student experience
- Landing page
src/app/landing/page.jsx - Hero section
src/components/hero-section.jsx - Site header
src/components/header.jsx - Site footer
src/components/footer.jsx - Resource library
src/app/resources/page.jsx
Accounts and administration
- Login page
src/app/login/page.jsx - Registration page
src/app/register/page.jsx - Login endpoint
src/app/api/users/login/route.js - Registration endpoint
src/app/api/users/register/route.js - Admin initialization
src/app/api/init/route.js - Current-user endpoint
src/app/api/users/me/route.js - Logout endpoint
src/app/api/users/logout/route.js - Student dashboard
src/app/dashboard/page.jsx - Admin pages
src/app/admin
Support services
- Mood assessment
src/app/mood-assessment/page.jsx - Peer forum
src/app/peer-forum/page.jsx - Consultation
src/app/consult/page.jsx - Chat interface
src/app/dashboard/chat/page.jsx - Chat API
src/app/api/chat/route.js - Anonymous session
src/app/api/sessions/anonymous/route.js - Anonymous session form
src/components/anonymous-session-form.jsx
Persistence and shared UI
- User repository
src/lib/users-repo.js - JWT authentication
src/lib/auth.js - User model
src/models/User.js - MongoDB connection
src/lib/mongodb.js - Logo
src/components/logo.jsx - UI primitives
src/components/ui
Other components
- Student / visitor
Connections 29
- Student / visitor → Landing page: visits
- Student / visitor → Resource library: opens
- Student / visitor → Mood assessment: opens
- Student / visitor → Peer forum: opens
- Student / visitor → Consultation: opens
- Student / visitor → Chat interface: opens
- Student / visitor → Anonymous session form: opens
- Student / visitor → Login page: opens
- Student / visitor → Registration page: opens
- Landing page → Hero section: renders
src/app/landing/page.jsx - Landing page → Site footer: renders
src/app/landing/page.jsx - Landing page → UI primitives: uses
src/app/landing/page.jsx - Hero section → Site header: renders
src/components/hero-section.jsx - Hero section → UI primitives: uses
src/components/hero-section.jsx - Site header → Logo: renders
src/components/header.jsx - Site header → UI primitives: uses
src/components/header.jsx - Resource library → Site header: renders
src/app/resources/page.jsx - Resource library → Site footer: renders
src/app/resources/page.jsx - Resource library → UI primitives: uses
src/app/resources/page.jsx - Login endpoint → User repository: looks up
src/app/api/users/login/route.js - Login endpoint → User repository: updates login
src/app/api/users/login/route.js - Login endpoint → JWT authentication: signs token
src/app/api/users/login/route.js - Registration endpoint → User repository: creates user
src/app/api/users/register/route.js - Admin initialization → User repository: initializes admin
src/app/api/init/route.js - Current-user endpoint → JWT authentication: verifies token
src/app/api/users/me/route.js - Current-user endpoint → User repository: loads user
src/app/api/users/me/route.js - Logout endpoint → JWT authentication: uses cookie settings
src/app/api/users/logout/route.js - User repository → MongoDB connection: connects
src/lib/users-repo.js - User repository → User model: queries and saves
src/lib/users-repo.js