Jinaga runs both on the server and in the browser, so that it can exchange facts between the two. This starter kit uses Webpack to bundle both sides. It also demonstrates how to update a React user interface with Jinaga.
Find out more about Jinaga, Webpack, and React.
The easiest way to use this starter kit is to export it with Git.
git clone https://github.com/jinaga/starter-javascript-react.git myapplication
cd myapplication
rm -rf .gitOr go to the GitHub page and download the zip file. Once you have the code, run:
npm installJinaga saves its facts in PostgreSQL. The easiest way to start up a database is to use Docker.
docker run -d --name jinaga-postgres -p5432:5432 -e POSTGRES_PASSWORD=secretpw -e APP_USERNAME=dev -e APP_PASSWORD=devpw -e APP_DATABASE=myapplication jinaga/jinaga-postgres-fact-keystoreFor complete instructions, see Jinaga PostgreSQL Setup.
To run in development mode:
npm run devThis will watch the source code for changes and rebuild as necessary. It will restart the server to load those changes.
To build for release:
npm run buildThis creates a dist folder with the client-side code in scripts/main.js.
The server side code remains in src/server.
To run:
npm startBuild something incredible!