๐ 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
- Download the lab v7 folder (or the zipped file).
- Unzip if needed โ you should see
index.htmlat the top level, plus foldersassets,subjects,tools,teacher,student,parent,admin,community,gamification,docs.
Step B โ Push to GitHub
Via website (no CLI needed):
- Sign in at github.com โ click + (top-right) โ New repository.
- Name it e.g.
virtuallab. Set Public. Click Create repository. - On the empty page click uploading an existing file.
- Drag the contents of lab v7 (open the folder first and select everything inside) into the upload box.
- 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)
- Go to pages.cloudflare.com โ Create a project โ Connect to Git.
- Choose GitHub, authorise Cloudflare, pick your
virtuallabrepository. - Build settings:
- Framework preset: None
- Build command: (leave empty)
- Build output directory: /
- Click Save and Deploy. Wait ~30 seconds.
- Site live at
https://<project-name>.pages.dev.
Step C2 โ Vercel
- Go to vercel.com โ New Project โ import your GitHub repo.
- Framework Preset: Other. Leave build empty.
- Click Deploy. Live at
https://<project>.vercel.app.
Step C3 โ Netlify
- Go to app.netlify.com โ choose Import from Git โ pick the repo.
- Build command: leave blank. Publish directory: . (just a dot).
- Deploy site.
Step C4 โ GitHub Pages
- In your repo: Settings โ Pages (left sidebar).
- Source: Deploy from a branch. Branch: main, folder: / (root). Save.
- 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.