RezinaLMS-CustomerEnd/apps/demo/app/page.tsx
n3p-tun3 9ccd21584f fix(build): use the real API by default so the CI build works
The CI server runs a plain `next build` in apps/demo; it never reads vercel.json, so
`app:build` and its API URL were skipped. With no URL the app fell back to the demo data
source, which only works inside the hosted artifact sandbox, and rezina.yaltopia.com
showed "0 courses".

- the API URL is now the default in apps/demo/app/page.tsx; any plain build uses it
- NEXT_PUBLIC_LMS_API still overrides it (e.g. staging); set empty, it keeps demo data
- `demo:build` sets it empty: the artifact sandbox can't reach outside servers
  (artifact check: no network attempts)
- `app:build` is now just the plain build; README updated
2026-11-03 17:35:11 +03:00

15 lines
708 B
TypeScript

'use client';
import { ApiDataSource, ClaudeDbDataSource } from '@lms/data';
import { Platform } from '@lms/features';
// Any plain build (`next build`, as the CI server runs it) talks to the real API.
// The hosted artifact demo opts out by building with NEXT_PUBLIC_LMS_API set to an empty value (`demo:build`):
// its sandbox can't reach outside servers, so it keeps its own data. Another API (e.g. staging) is a different value.
const DEFAULT_API = 'https://api.rezina.yaltopia.com';
const API = process.env.NEXT_PUBLIC_LMS_API ?? DEFAULT_API;
const makeDs = () => (API ? new ApiDataSource(API) : new ClaudeDbDataSource());
export default function Page() {
return <Platform dataSource={makeDs} />;
}