This repository was archived by the owner on Aug 3, 2023. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork15
A demo project that shows a fullstack ReasonML/OCaml app–native binary + webapp
License
NotificationsYou must be signed in to change notification settings
yawaramin/fullstack-reason
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project shows a minimal fullstackReasonML application. It has a
- Backend web server that compiles to a native binary using the Esy/dunecompilation toolchain
- Frontend ReasonReact component that compiles to JavaScript using theBuckleScript toolchain
- Shared business logic used by both of the above
This is a proof-of-concept; you can customize it to your needs.
Follow these steps:
- InstallNodeJS (one-time setup)
- Install Esy (one-time setup):
npm install --global esy@latest - Set up the backend project:
esy install(one-time setup but willtake a while to compile dependencies like SSL so grab your favouritebeverage) - Run
npm install(or usepnpm to save somedisk space) - Run the services defined in
Procfileeither manually on differentterminals, or using a process manager like Foreman/Overmind/Hivemind - Browse the frontend:http://localhost:5200/
You can also try out the app without the Webpack dev server:
- Assuming the above builds have already been done
- Put production assets in the
distdirectory:npm run dist - Run the backend app:
esy b dune exec backend/App.exe - Browse the frontend (note, different port than above, this is beingserved directly from the backend app):http://localhost:8080/
Correctly caches the JS bundle–with cache busting!
This project pulls together:
- A working setup of theReWebReason/OCaml native web framework
- AReasonReact frontend app,using theBuckleScript OCaml-to-JScompiler
These are the significant parts of the project:
backend/: contains the sources for the backend executableesy.lock/: a lock directory used by Esy to capture precise dependencyinformationfrontend/: contains the sources for the frontend ReasonReact appshared/: contains sources shared between the backend and frontendbsconfig.json: BuckleScript project configurationdune-project:Dune project configuration (forthe native build)esy.json: Esy project configuration (native package management)fullstack-reason.opam:OPAM projectconfiguration (empty but needed for backward-compatibility with OPAM)package.json:Npm project configurationwebpack.config.js:Webpack bundlerconfiguration for the frontend
Honourable mention: build outputs are in the.gitignore.
About
A demo project that shows a fullstack ReasonML/OCaml app–native binary + webapp
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.