From 40f7b31ecc739058b9eac06fb52b742e05f632d3 Mon Sep 17 00:00:00 2001 From: rashadg1030 Date: Tue, 2 Jul 2019 16:19:31 -0700 Subject: [PATCH 1/5] [#81] Update docs Resolves #81 --- README.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0643380..4581f0d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,45 @@ encourage more programmers to become a part of the Haskell community. ## Prerequisites (what you need to have locally) -Coming Soon +For the project to build, you will need to have `libpq-dev` installed on you computer. You can install it by running the command `apt install libpq-dev`. + +You will also need to setup Postgres on your computer. Here are the instructions for doing so: + +Run the folowing commands with `` replaced by a username of your choice. + +``` +$ sudo apt install postgresql postgresql-contrib +$ sudo service postgres start +$ sudo -u postgres psql +postgres=# create database "issue-wanted"; +postgres=# create user ; +postgres=# grant all privileges on database "issue-wanted" to ; +``` + +Modify the [`pg_hba.conf`](https://dba.stackexchange.com/questions/101280/how-to-handle-user-with-no-password-in-postgresql) file with the following lines. + +``` +local all trust +host all 0.0.0.0/0 trust +``` + +Where `` is the same one you used above. + +Next, in the `config.toml` file in the repository update the line `user=` with the `` from above. + +Add the line `listen_address = '127.0.0.1'` to the `/etc/postgresql/10/main/postgresql.conf` file. + +Finally, restart the database and intitalize it with the following commands. + +``` +$ sudo service postgres restart +$ psql issue-wanted < sql/schema.sql +$ psql issue-wanted < sql/seed.sql +``` + +Follow the instructions under `How to run server` and test the endpoints to see if everything is set up correctly. + +Refer to issue [#81](https://github.com/kowainik/issue-wanted/issues/81) if you're still having trouble. ## How to build From 25bcbcfa1d7f26a9c7091cb09b687a1f8bfa552a Mon Sep 17 00:00:00 2001 From: rashadg1030 Date: Tue, 2 Jul 2019 16:24:22 -0700 Subject: [PATCH 2/5] Fix after review --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 4581f0d..e919b17 100644 --- a/README.md +++ b/README.md @@ -13,41 +13,41 @@ encourage more programmers to become a part of the Haskell community. ## Prerequisites (what you need to have locally) -For the project to build, you will need to have `libpq-dev` installed on you computer. You can install it by running the command `apt install libpq-dev`. +For the project to build, you will need to have `libpq-dev` installed on you computer. You can install it by running the command `sudo apt install libpq-dev`. You will also need to setup Postgres on your computer. Here are the instructions for doing so: -Run the folowing commands with `` replaced by a username of your choice. +1. Run the folowing commands with `` replaced by a username of your choice. -``` -$ sudo apt install postgresql postgresql-contrib -$ sudo service postgres start -$ sudo -u postgres psql -postgres=# create database "issue-wanted"; -postgres=# create user ; -postgres=# grant all privileges on database "issue-wanted" to ; -``` + ``` + $ sudo apt install postgresql postgresql-contrib + $ sudo service postgres start + $ sudo -u postgres psql + postgres=# create database "issue-wanted"; + postgres=# create user ; + postgres=# grant all privileges on database "issue-wanted" to ; + ``` -Modify the [`pg_hba.conf`](https://dba.stackexchange.com/questions/101280/how-to-handle-user-with-no-password-in-postgresql) file with the following lines. +2. Modify the [`pg_hba.conf`](https://dba.stackexchange.com/questions/101280/how-to-handle-user-with-no-password-in-postgresql) file with the following lines. -``` -local all trust -host all 0.0.0.0/0 trust -``` + ``` + local all trust + host all 0.0.0.0/0 trust + ``` -Where `` is the same one you used above. + Where `` is the same one you used above. -Next, in the `config.toml` file in the repository update the line `user=` with the `` from above. +3. Next, in the `config.toml` file in the repository update the line `user=` with the `` from above. -Add the line `listen_address = '127.0.0.1'` to the `/etc/postgresql/10/main/postgresql.conf` file. +4. Add the line `listen_address = '127.0.0.1'` to the `/etc/postgresql/10/main/postgresql.conf` file. -Finally, restart the database and intitalize it with the following commands. +5. Finally, restart the database and intitalize it with the following commands. -``` -$ sudo service postgres restart -$ psql issue-wanted < sql/schema.sql -$ psql issue-wanted < sql/seed.sql -``` + ``` + $ sudo service postgres restart + $ psql issue-wanted < sql/schema.sql + $ psql issue-wanted < sql/seed.sql + ``` Follow the instructions under `How to run server` and test the endpoints to see if everything is set up correctly. From 158cb7f9b705a74368671a58f98c524624000d0e Mon Sep 17 00:00:00 2001 From: rashadg1030 Date: Tue, 2 Jul 2019 16:26:14 -0700 Subject: [PATCH 3/5] Fix after review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e919b17..9913add 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ You will also need to setup Postgres on your computer. Here are the instructions $ psql issue-wanted < sql/seed.sql ``` -Follow the instructions under `How to run server` and test the endpoints to see if everything is set up correctly. +Follow the instructions under [`How to run server`](https://github.com/kowainik/issue-wanted/tree/rashadg1030/81-Document-Postgres-setup#how-to-run-server) and test the endpoints to see if everything is set up correctly. Refer to issue [#81](https://github.com/kowainik/issue-wanted/issues/81) if you're still having trouble. From c2c6aa181ac5785f1b03933322ec23b744c44dc7 Mon Sep 17 00:00:00 2001 From: rashadg1030 Date: Tue, 2 Jul 2019 19:06:48 -0700 Subject: [PATCH 4/5] Fix after review --- README.md | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 9913add..7b03cd9 100644 --- a/README.md +++ b/README.md @@ -13,41 +13,14 @@ encourage more programmers to become a part of the Haskell community. ## Prerequisites (what you need to have locally) -For the project to build, you will need to have `libpq-dev` installed on you computer. You can install it by running the command `sudo apt install libpq-dev`. +You will need to have the following installed on your system in order to build and test `issue-wanted`. Click on the links to learn how to install each one: -You will also need to setup Postgres on your computer. Here are the instructions for doing so: +1. [ghc](https://downloads.haskell.org/~ghc/6.8.3/docs/html/users_guide/installing-bin-distrib.html) +2. [cabal](https://www.haskell.org/cabal/) or [stack](https://docs.haskellstack.org/en/stable/README/) +3. [docker](https://docs.docker.com/v17.12/install/) +4. libpq-dev (Run the command `sudo apt install libpq-dev` to install) -1. Run the folowing commands with `` replaced by a username of your choice. - - ``` - $ sudo apt install postgresql postgresql-contrib - $ sudo service postgres start - $ sudo -u postgres psql - postgres=# create database "issue-wanted"; - postgres=# create user ; - postgres=# grant all privileges on database "issue-wanted" to ; - ``` - -2. Modify the [`pg_hba.conf`](https://dba.stackexchange.com/questions/101280/how-to-handle-user-with-no-password-in-postgresql) file with the following lines. - - ``` - local all trust - host all 0.0.0.0/0 trust - ``` - - Where `` is the same one you used above. - -3. Next, in the `config.toml` file in the repository update the line `user=` with the `` from above. - -4. Add the line `listen_address = '127.0.0.1'` to the `/etc/postgresql/10/main/postgresql.conf` file. - -5. Finally, restart the database and intitalize it with the following commands. - - ``` - $ sudo service postgres restart - $ psql issue-wanted < sql/schema.sql - $ psql issue-wanted < sql/seed.sql - ``` +With `docker` installed, open up a terminal (make sure your in the `issue-wanted` directory) and run the command `make postgres`. This will setup the database for you and you should be ready to go! Follow the instructions under [`How to run server`](https://github.com/kowainik/issue-wanted/tree/rashadg1030/81-Document-Postgres-setup#how-to-run-server) and test the endpoints to see if everything is set up correctly. From 46121c2ce78d001b511c9098097c11c0245efd34 Mon Sep 17 00:00:00 2001 From: rashadg1030 Date: Tue, 2 Jul 2019 19:33:35 -0700 Subject: [PATCH 5/5] Fix after review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b03cd9..7fdf9e0 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ encourage more programmers to become a part of the Haskell community. You will need to have the following installed on your system in order to build and test `issue-wanted`. Click on the links to learn how to install each one: -1. [ghc](https://downloads.haskell.org/~ghc/6.8.3/docs/html/users_guide/installing-bin-distrib.html) +1. [ghc](https://www.haskell.org/ghcup/) 2. [cabal](https://www.haskell.org/cabal/) or [stack](https://docs.haskellstack.org/en/stable/README/) 3. [docker](https://docs.docker.com/v17.12/install/) 4. libpq-dev (Run the command `sudo apt install libpq-dev` to install)