Modules
Mentorship Module
Mentors, requests, sessions, and graduation
Data model
Mentorship— links amentorIdandstudentId(bothUser), with astatus(PENDING → ACTIVE → GRADUATED, orDECLINED/CANCELLED), optionalcohortIdCohort— groups mentorships so the same mentor/student pair can repeat across cohortsMentorshipSession— individual scheduled sessions under a mentorship
A user is listed as a mentor on /mentorship if their role is MENTOR, MAINTAINER, or
ADMINISTRATOR.
Flow
- A signed-in user requests mentorship from a mentor (
requestMentorship) →PENDING - The mentor accepts (
ACTIVE) or declines (DECLINED) from their "Students you're mentoring" list on/mentorship - The mentor graduates the student (
graduateMentorship) →GRADUATED, which also issues a certificate
All three actions are Next.js Server Actions in apps/web/app/mentorship/actions.ts, each
re-verifying that the caller is actually the assigned mentor before mutating anything server-side
— never trust the UI alone for authorization.