Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UNECA Learning Management System

A full-stack LMS covering:

  1. Admin bulk-invites trainees from an uploaded Excel list
  2. Trainers build chapters (video/slides/GitHub repo), quizzes, and a capstone/peer-reviewed assignment; trainees get a progress bar; completers get an encrypted, QR-verifiable transcript
  3. Trainee dashboard: resume where you left off, assignments due, notifications
  4. Peer review (never your own submission) averaged with the trainer's score for the final grade
  5. Calendar / timetable for live sessions
  6. Trainer-submitted curricula require super-admin approval before becoming a live course

Stack: Node.js/Express + PostgreSQL (plain SQL via the pg driver — no ORM binary downloads to worry about) and Next.js + Tailwind on the frontend.


1. Point this at YOUR local Postgres

You said you already run Postgres locally, so:

  1. Create a database:
    createdb uneca_lms
    # or, from psql:
    # CREATE DATABASE uneca_lms;
  2. Edit backend/.env and set DATABASE_URL to your real credentials:
    DATABASE_URL="postgresql://YOUR_USER:YOUR_PASSWORD@localhost:5432/uneca_lms?schema=public"
    
  3. Also change JWT_SECRET and TRANSCRIPT_ENC_KEY in that file to your own random strings before going anywhere near production — the checked-in values are dev placeholders only.
  4. Load the schema:
    psql "$DATABASE_URL" -f backend/db/schema.sql
    (or just psql -h localhost -U YOUR_USER -d uneca_lms -f backend/db/schema.sql)

That's it — no migration engine, no binary downloads. backend/db/schema.sql is the single source of truth for the schema.

2. Run the backend

cd backend
npm install
node src/seed.js        # creates the first Super Admin account (prints email/password)
npm run dev              # starts on http://localhost:4000

By default, invite emails just print to the console (src/utils/email.js) so you can develop without SMTP. To send real email, set SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, SMTP_FROM in backend/.env.

Uploaded files (submissions, invite spreadsheets, generated transcripts) are written to backend/src/uploads/ and served at /uploads/.... For a real deployment, point this at a persistent disk or swap in S3-compatible storage.

3. Run the frontend

cd frontend
npm install
npm run dev               # starts on http://localhost:3000

frontend/.env.local has NEXT_PUBLIC_API_BASE=http://localhost:4000 — change this if your backend runs elsewhere.

4. Try it out

  1. Log in as the seeded Super Admin (credentials printed by node src/seed.js).
  2. Admin → create a cohort, then either invite one person or bulk-upload an .xlsx with columns Full Name, Email, and optionally Role (TRAINEE/TRAINER).
  3. Each invited person gets an emailed (or console-logged) link to /accept-invite/<token> to set their password.
  4. Log in as the trainer → submit a curriculum → log back in as Admin → approve it (this auto-creates the live course) → enroll trainees (currently done via POST /admin/enrollments; a UI button for this is a natural next addition).
  5. Trainer → build chapters, content, quizzes, and the capstone assignment.
  6. Trainee → work through chapters (progress bar updates), take quizzes, submit the capstone.
  7. Trainer → "Randomly assign peer reviewers" on the capstone, then grade submissions yourself; the final grade is the average of the peer and trainer scores.
  8. Trainer → Course Settings → once a trainee has completed everything, click "Generate" to produce their signed, QR-coded transcript PDF. Anyone can scan the QR (or visit /verify/<code>) to verify it without logging in.

What's here vs. what a production rollout still needs

Built and tested end-to-end:

  • All 6 requested workflows, backend routes, and a full Next.js UI for admin/trainer/trainee
  • AES-256-GCM encrypted, HMAC-signed transcripts with QR codes (visually verified)
  • Peer review correctly blocks self-review; grade averaging tested

Recommended before a real UNECA rollout:

  • Email: wire up real SMTP (or an ESP like SES) — currently console-only in dev
  • File storage: move uploads/ to S3 or equivalent for durability and backups
  • Enrollment UI: enrolling a trainee into a course currently has an API but no admin-console button yet
  • Password reset / account recovery flow (not built yet — only invite-based account creation)
  • Rate limiting, HTTPS, and a proper secrets manager for JWT_SECRET/TRANSCRIPT_ENC_KEY in production
  • Automated backups of the Postgres database
  • A security review before handling real trainee data, given this is UN-affiliated infrastructure

About

Economic Commission for Africa learning management system

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages