Economic Commission for Africa learning management system
# 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:
```bash
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:
```bash
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
```bash
cd backend
npm install
node src/seed.js # creates the first Super Admin account (prints email/password)
npm run dev # starts on
localhost
```
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`, ` …