Skip to content

Latest commit

 

History

History
111 lines (82 loc) · 2.6 KB

File metadata and controls

111 lines (82 loc) · 2.6 KB

Development Guide

Repository: github.com/CreativeLabs-LMS/platform

Prerequisites

  • Go 1.26+
  • Node.js 20+ (18 works with a react-router engine warning)
  • Docker & Docker Compose (recommended)

Full stack (Docker)

git clone https://github.com/CreativeLabs-LMS/platform.git
cd platform
docker compose up --build

Migrations run automatically on first PostgreSQL start via /docker-entrypoint-initdb.d.

Fresh database with updated demo schools: delete the Postgres volume if upgrading from an older seed:

docker compose down -v
docker compose up --build

Local development

1. Start dependencies

docker compose up postgres redis

2. Backend

cd backend
export DATABASE_URL=postgres://maths:maths_dev_password@localhost:5432/maths_lms?sslmode=disable
export REDIS_URL=redis://localhost:6379/0
export JWT_SECRET=dev-jwt-secret-change-in-production-min-32-chars
export CORS_ORIGIN=http://localhost:5173
go run ./cmd/server

3. Frontend

cd frontend
npm install
npm run dev

Vite proxies /api to http://localhost:8080.

Build verification

cd backend && go build -o /dev/null ./cmd/server
cd frontend && npm run build

Generate password hashes

cd backend && go run ./cmd/hashgen

Demo accounts

Fictional demo schools only — do not use real pupil data.

Maple Grove Demo School

Role Username Credential
Pupil alex.j PIN 123456
Pupil mia.p PIN 123456
Teacher jsmith teacher123
SENCO r.brown teacher123
IT Admin admin teacher123

Cedar Hill Demo School

Role Username Credential
Pupil emma.k PIN 123456
Teacher t.jones teacher123
IT Admin cedar.admin teacher123

Platform admin (SaaS console, internal)

Username Password
platform.admin teacher123

Adding a question type

  1. Create frontend/src/modules/MyModule.tsx
  2. Register in frontend/src/modules/registry.ts
  3. Add validator in backend/internal/validation/validator.go
  4. Insert seed row with matching ui_component string
  5. Rebuild and test via practice session

Environment variables

Variable Default Description
DATABASE_URL local postgres URL PostgreSQL connection
REDIS_URL redis://localhost:6379/0 Redis connection
JWT_SECRET dev secret HMAC signing key (min 32 chars prod)
PORT 8080 API listen port
CORS_ORIGIN http://localhost:5173 Allowed SPA origin