https://github.com/lessp/react-ml-minimal-ssr-fullstack
https://github.com/lessp/react-ml-minimal-ssr-fullstack
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lessp/react-ml-minimal-ssr-fullstack
- Owner: lessp
- Created: 2025-01-25T14:45:48.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-27T17:05:36.000Z (over 1 year ago)
- Last Synced: 2025-10-26T23:41:17.796Z (7 months ago)
- Language: Dune
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React - OCaml + MLX SSR Template
A minimal server-side rendering (SSR) and client-side hydration setup using OCaml with MLX.
## How it works
1. `public/index.html` contains our base template with static assets
2. Vite bundles this into `dist/index.html` with processed assets
3. `GenerateRootTemplate.ml` takes `dist/index.html` and creates a template function that preserves all assets:
```ocaml
let render content = "..." ^ content ^ "..."
```
## Development
```sh
bun install
dune pkg lock
bun run build
dune build
dune exec src/server/Main.exe
```