๐Ÿซ HMG Concepts Ecosystem โ€” Built by Adewale Samson Adeagbo ยท HMG Academy ยท Lagos, Nigeria ยท v7 ๐Ÿ”ฌ Equipment ๐ŸŽ’ Student ๐Ÿ‘ฉโ€๐Ÿซ Teacher

๐Ÿš€ Deployment Guide (v7)

Clear, unambiguous step-by-step instructions for taking the lab live.

What you need

  • A free GitHub account: github.com/signup
  • Any of: Cloudflare Pages ยท Vercel ยท Netlify ยท GitHub Pages (all free)
  • A modern browser

Step A โ€” Get the files

  1. Download the lab v7 folder (or the zipped file).
  2. Unzip if needed โ€” you should see index.html at the top level, plus folders assets, subjects, tools, teacher, student, parent, admin, community, gamification, docs.

Step B โ€” Push to GitHub

Via website (no CLI needed):

  1. Sign in at github.com โ†’ click + (top-right) โ†’ New repository.
  2. Name it e.g. virtuallab. Set Public. Click Create repository.
  3. On the empty page click uploading an existing file.
  4. Drag the contents of lab v7 (open the folder first and select everything inside) into the upload box.
  5. Scroll down. Commit message: Initial v7 upload. Click Commit changes.

Via Git CLI:

cd "lab v7"
git init
git add .
git commit -m "Initial v7 upload"
git branch -M main
git remote add origin https://github.com/<USERNAME>/virtuallab.git
git push -u origin main

Step C1 โ€” Cloudflare Pages (recommended, ~60 s)

  1. Go to pages.cloudflare.com โ†’ Create a project โ†’ Connect to Git.
  2. Choose GitHub, authorise Cloudflare, pick your virtuallab repository.
  3. Build settings:
    • Framework preset: None
    • Build command: (leave empty)
    • Build output directory: /
  4. Click Save and Deploy. Wait ~30 seconds.
  5. Site live at https://<project-name>.pages.dev.

Step C2 โ€” Vercel

  1. Go to vercel.com โ†’ New Project โ†’ import your GitHub repo.
  2. Framework Preset: Other. Leave build empty.
  3. Click Deploy. Live at https://<project>.vercel.app.

Step C3 โ€” Netlify

  1. Go to app.netlify.com โ†’ choose Import from Git โ†’ pick the repo.
  2. Build command: leave blank. Publish directory: . (just a dot).
  3. Deploy site.

Step C4 โ€” GitHub Pages

  1. In your repo: Settings โ†’ Pages (left sidebar).
  2. Source: Deploy from a branch. Branch: main, folder: / (root). Save.
  3. Refresh after ~1 minute. Site is at https://<USERNAME>.github.io/virtuallab/.

Step D โ€” Verify it works

Open these URLs (replace the domain with yours):

  • / โ€” homepage with hero apparatus preview
  • /tools/equipment.html โ€” 36-piece Equipment Gallery
  • /subjects/physics/index.html โ€” Physics hub (25 sims)
  • /subjects/physics/pendulum.html โ€” pendulum runs
  • /subjects/biology/heart-circulation.html โ€” animated heart
  • /tools/periodic-table.html โ€” 118 elements
  • /teacher/dashboard.html โ€” teacher dashboard
  • /admin/index.html โ€” school admin dashboard

Step E โ€” Custom domain (optional)

In Cloudflare Pages (or Vercel / Netlify): Custom domain โ†’ enter your domain (e.g. lab.hmgacademy.com) and follow the DNS instructions. Free SSL.

Step F โ€” Run locally (no internet)

cd "lab v7"
python3 -m http.server 8000
# Visit http://localhost:8000

Step G โ€” Install as a phone app (PWA)

Open the deployed site in Chrome on Android (or Safari iOS) โ†’ menu โ†’ Install app / Add to Home Screen. The lab runs offline afterwards.

Troubleshooting

  • Blank page after deploy โ€” files uploaded inside an extra folder. Re-upload from inside lab v7.
  • Equipment gallery shows nothing โ€” check the browser console (F12) for failed loads of assets/js/lab-equipment.js.
  • Quiz says "Quiz coming" โ€” quizzes are added to the SW cache after first reload; refresh once.
  • Service Worker errors on subdirectory deploys โ€” GitHub Pages serves under /repo-name/; that's normal. Hard-refresh (Ctrl+F5) once.
  • Lost local data โ€” LocalStorage is per browser/device. Always back up via the Admin/Teacher dashboard.