Skip to content

Make the React app the site root; remove home.html; fix dataset thumbnails#30

Merged
aperson30 merged 2 commits into
mainfrom
aditya/react-root-and-thumbnail-fix
Jun 20, 2026
Merged

Make the React app the site root; remove home.html; fix dataset thumbnails#30
aperson30 merged 2 commits into
mainfrom
aditya/react-root-and-thumbnail-fix

Conversation

@aperson30

@aperson30 aperson30 commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes the React SPA the main site (replacing the standalone home.html) and fixes the dataset thumbnails that were blank under the viewer's COEP header. Works with the existing README deploy steps — no nginx change required.

Changes

  • Remove the old public/home.html ("CT Finder" page).
  • Build now emits dist/home.html as a copy of dist/index.html — so whatever the server serves at the root (home.html or index.html) is the React app. This makes the React app the main page without touching nginx.
  • Redirect /home.html/ in the router so old bookmarks land on the app, not a blank route.
  • Fix dataset thumbnails — the React Preview fell back to a direct cross-origin HuggingFace image, which the site's Cross-Origin-Embedder-Policy: require-corp header blocks. Now the fallback goes through the same-origin /api/proxy-image proxy (the approach the old home.html used). Verified: direct HF → 302 redirect (blocked under COEP); proxy → 200 image/jpeg.

Deploy

Just the normal README steps — no extra/nginx/sudo work:

git pull
cd PanTS-Demo && npm run build      # now also writes dist/home.html = the React app
# restart gunicorn (per README)

After this, bodymaps.wse.jhu.edu/ serves the React app (Landing → Dataset → Upload → Viewer); the old page is gone.

Optional cleanup (not required): the committed deploy/nginx-bodymaps.conf serves index.html at the root directly; if/when applied, the home.html copy is just a harmless extra file.

Testing

  • tsc clean; build succeeds and emits dist/home.html identical to dist/index.html.
  • Thumbnail fix verified on /dashboard (loads via the proxy).

…taset thumbnails

- Remove public/home.html so the build serves only the React SPA. The committed
  nginx config (deploy/nginx-bodymaps.conf) serves dist/index.html at / with SPA
  fallback, so the React app becomes the main page and /home.html resolves to it too.
- Fix missing dataset thumbnails: route the HuggingFace fallback through the
  same-origin /api/proxy-image proxy instead of a direct cross-origin URL, which the
  viewer's COEP: require-corp header was blocking (verified: direct HF returns a 302
  redirect; the proxy returns a 200 image/jpeg).
…one)

The deploy only runs git pull -> npm run build -> restart gunicorn (no nginx step),
and the live server serves home.html at the root. So:
- build now copies dist/index.html -> dist/home.html, making home.html the React app.
  Whatever the server serves at / (home.html or index.html) is now the SPA, so the
  React app becomes the main page without any nginx/sudo change.
- add a /home.html -> / redirect route so old bookmarks land on the app, not a blank
  React route.
@aperson30 aperson30 merged commit 73f20f6 into main Jun 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant