# ConnectPoint Learning deployment pack

The current private prototype is the test environment. The live environment is intended for `https://learning.connectpoint.net`.

## Environment separation

- Test uses `APP_ENV=test`, a test D1 database and a test R2 bucket.
- Live uses `APP_ENV=production`, a dedicated production D1 database and a dedicated production R2 bucket.
- Never reuse database IDs, bucket names, owner accounts or secrets between environments.

## Recommended live deployment

Deploy the live build as a separate OpenAI Site and attach `learning.connectpoint.net` as its custom domain. This preserves the managed sign-in and server identity headers used by the application.

Do not upload `dist` to ordinary static hosting. ConnectPoint includes server routes, authentication, persistent database records and uploaded-file storage, so it requires a Cloudflare Worker-compatible runtime.

## Live release sequence

1. Create a separate live Sites project.
2. Set `APP_ENV=production`.
3. Provision a live D1 binding named `DB`.
4. Provision a live R2 binding named `EVIDENCE_BUCKET`.
5. Apply every SQL file under `drizzle` in filename order.
6. Deploy the validated release archive.
7. Attach `learning.connectpoint.net`.
8. Add the DNS validation records supplied by the hosting platform.
9. Verify sign-in, roles, uploads, SCORM, reporting and exports before inviting real users.

Keep the live domain private until the production owner account and access policy have been verified.
