A very simple implementation of React side-by-side with Express and GraphQL. I have also added react-router-dom to make it clear that only certain paths actually get data from the server, but they are still seved on the same port and running as one application.
After cloning the project, cd into it and install all the required node packages:
yarn install
The app is setup to use postgresql, this can be changed by updating the config file in api/config/database.dev.js (knex config). You will need to create a .env file with the following content in it:
EASY_ENV=dev // this will determine if your working with dev or prod
DB_HOST=somedatabase.somehost.com
DB_PORT=5432
DB_USER=myusername
DB_PASSWORD=myseupersecretpassword
DB_DATABASE=mydatabasename
Once all the packages have installed succesfuly and you have setup your .env file simply start the project:
yarn start
- Make sure the port number in server.js matches the proxy address and port in package.json. Its running on port 3001 by default.