This project shows a minimal fullstack ReasonML application. It has a
The GraphQL plug logic can be found at https://github.com/fakenickels/reweb-graphql-fullstack/blob/master/backend/Graphql_reweb.re.
This is a proof-of-concept; you can customize it to your needs.
At the moment unfortunately the backend may not work on Windows due to an issue with a dependency. I am trying to resolve it.
Follow these steps:
npm install --global esy@latest
docker run -e POSTGRES_DB=reweb -p 6666:5432 -d --rm --name postgres postgres:latest
esy install
(one-time setup but will
take a while to compile dependencies like SSL so grab your favourite
beverage)esy b dune exec backend/App.exe
npm install
(or use pnpm to save some disk space)
b. npx bsb -clean-world
c. npx bsb -make-world
npm run server
You can also try out the app without the Webpack dev server:
build
directory:
npm run webpack:production
esy b dune exec backend/App.exe
Correctly caches the JS bundle–with cache busting!
This project pulls together:
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 dependency
informationfrontend/
: contains the sources for the frontend ReasonReact appshared/
: contains sources shared between the backend and frontendbsconfig.json
: BuckleScript project configurationdune-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 configurationwebpack.config.js
: Webpack bundler
configuration for the frontendHonourable mention: build outputs are in the .gitignore
.