node-frontend
v1.0.0
Published
A React application to showcase rendering with Universal JavaScript
Downloads
3
Readme
React frontend for GovAU health project
Description
This is the proposed front-end for the new (two-stack-cms) medicare website. The current spike uses Apollo with GraphQl to connect to Druapl and grab all the contents available
Pre Requisite
- Yarn or Npm
- Node
Getting Started
- Clone front-end repo locally.
git clone [email protected]:govau-health/health-gov-frontend.git
cd health-gov-frontend
- Install dependencies.
yarn install
or
npm install
Change app env variable
The application configuration is based on dotenv node module Docs here
Set the GraphQl endpoint in
.env
file. To set it locally either point it to your local graphQl instance or the staging environment. FYI: This is set as an environment variable in Pivotal.
Environment Variables
| Variable | Description |
|--------------------------|----------------------------------------------|
| DRUPAL_GRAPHQL_API_URL
| Location of the graphQL endpoint for the CMS |
4 A. Run build in dev mode with universal rendering
yarn start:dev:universal
or
npm run start:dev:universal
Point your browser to [http://localhost:3000](http://localhost:3000)
All scripts
|npm run or yarn <script>
|Description|
|--------------------------|-----------|
|start
|Run your app in production mode with universal rendering.|
|start:dev:universal
|Run your app in development mode with universal rendering with server auto restarting when file change.|
|start:dev
|Run your app in development mode without universal rendering with webpack hot server auto restarting when file change.|
|build
|Compiles the application to the corresponding folder(server/ and server/static) in production mode.|
|build:dev
|Compiles the application to the corresponding folder(server/ and server/static) in dev mode.|
|test
|Runs unit tests with Jest.|
|lint
|Check for lint errors and runs for all .js
and .jsx
files.|
|lint:fix
|Check and fix for lint errors.|
Deployment to Production
TBC
License
This source code is licensed under the MIT license.