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: CONTRIBUTING.md
+2-9Lines changed: 2 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,10 @@
1
1
# Contributing
2
-
3
2
When contributing to this repository, please first discuss the change you wish to make via issue,
4
3
email, slack, or any other method with the contributes of this repository, or Code for Baltimore, before making a change.
5
4
6
5
Please note we have a [Code of Conduct](/docs/Code_of_Conduct.md), please follow it in all your interactions with the project.
7
6
8
7
## Overview
9
-
10
8
In the event of a disaster a municipality or state may have need to check in on the status of all healthcare providers,
11
9
or other types of entities, within in the jurisdiction. This system will provide methods for healthcare providers and
12
10
entities to check-in during disasters, and update their contact information during non-emergency periods. During an
@@ -21,7 +19,6 @@ to help the municipality prioritize its call/check-in list and response plan. Ad
21
19
information regularly during non-emergency times to ensure the municipality has the most up-to-date information for each entity.
22
20
23
21
### Non Goals
24
-
25
22
What will this project not accomplish during its initial creation?
26
23
27
24
- No front-end website or app
@@ -30,7 +27,6 @@ What will this project not accomplish during its initial creation?
30
27
- Statistical or analytical endpoints
31
28
32
29
### Minimum Viable Product
33
-
34
30
To use this product as quickly as possible we will be implementing the following features:
35
31
- User creation
36
32
- Contact creation
@@ -39,15 +35,14 @@ To use this product as quickly as possible we will be implementing the following
39
35
- Contact single-use login check-in ability
40
36
41
37
### Roadmap
42
-
43
-
We estimate the API will be at v1.0.0 by the end of March. Further Milestones and advancements can be viewed on the [Projects page](https://github.com/CodeForBaltimore/Bmore-Responsive/projects)
38
+
Milestones and project timelines can be viewed on the [Projects page](https://github.com/CodeForBaltimore/Bmore-Responsive/projects)
44
39
45
40
## Technology and Code
46
41
47
42
This project will make exclusive use of open-source software, packages, and contributions. The application is built with the following
48
43
technologies:
49
44
50
-
- Javascript/Typescript
45
+
- Javascript (ES6)
51
46
-[Node.js](https://nodejs.org/en/)
52
47
-[Express.js](https://expressjs.com/)
53
48
-[Sequelize](https://sequelize.org/v3/)
@@ -60,7 +55,6 @@ Please see our [Best Practices](/docs/Best_Practices.md) for code standards, git
60
55
documented code.
61
56
62
57
### Pull Request Process
63
-
64
58
1. Ensure you thoroughly fill out the pull request form presented when submitting the request.
65
59
This includes listing what work was done, what issues are resolved by that work, what tests
66
60
have been added, how to perform other tests or run the code, and other potentially relevant
@@ -71,7 +65,6 @@ documented code.
71
65
do not have permission to do that, you may request the second reviewer to merge it for you.
72
66
73
67
## Contact
74
-
75
68
The best ways to get in touch with us is via Slack. An active Slack link can be found on our website:
- [Infrastructure and Deployment](#infrastructure-and-deployment)
15
16
-[Setup](#setup)
16
17
-[Node and Express setup](#node-and-express-setup)
17
18
-[Environment variables](#environment-variables)
18
19
-[Example .env](#example-env)
19
20
-[PostgreSQL](#postgresql)
20
21
-[Sequelize](#sequelize)
21
22
-[Docker](#docker)
23
+
-[docker-compose](#docker-compose)
22
24
-[Using this product](#using-this-product)
23
25
-[Testing](#testing)
24
26
-[Sources and Links](#sources-and-links)
@@ -28,25 +30,33 @@ An API to drive disaster and emergency response systems.
28
30
29
31
## Documentation
30
32
Detailed documents describing this project and its use are available in this repository. The documentation currently available is as follows:
31
-
-[Best Practices](BEST_PRACTICES.md)
32
-
-[Code of Conduct](CODE_OF_CONDUCT.md)
33
-
-[Tech Spec](TECH_SPEC.md)
33
+
-[Best Practices](/docs/Best_Practices.md)
34
+
-[Code of Conduct](/docs/Code_of_Conduct.md)
35
+
-[Sequelize](/sequelize/README.md)
36
+
-[Tech Spec](/docs/Tech_Spec.md)
37
+
-[Terraform](/terraform/README.md)
34
38
35
39
### API Spec
36
-
Our API spec is on Swagger. You can view it here https://app.swaggerhub.com/apis/codeforbaltimore/bmoreResponsive/1.0.0#/ or you can find the `swagger.json` file in our `docs` folder and use it via http://localhost:3000 when the app is running locally.
40
+
Our API spec is on Swagger. You can view it here https://app.swaggerhub.com/apis/codeforbaltimore/bmoreResponsive or you can find the `swagger.json` file in our `docs` folder and use it via http://localhost:3000/api-docs/ when the app is running locally.
37
41
38
42
### Database Documentation
39
-
Our database documentation can be found in our `docs` folder under `database.csv`. This documentation was created using SchemaSpy. Instructions for use can be found here https://github.com/bcgov/schemaspy
43
+
Our database documentation can be found in the `/sequelize` directory or you can [click here](/sequelize/README.md)
44
+
45
+
### Infrastructure and Deployment
46
+
We have included a `terraform` option to deploy to AWS. For more information on how to use this feature, please see the [terraform](/terraform/README.md) directory.
40
47
41
48
# Setup
42
-
A `Dockerfile` and `docker-compose` file have been included for convenience, however this may not be the best local setup for this project. For more information on how to use Docker with this project, please see the [docker section](#docker).
49
+
This setup section will focus on setting up the local dev environment. For more detailed instructions for how to deploy this to a production environment please see the section above this one :point_up:
43
50
44
51
To work on this project you should have:
45
-
- NodeJS
46
-
- PostgreSQL (can be in Docker)
47
-
- Docker (optional)
52
+
-[Node.js](https://nodejs.org/en/)
53
+
-[PostgreSQL](https://www.postgresql.org/) (can be in Docker)
54
+
-[Docker](https://www.docker.com/) (optional)
55
+
-[Terraform](https://www.terraform.io/) (optional, for AWS deploy)
48
56
Once you have the prerequisite software installed you can proceed to setup this application.
49
57
58
+
A `Dockerfile` and `docker-compose` file have been included for convenience, however this may not be the best local development setup for this project. For more information on how to use Docker with this project, please see the [docker section](#docker).
59
+
50
60
## Node and Express setup
51
61
This application is designed to work as an API driven by Express. To setup your environment first you must install all required dependencies by running the following command from the root of your project directory:
52
62
```
@@ -62,7 +72,7 @@ echo 'NODE_ENV=local
62
72
PORT=<your port>
63
73
DATABASE_SCHEMA=<your database schema>
64
74
JWT_KEY=<your secret JWT seed phrase or key>
65
-
DATABASE_URL=<your connection string based on above variables>
75
+
DATABASE_URL=<your db connection string>
66
76
' >> ./.env
67
77
```
68
78
The `DATABASE_URL` is not a very clear var name, and the string is broken down as `postgres://username:password@host:port/database_name`
@@ -75,10 +85,10 @@ The various variables are defined as follows:
75
85
-`DATABASE_URL` = The URL string for your db connection. For example: `postgres://user:[email protected]:5432/dbname`
76
86
-`DATABASE_SCHEMA` = Your local database schema. Postgres default is `public`.
77
87
-`JWT_KEY` = A secret value to generate JWT's locally.
78
-
-`SMTP_HOST` = hostname for the SMTP server used to send notification emails
79
-
-`SMTP_PORT` = port number for the SMTP server used to send notification emails
80
-
-`SMTP_USER` = username for the SMTP server used to send notification emails
81
-
-`SMTP_PASSWORD` = password for the SMTP server used to send notification emails
88
+
-`SMTP_HOST` = _optional_hostname for the SMTP server used to send notification emails
89
+
-`SMTP_PORT` = _optional_port number for the SMTP server used to send notification emails
90
+
-`SMTP_USER` = _optional_username for the SMTP server used to send notification emails
91
+
-`SMTP_PASSWORD` = _optional_password for the SMTP server used to send notification emails
82
92
-`BYPASS_LOGIN` = _optional_ Allows you to hit the endpoints locally without having to login. If you wish to bypass the login process during local dev, set this to `true`.
83
93
84
94
_We do not recommend using the default options for PostgreSQL. The above values are provided as examples. It is more secure to create your own credentials._
@@ -102,7 +112,7 @@ BYPASS_LOGIN=true
102
112
## PostgreSQL
103
113
***You will need a PostgreSQL database running locally to run this application locally.*** You may setup PostgreSQL however you wish, however we recommend using Docker using the instructions found here: https://hub.docker.com/_/postgres
104
114
105
-
If you are using the Docker method you may spin up your database layer by running this command:
115
+
If you are using Docker you may spin up your database layer by running this command:
106
116
```
107
117
docker run -d -e POSTGRES_PASSWORD=<your chosen password> -p 5432:5432 postgres
108
118
```
@@ -116,21 +126,15 @@ To properly start the application the database needs to be built by Sequlize ahe
116
126
117
127
Example `/migrations` and `/seeders` scripts have been supplied. You can rollback your all seeded data at any time by running `npm run db-unseed` and delete all created tables with `npm run db-delete`.
118
128
119
-
To create new models, migrations, and seeders you _must_ use the Sequelize CLI commands. Full documentation is here https://sequelize.org/master/manual/migrations.html but here are a few useful commands:
120
-
-`npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string` - Creates a model under `/src/models` and a migration script.
121
-
-`npx sequelize-cli seed:generate --name demo-user` - Creates a seeder for the `User` model and migration previously setup.
122
-
123
129
## Docker
124
-
To use the `docker-compose.yml` file included you will first need to set [environment variables](#environment-variables). You **MUST** set your `DATABASE_HOST` to `db` to use the `docker-compose` solution.
125
-
126
-
If you are running your own database, but want to use the `Dockerfile` you will need to run that this way:
130
+
You can build and run the application in Docker locally by running the following commands:
127
131
```
128
132
docker build -t bmoreres .
129
133
docker run -d -p 3000:3000 --env-file=.env bmoreres
130
134
```
131
-
Note that `DATABASE_URL` host location will be different depending on what OS you're using. On Mac it is `docker.for.mac.host.internal` and on Windows it is `docker.for.win.host.internal` if using `docker-compose` it will be `db`
135
+
Note that `DATABASE_URL` host location will be different depending on what OS you're using. On Mac it is `docker.for.mac.host.internal` and on Windows it is `docker.for.win.host.internal` if using `docker-compose` it will be `db`. Please see [Example .env](#example-env) for more information.
132
136
133
-
You can manually set the environment variables and not use a `.env` file by setting the following vars:
137
+
Alternatively you can manually set the environment variables and not use a `.env` file by setting the following vars:
134
138
```
135
139
-e NODE_ENV=development
136
140
-e PORT=3000
@@ -139,8 +143,12 @@ You can manually set the environment variables and not use a `.env` file by sett
To use the `docker-compose.yml` file included you will first need to set [environment variables](#environment-variables). You **MUST** set your `DATABASE_HOST` to `db` to use the `docker-compose` solution. It is not recommended to use `docker-compose` for any reason other than to test a solution for a separate front-end component.
148
+
142
149
# Using this product
143
-
You may use this product to create and manage users for your front-end. More to come!
150
+
You may use this product to create and manage users for your front-end.
151
+
144
152
To run the application--after the above steps are completed--run `npm start`.
145
153
146
154
## Testing
@@ -151,8 +159,6 @@ To check your linting you may run `npm run lint` and to format and automatically
151
159
# Sources and Links
152
160
We are also building a front-end application called [Healthcare Rollcall](https://github.com/CodeForBaltimore/Healthcare-Rollcall) to interact with this backend API. To view that project, or to contribute to it, please visit the repo here: https://github.com/CodeForBaltimore/Healthcare-Rollcall
153
161
154
-
We will be including multi-repo build processes with the front-end that will reference this project.
155
-
156
162
## Contributors ✨
157
163
158
164
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Copy file name to clipboardExpand all lines: docs/Best_Practices.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Static code analysis tools should be used when possible, to monitor and improve
59
59
All code work should be done in an isolated or feature branch off of the `master` branch. Before starting work on new code, developers should create their feature branch using a standard naming convention determined by the project.
60
60
61
61
### Branch Names
62
-
Branch names should follow this patter: `<your github username>/issue-<github issue number>`. This will ensure there are no branch name conflicts, and anyone looking for your branch will know what it is called based on the issue addressed. For example if your username was letsGoOs, and you were working on issue 8, then your branch name would be `letsGoOs/issue-8`. If you wanted to make a new branch to continue your work on your issue then add a suffix with an incremented number. To continue the previous example if you wanted to make a second branch for your issue 8 work your second branch would be called `letsGoOs/issue-8-2`.
62
+
Branch names should follow this patter: `<your github username>/issue-<github issue number>`. This will ensure there are no branch name conflicts, and anyone looking for your branch will know what it is called based on the issue addressed. For example if your username was `letsGoOs`, and you were working on issue 8, then your branch name would be `letsGoOs/issue-8`. If you wanted to make a new branch to continue your work on your issue then add a suffix with an incremented number. To continue the previous example if you wanted to make a second branch for your issue 8 work your second branch would be called `letsGoOs/issue-8-2`.
Copy file name to clipboardExpand all lines: sequelize/README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,4 +18,9 @@ This repo has simplified a few of the Sequelize CLI options that would be common
18
18
-`npm run db-create` will create the database and run all migrations.
19
19
-`npm run db-delete` will delete all tables and revert all migrations.
20
20
-`npm run db-seed` will run all seeders and populate all data.
21
-
-`npm run db-unseed` will delete all data in all tables and revert all seeders.
21
+
-`npm run db-unseed` will delete all data in all tables and revert all seeders.
22
+
23
+
# Links and more information
24
+
To create new models, migrations, and seeders you _must_ use the Sequelize CLI commands. Full documentation is here https://sequelize.org/master/manual/migrations.html but here are a few useful commands:
25
+
-`npx sequelize-cli model:generate --name User --attributes firstName:string,lastName:string,email:string` - Creates a model under `/src/models` and a migration script.
26
+
-`npx sequelize-cli seed:generate --name demo-user` - Creates a seeder for the `User` model and migration previously setup.
0 commit comments