A custom Learning Management System (LMS) and Community Platform for the "HELP Foundations Training" program—a 9-week course on counseling, ethics, and trauma support.
To equip and certify individuals in foundational helping skills through a structured, rigorous, yet communal digital environment.
- Framework: Next.js (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + Shadcn UI
- Icons: Lucide React
- Database/Auth: Supabase (Auth, Database, Storage)
- State Management: Zustand
├── app/ # Next.js App Router pages
│ ├── dashboard/ # Student dashboard
│ ├── course/ # Course player
│ ├── journal/ # Learning journal
│ └── ...
├── components/
│ ├── ui/ # Shadcn UI components
│ └── lms/ # LMS-specific components
├── lib/
│ ├── supabase/ # Supabase client utilities
│ ├── utils/ # Helper functions
│ └── store/ # Zustand stores
├── types/ # TypeScript type definitions
└── supabase/
└── migrations/ # Database migration files
- Node.js 18+
- npm or yarn
- Supabase account and project
-
Clone and install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local
Fill in your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEY(required for approvals + password setup tokens)
-
Set up the database:
- Run the migration file in
supabase/migrations/001_initial_schema.sqlin your Supabase SQL editor - Or use Supabase CLI:
supabase db push
- Run the migration file in
-
Run the development server:
npm run dev
- Public routes:
/apply(application form),/student/login,/staff/login,/set-password. - All other routes (including deep links like
/learner/...) are protected server-side viaproxy.ts+lib/supabase/middleware.ts. - Unauthenticated visitors are redirected to
/apply.
- Visitor submits the public application on
/apply→ stored asapplicants (PENDING). - Admin reviews
Admin → Applicants(/admin/applicants) and clicks Approve. - System generates a unique matric number (
HF-CT-YYYY-####) + a one-time set-password link. - Student sets their password via
/set-password?token=...and then logs in at/student/loginusing Matric Number + Password.
- Hero section: "Equipping the Hands That Help"
- Faculty grid: Dynamic display of mentors
- Curriculum preview: Timeline showing 9 modules
- Progress tracker: Visual bar showing completion % (0-100%)
- Sequential learning: Module 1 must be completed to unlock Module 2
- Learning journal: Text editor for private reflections
- Sidebar navigation for Modules 1-9
- Main content area:
- HTML content for lesson text
- Video embed placeholder (for converted PPTs)
- Audio player (for Role Play scenarios)
- Worksheet component: Form submission required to mark lesson as "Complete"
- Quiz logic: 10-question multiple-choice quiz at end of each module
- Gating: >80% score required to pass
- Final exam: File upload dropzone for "Case Study Analysis" at end of Week 9
- Auto-generation of PDF certificate upon completion of all 9 modules + Final Exam
The database includes:
- profiles - User profiles extending Supabase auth
- cohorts - Course cohorts/groups
- modules - 9 course modules
- lessons - Lessons within modules
- user_progress - Individual lesson progress
- module_progress - Module-level progress and quiz scores
- quizzes & quiz_questions - Assessment structure
- learning_journals - Student reflections
- final_exam_submissions - Final exam uploads
- certificates - Generated certificates
The platform uses a calming, professional color palette (Blues, Teals, Whites) fitting for a counseling/mental health academy.
Private - HELP Foundations Training Program
Public routes:
/unified marketing + intake homepage/applymulti-step application wizard/apply/resumeresume draft flow/apply/success?id=<applicationId>submission confirmation/privacy,/terms,/contact/student/login,/staff/login,/student/set-password(and/set-passwordalias)
Application journey:
- Applicant starts on
/apply, completes multi-step form, and drafts autosave to DB (application_drafts). - Final submit posts to
/api/apply/submit, server-validates with Zod, checks honeypot + rate limit, and insertsapplicantsrow with statusPENDING. - User is redirected to
/apply/successwith application ID. - Admin reviews in
/admin/applicants, approves/rejects. - Approved applicant receives payment instructions; after payment verification, set-password link is generated.
- Set-password links are issued at
/student/set-password?token=...and also logged toemail_outbox. - Student logs in via matric number on
/student/login.
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYPAYSTACK_SECRET_KEY(for live paystack initialization/verification)PAYSTACK_WEBHOOK_SECRET(recommended for webhook verification)BASE_URL(recommended in production for callback/link generation)
application_draftsid,status,email,form_data,last_step, timestamps
email_outboxid,recipient_email,subject,body,kind,applicant_id,student_id,created_at
applicant_statusenum updated to includeDRAFT(migration 033)
Run migration:
supabase/migrations/033_application_drafts_and_outbox.sql
Use the built-in reset script before handover or production launch cleanup.
- Dry run:
CONFIRM=YES DRY_RUN=1 node scripts/reset-test-data.mjs
- Execute:
CONFIRM=YES DRY_RUN=0 node scripts/reset-test-data.mjs
Notes:
- The script keeps staff/admin access by default and removes test user/application data.
- Schema and migrations are not deleted.
- Optional
WIPE_REFERENCE_DATA=YESalso clears seeded content tables. - See
HANDOVER.mdfor full reset scope and post-reset account notes.