All Projects → yawaramin → Fullstack Reason

yawaramin / Fullstack Reason

Licence: mit
A demo project that shows a fullstack ReasonML/OCaml app–native binary + webapp

Programming Languages

ocaml
1615 projects
reason
219 projects
bucklescript
41 projects

Projects that are alternatives of or similar to Fullstack Reason

Brisk Reconciler
React.js-like reconciler implemented in OCaml/Reason
Stars: ✭ 124 (-24.39%)
Mutual labels:  reason-react, reasonml
Reroute
a fast, declarative microrouter for reason-react
Stars: ✭ 120 (-26.83%)
Mutual labels:  reason-react, reasonml
Rescript React Native
ReScript bindings for React Native
Stars: ✭ 802 (+389.02%)
Mutual labels:  reason-react, reasonml
Reason Calculator
A calculator built with Reason and reason-react.
Stars: ✭ 110 (-32.93%)
Mutual labels:  reason-react, reasonml
Introduce Reason Example
An example app made with Create React App which introduces a Reason component
Stars: ✭ 82 (-50%)
Mutual labels:  reason-react, reasonml
Reductive
Redux in Reason
Stars: ✭ 405 (+146.95%)
Mutual labels:  reason-react, reasonml
Verified React
Automated reasoning for React/ReasonML
Stars: ✭ 104 (-36.59%)
Mutual labels:  reason-react, reasonml
rescript-react-compat
An alternative upgrade path for ReasonReact
Stars: ✭ 17 (-89.63%)
Mutual labels:  reasonml, reason-react
Rescript React Update
useReducer with updates and side effects!
Stars: ✭ 79 (-51.83%)
Mutual labels:  reason-react, reasonml
Recontainers
[DEPRECATED] ReasonReact utilitary high order components
Stars: ✭ 54 (-67.07%)
Mutual labels:  reason-react, reasonml
Isolate
Lightweight image browser
Stars: ✭ 284 (+73.17%)
Mutual labels:  reason-react, reasonml
Rescript Recoil
Zero-cost bindings to Facebook's Recoil library
Stars: ✭ 115 (-29.88%)
Mutual labels:  reason-react, reasonml
React Recomponent
🥫 Reason-style reducer components for React using ES6 classes.
Stars: ✭ 272 (+65.85%)
Mutual labels:  reason-react, reasonml
Reason React Hacker News
hacker news mobile app made with reason react
Stars: ✭ 591 (+260.37%)
Mutual labels:  reason-react, reasonml
bs-react-native-vector-icons
ReasonML bindings for react-native-vector-icons
Stars: ✭ 16 (-90.24%)
Mutual labels:  reasonml, reason-react
Cra Template Rescript Lukin
🐪 Lukin CRA and ReScript Template
Stars: ✭ 18 (-89.02%)
Mutual labels:  reason-react, reasonml
bs-react-is-visible
A small library that lets you know whether a component is visible on screen or not.
Stars: ✭ 15 (-90.85%)
Mutual labels:  reasonml, reason-react
credt
CRDT-like data structures for building distributed, offline-first applications
Stars: ✭ 32 (-80.49%)
Mutual labels:  reasonml, reason-react
Pragma
Pragma is a self-hosted, open-source, personal note taking app.
Stars: ✭ 39 (-76.22%)
Mutual labels:  reason-react, reasonml
Timerlab
⏰ A simple and customizable timer
Stars: ✭ 84 (-48.78%)
Mutual labels:  reason-react, reasonml

Fullstack Reason Demo

This project shows a minimal fullstack ReasonML application. It has a

  • Backend web server that compiles to a native binary using the Esy/dune compilation toolchain
  • Frontend ReasonReact component that compiles to JavaScript using the BuckleScript toolchain
  • Shared business logic used by both of the above

This is a proof-of-concept; you can customize it to your needs.

Try it out

Development mode

Follow these steps:

  1. Install NodeJS (one-time setup)
  2. Install Esy (one-time setup): npm install --global [email protected]
  3. Set up the backend project: esy install (one-time setup but will take a while to compile dependencies like SSL so grab your favourite beverage)
  4. Run npm install (or use pnpm to save some disk space)
  5. Run the services defined in Procfile either manually on different terminals, or using a process manager like Foreman/Overmind/Hivemind
  6. Browse the frontend: http://localhost:5200/

Production mode

You can also try out the app without the Webpack dev server:

  1. Assuming the above builds have already been done
  2. Put production assets in the dist directory: npm run dist
  3. Run the backend app: esy b dune exec backend/App.exe
  4. Browse the frontend (note, different port than above, this is being served directly from the backend app): http://localhost:8080/

Correctly caches the JS bundle–with cache busting!

How it works

This project pulls together:

Project layout

These are the significant parts of the project:

  • backend/: contains the sources for the backend executable
  • esy.lock/: a lock directory used by Esy to capture precise dependency information
  • frontend/: contains the sources for the frontend ReasonReact app
  • shared/: contains sources shared between the backend and frontend
  • bsconfig.json: BuckleScript project configuration
  • dune-project: Dune project configuration (for the native build)
  • esy.json: Esy project configuration (native package management)
  • fullstack-reason.opam: OPAM project configuration (empty but needed for backward-compatibility with OPAM)
  • package.json: Npm project configuration
  • webpack.config.js: Webpack bundler configuration for the frontend

Honourable mention: build outputs are in the .gitignore.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].