This is a basic app that shows you how you can use Auth0 authentication with Reason and Reason React. The app uses the Auth0 react component and has bindings to the component. The project uses Melange to transform the Reason code to JS.
This project is deployed at: https://reason-auth.netlify.app/
An accompanying blog post about using auth and 3rd party react components with ReasonReact can be found here
make init
# In separate terminals:
make watch
make dev
React support is provided by reason-react
. The entry point of the app is src/Index.re
.
_build/default/src/output/src/Index.js
in index.html
is used as the entry point for Vite.
You can see all available commands by running make help
or just make
. Here
are a few of the most useful ones:
make init
: set up opam local switch and download OCaml, Melange and JavaScript dependenciesmake install
: install OCaml, Melange and JavaScript dependenciesmake watch
: watch for the filesystem and have Melange rebuild on every changemake dev
: serve the JS application with a local HTTP servermake bundle
: create production build of appmake preview
: serve the production build of the JS application with a local HTTP server
/
├── _build/
├── public/
│ ├── index.css
│ └── ...
├── src/
│ ├── dune
│ ├── bindings/
│ │ ├── auth0.re
│ │ └── dune
│ ├── Index.re
│ ├── Index.rei
│ └── ...
├── index.html
├── package.json
├── tailwind.config.js
├── <project_name>.opam
├── dune
├── dune-project
└── Makefile