Connect the student app to the Rezina API #5

Merged
naol-yaltopia merged 4 commits from api-integration into main 2026-11-03 16:57:59 +03:00

Wires the student app to the Rezina Go API (https://api.rezina.yaltopia.com) behind the existing DataSource, so the screens are unchanged. Builds on the course-experience polish PR.

Builds

  • app:build bakes the API URL in; vercel.json now uses it, so a deploy talks to the real API with no dashboard settings.
  • demo:build (the hosted artifact demo) is unchanged and keeps demo data; its sandbox can't reach outside servers.

Tested against the live API (no sign-in)

  • Catalog and course outlines: courses, chapters, lessons, lesson notes, covers
  • Free lessons play for anyone; a free course shows "Start lesson 1" instead of a disabled buy button

Built from the spec, pending a working account

  • Sign-in (phone code, email + password), token refresh, sign-out
  • Owned courses and completed lessons, real lesson videos, video progress heartbeat
  • Notifications, issue reports, profile and language updates

Blocked on the backend

  • About a third of new connections to the API time out; the app now times out after 12s, retries safe calls and shows a clear error instead of hanging
  • Not on the API yet: per-course prices and purchases, translations, categories, teacher, lesson durations, prerequisites, chapter quizzes

Checks: typecheck, domain + API mapping tests, i18n check pass.

Wires the student app to the Rezina Go API (https://api.rezina.yaltopia.com) behind the existing DataSource, so the screens are unchanged. Builds on the course-experience polish PR. **Builds** - `app:build` bakes the API URL in; `vercel.json` now uses it, so a deploy talks to the real API with no dashboard settings. - `demo:build` (the hosted artifact demo) is unchanged and keeps demo data; its sandbox can't reach outside servers. **Tested against the live API (no sign-in)** - Catalog and course outlines: courses, chapters, lessons, lesson notes, covers - Free lessons play for anyone; a free course shows "Start lesson 1" instead of a disabled buy button **Built from the spec, pending a working account** - Sign-in (phone code, email + password), token refresh, sign-out - Owned courses and completed lessons, real lesson videos, video progress heartbeat - Notifications, issue reports, profile and language updates **Blocked on the backend** - About a third of new connections to the API time out; the app now times out after 12s, retries safe calls and shows a clear error instead of hanging - Not on the API yet: per-course prices and purchases, translations, categories, teacher, lesson durations, prerequisites, chapter quizzes Checks: typecheck, domain + API mapping tests, i18n check pass.
naol-yaltopia added 3 commits 2026-11-03 16:56:12 +03:00
ApiDataSource maps the Go API onto the existing DataSource, so the screens are unchanged.
Build with NEXT_PUBLIC_LMS_API=https://api.rezina.yaltopia.com to use it; without it the
demo keeps its own data.

Verified against the live API (public, no sign-in):
- catalog and course outlines: courses, chapters, lessons, lesson notes, covers
- FREE lessons (and every lesson of a FREE course) play for anyone; a free course offers
  "Start lesson 1" instead of a disabled buy button

Built from the spec, not yet tested with a real account:
- sign-in: phone code (login or register) and email + password, token refresh, sign-out
- profile, progress summary (owned courses, completed lessons), lesson video URLs
- video heartbeat, notifications (list, read/unread), issue reports, profile updates

Not on the API yet, so left on hold: per-course prices and purchases (buying shows the
"not connected" message), translations, categories, teacher, durations, prerequisites,
chapter quizzes, Google/Apple sign-in.

Screens now hide what a course doesn't have instead of showing it empty: category pill,
teacher line and creator row, "0 min" durations, an empty card footer. Lessons with a
Vimeo link play that video; the sample clip and "mark as watched" stay for lessons
without one.

Mapping checks (packages/data/src/api.check.ts) run in `pnpm test` against saved live
responses.
About a third of new connections to api.rezina.yaltopia.com never complete (the TCP
connect hangs; requests that do connect answer in ~0.5s). With no timeout, sign-in sat
on a busy button forever.

- every API call gives up after 12s
- calls that are safe to repeat retry twice: reads, the account lookup, password login;
  sending or verifying a code never retries, so nobody gets two texts or burns a code
- the catalog keeps at most 3 requests in flight instead of firing one per course at once
- sign-in shows "Couldn't reach the server. Check your connection and try again."
  (auth.networkError, om/ti drafts) instead of hanging
- new `app:build` script bakes NEXT_PUBLIC_LMS_API=https://api.rezina.yaltopia.com into
  the student app; the URL lives in package.json, so nobody sets it by hand
- vercel.json runs `app:build`, so a deploy of this branch talks to the API with no
  dashboard settings
- `demo:build` (the hosted artifact demo) is unchanged and keeps demo data: its sandbox
  blocks calls to outside servers (artifact check: no network attempts)
- README: Vercel section updated, including how to build the old in-memory demo
naol-yaltopia added 1 commit 2026-11-03 16:57:15 +03:00
naol-yaltopia merged commit 1028caf109 into main 2026-11-03 16:57:59 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: RezinaLMS/RezinaLMS-CustomerEnd#5
No description provided.