Simplify SSR setup#1063
Conversation
veenupunyani
commented
May 27, 2026
- Replace SSR setup with a client-side Vite React app and simplify runtime server.
- Removed server-side entry and SSR rendering, renamed client entry to main.tsx using createRoot, and updated index.html to remove SSR outlet.
- package.json scripts now use vite for dev and build.
- server.js simplified to a static file server that serves dist files and exposes /config/runtime-config.json.
- Dockerfile and compose.yaml adjusted to run the frontend image (added appointment-booking service in compose, exposed port 5173, and updated Postgres image/ports).
- Documentation updated across README files to document the new React Vite app and dev/run instructions.
Replace SSR setup with a client-side Vite React app and simplify runtime server. Removed server-side entry and SSR rendering, renamed client entry to main.tsx using createRoot, and updated index.html to remove SSR outlet. package.json scripts now use vite for dev and build. server.js simplified to a static file server that serves dist files and exposes /config/runtime-config.json. Dockerfile and compose.yaml adjusted to run the frontend image (added appointment-booking service in compose, exposed port 5173, and updated Postgres image/ports). Documentation updated across README files to document the new React Vite app and dev/run instructions.
chrsamp
left a comment
There was a problem hiding this comment.
@veenupunyani, all the changes to remove SSR and switch to client-side rendering look good to me.
Now that SSR has been removed, server.js is only doing static file serving plus the config JSON endpoint. I don’t think we should be writing a custom Node HTTP server for that: it's a change from our existing nginx frontend pattern and isn't something we'd want in production.
Can we switch this to just build the Vite app and serve dist/ from nginx, as we do with the current Q frontend and appointment-frontend? If the runtime config is still required, let’s solve that explicitly with a generated/static config file as we currently do for both apps.
@josekudiyirippil should be able to help with the nginx Dockerfile, it's the same model we have for both frontends. That will also simplify his work going forward.
Suggested changes:
- Remove
server.jsentirely in favour of using nginx to serve the client build from/dist - The static assets in
src/assets/imgare not being imported now that we are using the BCGov components and can be removed from the repo. ci_output.txtshould be removed and added to.gitignore.- Fix small typo on line 32 of README.md ("developement")
Switch to nginx and serve built assets statically. Added nginx.conf and public/config/runtime-config.json, removed the custom Node server and in-image logos, and updated Dockerfile to copy dist into /app and run nginx on 8080. Updated package.json preview script to use vite preview, adjusted docker compose port mapping (5173:8080) and README instructions, and added ci_output.txt to .gitignore while deleting the file. Also expanded local CORS origins in api/config.py to include Vite ports 5173/5174.
|
chrsamp
left a comment
There was a problem hiding this comment.
Looks good, thanks @veenupunyani!
FWIW, I know the existing app is also on nginx:1.25.3 and I get why we're also pinning that version, but we'll want to update this in a future sprint (it's way out of date). I've built and run the container, and both local dev and the Docker image are working locally, so I'll go ahead and merge.


