You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+11-34Lines changed: 11 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -59,20 +59,7 @@ To stop the project run `docker-compose stop`
59
59
60
60
- Mac/Linux use [Node Version Manager](https://github.com/creationix/nvm)
61
61
- Windows see [here](https://nodejs.org/en/download/)
62
-
63
-
1. Install Postgresql
64
-
65
-
- Postgresql is a database system. This app uses Postgesql to store voter data. When running the app using Node, you have to have a local Postgresql database that will get loaded with the voter data.
66
-
- MAC: the easist way to install Postgresql is with homebrew using the command below. It can also be downloaded from <https://www.postgresql.org/download/,> however, you will need to change your PATH.
67
-
68
-
```sh
69
-
brew install postgresql
70
-
```
71
-
72
-
- Windows: Postgresql downloads can be found here: https://www.postgresql.org/download/
73
-
- use the "Interactive Installer by Enterprise DB" after selecting your OS
74
-
- Note that the default user "postgres" and database "postgres" is assumed forthis project. If you provided a password for postgres during the installation, you need to provide the passwordin DB_PASS in the next step. If you are comfortable with postgresql and want to create your out database/user/table, feel free to do so, just be sure the make the appropriate changes in the net step.
75
-
62
+
76
63
1. Create a file called `.env` in the root of the project. The file should contain the following:
77
64
78
65
```sh
@@ -83,24 +70,22 @@ To stop the project run `docker-compose stop`
83
70
84
71
1. Open a terminal session at the root of your project and perform the following to initialize and start the application:
85
72
86
-
1. Start the postgresql database and load voter data to it:
87
-
88
-
Windows
73
+
1. Update your application with all the required node modules. Normally, this only needs to be one time.
89
74
90
75
```sh
91
-
npm run loadDataWin
76
+
npm install
92
77
```
93
78
94
-
Mac
79
+
1. Start the postgresql database and load voter data to it:
95
80
96
81
```sh
97
-
npm run loadDataMac
82
+
npm run load-data
98
83
```
99
84
100
-
1. Update your application with all the required node modules. Normally, this only needs to be one time.
85
+
If your data is already loaded and you just want to run the database, run the command:
101
86
102
87
```sh
103
-
npm install
88
+
npm run db
104
89
```
105
90
106
91
1. Start the application
@@ -117,18 +102,10 @@ To stop the project run `docker-compose stop`
117
102
Ctrl+c
118
103
```
119
104
120
-
1. To stop the database server, from a terminal session at the root of the project
1. To stop the database server, from a terminal session at the root of the project:
129
106
130
107
```sh
131
-
pg_ctl -D /usr/local/var/postgres stop
108
+
docker-compose stop db
132
109
```
133
110
134
111
### Project Details
@@ -179,8 +156,8 @@ Follow the [Issue template](./ISSUE_TEMPLATE.md) and be sure to include as much
179
156
## Deploying your code
180
157
Our code is deployed to Heroku to be served to the public. This happens in three stages:
181
158
1. **build**—Heroku will automatically run `npm install` and cache the project's depedencies. Next, Heroku looks fora `build` taskin the root `package.json` file. We use this step to build our React project, which optimizes our React code to be served statically.
182
-
2. **run**—Heroku runs the `web` task in the `Procfile`, which simply starts our thin Express server to handle incoming requests and serve our compiled React app.
183
-
3. **release**—Heroku runs the `release` task in the Procfile after deploying the application. Note that this task runs in a separate dyno (Heroku's term for a compute instance), so it will not have access to files from other parts of the build process. In our case, we ensure the database has the correct tables and the data is properly loaded.
159
+
1. **run**—Heroku runs the `web` task in the `Procfile`, which simply starts our thin Express server to handle incoming requests and serve our compiled React app.
160
+
1. **release**—Heroku runs the `release` task in the Procfile after deploying the application. Note that this task runs in a separate dyno (Heroku's term for a compute instance), so it will not have access to files from other parts of the build process. In our case, we ensure the database has the correct tables and the data is properly loaded.
184
161
185
162
When you merge your PR, it will be merged into the project's `dev` branch which will automatically kick off a deploy to our [staging server](https://dev-govote-api.herokuapp.com/). After you have merged your code, please test your changes and other basic flows (including finding your polling place and someone's voter registration) on the staging server.
0 commit comments