# Continue MyEdCamp from the other laptop

Paste this into a new Cursor Agent chat after you open this folder:

> Continue MyEdCamp from CONTINUE.md. Stay Laravel Blade + MySQL. Do not introduce Next.js. Parent controls → Student learns. Last finished work: Teacher Join Class / End Class (Group Live and 1-to-1).

This file is the portable conversation. Cursor does not sync Agent chats across laptops.

## Product rules (do not reverse)

- Laravel 13, PHP 8.5, Blade, MySQL/`myedcamp`. No Next.js app for this product.
- Brand: navy sidebar `#102A43`, green CTAs, yellow, white, deep slate, cool grey.
- Super Admin chrome uses `template/` (Preadmin). Student/parent/teacher use Blade layouts + `public/css/admin-theme.css`.
- Students cannot self-register. Parents create children. Timezone `Africa/Accra`.
- Teachers do not own courses. They are assigned to **subjects** (a Mathematics teacher, a Science teacher). Super Admin then sets **class times** for that subject.
- Parents pay MyEdCamp, not teachers.
- Core unit is **Lesson** vs **Lesson session**. A published Lesson is the **subject for a class** (JHS 2 Mathematics). Curriculum units (Introduction to Algebra) sit under that subject.
- Hierarchy: Education Level → Class → Subject → Curriculum → Version → Topic → Subtopic → Learning Objective. Topic/subtopic belong in the subject curriculum, not as parent-facing enrolments.
- Enrolment is to a **subject lesson** for the child's class. Parents view curriculum, then choose Super Admin class times.
- Student portal is a learning workspace, not admin. Do not duplicate parent commercial features (payments, subscriptions, manage children, enrolments).
- Live join: audience membership **and** join window (15 min before start until end, or status Live). Never expose join URL/token in HTML or student API.
- Progress is derived (access 10%, attendance 40%, homework submit 65%). Recommendations are rules-based, not AI.
- Server-side auth: never trust `student_id`. IDOR/BOLA protection. Student cannot enrol, pay, or manage siblings.

## Where we left off (2026-09-20)

**Teachers can Join Class and End Class for Group Live and 1-to-1 sessions.**

- Demo teacher: `teacher@myedcamp.test` / `password` at http://127.0.0.1:8000/teacher
- Start Lesson `/teacher/live/start` (also dashboard today, assigned lessons): **Join Class** / **Enter class** when Live, plus **End Class**.
- Join sets the session Live (students can then join in the window). End completes it — students can no longer join. Join URL/token is never shown.
- Other teachers get 404; students get 403 on `/teacher/live/*`.
- `TeacherLiveClassTest` + `TeacherDashboardTest` + student join tests are green.

## Key files

- `apps/web/app/Services/LessonSessionService.php` — join window, `startLive` / `endLive`
- `apps/web/app/Support/TeacherWorkspace.php` — assigned-teacher only, `canJoinLive` / `canEndLive`
- `apps/web/app/Http/Controllers/Web/Teacher/LiveClassController.php`
- `apps/web/resources/views/teacher/live/` — Start Lesson list, details, classroom
- `apps/web/routes/web.php` teacher `/live/*` (UUID before catch-all)
- `apps/web/tests/Feature/TeacherLiveClassTest.php`

## Run on the new laptop

1. Sign in to the same Cursor account, clone this repo, open the `myEdcamp` folder (or `htdocs` if you keep the XAMPP layout).
2. XAMPP MySQL: database `myedcamp`, user `root`, empty password (or match `.env`).
3. From `apps/web`:

```bash
cp .env.example .env
php artisan key:generate
composer install
php artisan migrate --seed
php artisan template:link
php artisan serve --host=127.0.0.1 --port=8000
```

Do not commit `.env`.

## Product direction (2026-10-27)

- Public recruitment language is **Tutor** (`Become a Tutor`, `/become-a-tutor`). Internal role slug remains `teacher`.
- Tutor applications still require **Super Admin** verification, approval and activation before teaching access.
- Going forward: prefer **AI automations** for repetitive ops (application triage drafts, scheduling suggestions, homework reminders, parent progress digests) so Super Admin, tutors and parents do less manual busywork. Keep human approval for activation, safeguarding and pay. Do not claim unfinished AI features as live.

## Suggested next work (not started)

Tutor public registration/onboarding redesign is in progress. Likely next: Super Admin application review UX, then first AI assist (draft application summary for Super Admin).
