Search code examples
react-adminstatic-site

Can react-admin be deployed as a static site?


I wish to deploy a react-admin application as a static site - running without a server component. This data browsing app would use the ra-data-fakerest on a read-only slug of JSON.

Examples of deploying this would be to a GitHub Pages site, or a dumb memory stick.

Since react-admin is written in React/Typescript it must get trans-piled before running, presumably into a build folder. So, am I right in thinking I could just deploy the build folder?

(also grateful for any lessons-learned on this subject).


Solution

  • Yes, you absolutely can. The react-admin demo (https://marmelab.com/react-admin-demo/) is indeed a static site. What is deployed is just the built version of https://github.com/marmelab/react-admin/tree/master/examples/demo.

    The react-admin codesandbox is another example of that: https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/simple