HOWTO: Embed the search app in a static website - Green-Wood-Cemetery/burial-registry-search GitHub Wiki
The /build folder contains a precompiled version of the search application that can be added to a website as a static page or integrated with a PHP website by virtue of client-side rendering.
This means that all of the source code lives in JavaScript and CSS files referenced in a single HTML file that initializes the search application.
See:
- tutorial: https://davisonpro.dev/an-advanced-guide-on-how-to-setup-a-react-and-php/
- source code: https://github.com/Davisonpro/php-react-setup
Example:
<?php
...
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<title>Green-Wood Burial Registry</title>
<link href="/static/css/main.37159af9.css" rel="stylesheet">
</head>
<body>
<div id="app"></div>
<script type="text/javascript" src="/static/js/main.6141e78d.js"></script>
</body>
</html>If you update or modify any of the files in the /src or /public folder you'll need to rebuild the static assets in the /build folder.
To rebuild the application:
- install node & npm (installing nodejs and npm on a mac using homebrew)
- run
npm install - run
npm run build - run
npm run startto test locally