From a5890623c40f8a00e508a40d1df409fa89de27ea Mon Sep 17 00:00:00 2001 From: Shahidh K Muhammed Date: Tue, 19 Mar 2019 10:42:50 +0530 Subject: [PATCH] specify needed node version, clarify setup instructions (close #1754) (#1815) --- console/README.md | 2 +- server/CONTRIBUTING.md | 43 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/console/README.md b/console/README.md index e2f4a69c206..4bf9c56557f 100644 --- a/console/README.md +++ b/console/README.md @@ -69,7 +69,7 @@ Environment variables accepted in `server` mode: 5. `CONSOLE_MODE`: `server` 6. `URL_PREFIX`: `/` (forward slash) -> The server also templates `consolePath` in `window.__env` which is the relative path of the current page (something like `/console/data/schema/public`). Using this path, the console determines the DATA_API_URL. You do not need to worry about this in development since you are hardcoding the value of DATA_API_URL in `.env`. +> The server also templates `consolePath` in `window.__env` which is the relative path of the current page (something like `/console/data/schema/public`). Using this path, the console determines the DATA_API_URL. You do not need to worry about this in development since you are hardcoding the value of DATA_API_URL in `.env`. #### Run Development Server: diff --git a/server/CONTRIBUTING.md b/server/CONTRIBUTING.md index 2af167ee250..48a93930812 100644 --- a/server/CONTRIBUTING.md +++ b/server/CONTRIBUTING.md @@ -8,8 +8,26 @@ own machine and how to contribute. - [stack](https://docs.haskellstack.org/en/stable/README/#how-to-install) - A Postgres server (Recommended: Use docker to run a local postgres instance) - GNU Make (optional) -- npm +- [Node.js](https://nodejs.org/en/) (v8.9+) - libpq-dev +- psql +- python >= 3.7 with pip3 + +## Upgrading npm + +If your npm is too old (< 5.7), + +npm install -g npm@latest + +or + +sudo npm install -g npm@latest + +or update your nodejs + +## Getting pip3 + +sudo apt install python3-pip ## Development workflow @@ -36,6 +54,29 @@ own machine and how to contribute. - Create a database on postgres - Run the binary: `stack exec graphql-engine -- --database-url= serve` +database url looks like: `postgres://:@:/` + +### Running Postgres + +The easiest way is to run docker in a container + +```` +docker run -p 5432:5432 -d postgres:11.1 +```` + +Test if it's running by + +telnet localhost 5432 + +### psql + +You will need psql or another client + +```` +sudo apt install postgresql-client +```` + + ### Work - Work on the feature/fix - Add test cases if relevant