JNM HOME EDUCATION PROGRAM — PRIVATE STAGING SETUP

PURPOSE
This is a separate server-test release. Keep the current local installation as
your rollback copy. Parent Preview Sandbox is disabled in this release.

DATABASE PREPARATION
1. Back up the current working PostgreSQL database.
2. Create a separate PostgreSQL database for the private test subdomain.
3. Restore the current database backup into that staging database. This keeps
   the complete curriculum and course structure.
4. Point backend/.env to the staging database only.
5. From the backend folder, run this one-time reset:

   PowerShell:
   $env:CONFIRM_STAGING_RESET="RESET_JNM_STAGING"
   npm run reset:staging
   Remove-Item Env:CONFIRM_STAGING_RESET

   Linux/VPS:
   CONFIRM_STAGING_RESET=RESET_JNM_STAGING npm run reset:staging

The reset removes parent accounts, students, submissions, grades, attendance,
hours, certificates, sessions, and menu settings through the student records.
It preserves curriculum courses, units, lessons, assignments, and videos.

BACKEND
1. Upload the contents of JNM_STAGING_BACKEND.zip to the Node application folder.
2. Copy .env.example to .env and enter the staging database, JWT secret, and
   exact HTTPS frontend origin.
3. Run: npm install --omit=dev
4. Run: npm start
5. Confirm: https://YOUR-SUBDOMAIN/api/health (or the host's Node health URL).

FRONTEND
Option A (recommended): upload the contents of the included build folder to the
subdomain document root.
Option B: copy .env.staging.example to .env.staging, set REACT_APP_API_URL,
then run npm install and npm run build; upload the resulting build contents.

FIRST REAL ACCOUNTS
1. Open Parent / Teacher and choose Create Parent / Teacher Account.
2. Create the real parent account email and password.
3. Open Manage Students and create each student.
4. Student IDs must be JNM-005, JNM-006, JNM-007, and so on.
5. Give each student an initial password of at least eight characters.
6. Students sign in with Student ID + password.
7. A student changes their own password in Help & Support.
8. If forgotten, the parent uses Manage Students > Set Password.

PRIVACY
robots.txt, the noindex meta tag, and the X-Robots-Tag rule are included.
Also password-protect the private subdomain at the hosting control-panel level
until the pilot is approved.

IMPORTANT
Never run reset:staging against the current working database or a live family
database. The command refuses to run unless the confirmation variable is set.
