- Install bun: (install page) (alternatively, run as container below)
$ bun install$ bun run dev- Go to
http://localhost:7777 - Start editting
src/client/home/Home.page.tsx - Save file and refresh plage to see changes
This app is containerised for deployment. You can build and run the docker image locally if you like:
- Install Docker (install page)
$ docker build --tag 'bun-react-ssr' .$ docker run -p 8080:8080 'bun-react-ssr'- Go to
http://localhost:8080 - ...
src contains client, server and _common directories:
clientholds all react components, static assets and client-side entrypoint files.serverholds all server middleware, handlers, utils and main file with routes._commonholds shared data models.
The project utilises domain-driven-design architecture for clean organisation and scalability.
Bun.build is used to generate client-side assets and store in the dist/client folder.
You do not need to manually build, it happens automatically in dev mode and in docker build.
$ bun test to run unit and integration tests for client and server simulatenously.
Tests are run in a conventional CI process on PR open to main or commit/merge to main.
The provided tests include integration tests for frontend pages and unit tests for the backend. This is a good foundation but should be expanded with:
- integration tests for backend routes and handlers
- unit tests on the frontend utilities and UI snapshot testing.
- comprehensive E2E tests (Cypress, Playwright, etc)
Note: bun.d.ts extends the Matchers interface from "bun:test" to support @testing-library's matcher types in your IDE. It also adds content types for static assets and the __SERVER_PROPS__ property to the Window global. For custom testing, extended static file support or ssr modifications, you may need to update this file.
- A standardised UI component library (with storybooks to review)
- Analytics integration (cookie-based or via server endpoints)
- Redis middleware to cache page renders
- Authentication middleware or basic verification
- Postgres or other cloud database to persist user auth
- ML streaming middleware for reactive AI apps
- CD process (terraform etc) to deploy db, redis and containers
If you have any suggestions please create an issue! All feedback welcome ^^