Skip to content

Latest commit

 

History

History
76 lines (52 loc) · 2.58 KB

File metadata and controls

76 lines (52 loc) · 2.58 KB

Contributing to Terminal Learning

Thank you for your interest in contributing! Volunteer, open source, 100% free.

Getting Started

git clone https://github.com/thierryvm/TerminalLearning.git
cd TerminalLearning
npm install
cp .env.example .env.local   # fill in VITE_SUPABASE_URL + VITE_SUPABASE_ANON_KEY
npm run dev

Env vars (see .env.example):

  • VITE_SUPABASE_URL — Supabase dashboard → Settings → API
  • VITE_SUPABASE_ANON_KEY — same location (public anon key, safe for client)
  • VITE_SENTRY_DSN — optional, Sentry project DSN

Quality Gates (must pass before every commit)

npm run type-check   # zero TypeScript errors
npm run lint         # zero ESLint errors
npm run test         # all tests pass
npm run build        # production build succeeds

Development Workflow

  • Branch from mainfeature/THI-XX-description or fix/THI-XX-description
  • Follow Conventional Commits
  • Open a PR — CI must pass before merge

See docs/CONVENTIONS.md for full branch/commit/PR conventions.

Critical Files — Touch With Care

File Risk
src/app/data/curriculum.ts Modifying breaks tests + user progress
src/app/context/ProgressContext.tsx Bug = data loss for users
src/app/data/terminalEngine.ts Each new command needs a test
vercel.json Loosening CSP is a security regression

Adding Terminal Commands

New commands go in src/app/data/terminalEngine.ts inside executeCommand. Each command must have a test in src/test/terminalEngine.test.ts.

Adding Lessons

Lessons live in src/app/data/curriculum.ts. Each lesson needs:

  • A unique id (slug), title, description, blocks (content), optional exercise

Auth-Gated Features (Phase 3+)

Use useAuth() from src/app/context/AuthContext.tsx to access session/user. Use useProgress() from src/app/context/ProgressContext.tsx for synced progress.

Upcoming (Phase 7) — RBAC: a useRole() hook will expose the user's role (super_admin, institution_admin, teacher, student). Do not implement role checks ad-hoc before this is in place — use useAuth() for now and leave a // TODO(THI-37) comment.

Architecture

See docs/ARCHITECTURE.md for source structure, data flow, and DB schema.

Reporting Issues

GitHub Issues for bugs. For security vulnerabilities → SECURITY.md.

License

By contributing, your code is released under the MIT License.