Basic template for a create-react-app to be used as a maana Q assistant.
- React App
- Maana Q Assistant Client npm library installed
.env
file with example variable printed in console (set inDockerfile
)Dockerfile
- nginx conf
- Build/Run/Watch scripts
- Gets the current workspace.
- Get the active graph from the workspace.
- Creates a Function.
- Adds the function as a node to the active graph in the workspace.
- Hooks
- useHooks.com - advanced React Hooks examples
- Environment variables
- React + TypeScript
- GraphQL Schema to TypeScript defitions
As with any Node application, you must first install dependencies:
# install dependencies
npm i
# start watch mode, server, and tunnel service
npm run start
npm run start
will log a URL to the console (your tunnel endpoint); copy this and register it with your instance of Q (see Registring a Custom Service).
Docker or local
- Docker:
# build docker image sh dockerBuild.sh # start image sh dockerRun.sh
- Local
npm run start
start
- starts all other processes for a single entrypoint for development
- runs:
watch
- build application and start watch mode; builds to
./build
- build application and start watch mode; builds to
serve
- runs a local web server to host
./build
- runs a local web server to host
tunnel
- opens a tunnel to your local web server
build
- builds a production version of the application; output directory:
./build
- builds a production version of the application; output directory:
test
- runs jest tests
eject
- (CAUTION) ejects from the
create-react-app
framework and toolset - This is only intended for advanced users; use at your own risk.
- more information:
- Official docs on the topic: https://create-react-app.dev/docs/available-scripts/#npm-run-eject
- Alternatives to ejecting: https://medium.com/curated-by-versett/dont-eject-your-create-react-app-b123c5247741
- (CAUTION) ejects from the
postinstall
- handles patching
react-scripts
with some small changes to the Webpack configuration to improve the developer experience
- handles patching