Skip to content

Commit db5bb8d

Browse files
committed
Final doc tweaks
1 parent 98f2aaa commit db5bb8d

File tree

5 files changed

+695
-852
lines changed

5 files changed

+695
-852
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Contributing
2-
32
When contributing to this repository, please first discuss the change you wish to make via issue,
43
email, slack, or any other method with the contributes of this repository, or Code for Baltimore, before making a change.
54

65
Please note we have a [Code of Conduct](/docs/Code_of_Conduct.md), please follow it in all your interactions with the project.
76

87
## Overview
9-
108
In the event of a disaster a municipality or state may have need to check in on the status of all healthcare providers,
119
or other types of entities, within in the jurisdiction. This system will provide methods for healthcare providers and
1210
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
2119
information regularly during non-emergency times to ensure the municipality has the most up-to-date information for each entity.
2220

2321
### Non Goals
24-
2522
What will this project not accomplish during its initial creation?
2623

2724
- No front-end website or app
@@ -30,7 +27,6 @@ What will this project not accomplish during its initial creation?
3027
- Statistical or analytical endpoints
3128

3229
### Minimum Viable Product
33-
3430
To use this product as quickly as possible we will be implementing the following features:
3531
- User creation
3632
- Contact creation
@@ -39,15 +35,14 @@ To use this product as quickly as possible we will be implementing the following
3935
- Contact single-use login check-in ability
4036

4137
### 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)
4439

4540
## Technology and Code
4641

4742
This project will make exclusive use of open-source software, packages, and contributions. The application is built with the following
4843
technologies:
4944

50-
- Javascript/Typescript
45+
- Javascript (ES6)
5146
- [Node.js](https://nodejs.org/en/)
5247
- [Express.js](https://expressjs.com/)
5348
- [Sequelize](https://sequelize.org/v3/)
@@ -60,7 +55,6 @@ Please see our [Best Practices](/docs/Best_Practices.md) for code standards, git
6055
documented code.
6156

6257
### Pull Request Process
63-
6458
1. Ensure you thoroughly fill out the pull request form presented when submitting the request.
6559
This includes listing what work was done, what issues are resolved by that work, what tests
6660
have been added, how to perform other tests or run the code, and other potentially relevant
@@ -71,7 +65,6 @@ documented code.
7165
do not have permission to do that, you may request the second reviewer to merge it for you.
7266

7367
## Contact
74-
7568
The best ways to get in touch with us is via Slack. An active Slack link can be found on our website:
7669

7770
***[codeforbaltimore.org](https://codeforbaltimore.org/)***

README.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ An API to drive disaster and emergency response systems.
1212
- [Documentation](#documentation)
1313
- [API Spec](#api-spec)
1414
- [Database Documentation](#database-documentation)
15+
- [Infrastructure and Deployment](#infrastructure-and-deployment)
1516
- [Setup](#setup)
1617
- [Node and Express setup](#node-and-express-setup)
1718
- [Environment variables](#environment-variables)
1819
- [Example .env](#example-env)
1920
- [PostgreSQL](#postgresql)
2021
- [Sequelize](#sequelize)
2122
- [Docker](#docker)
23+
- [docker-compose](#docker-compose)
2224
- [Using this product](#using-this-product)
2325
- [Testing](#testing)
2426
- [Sources and Links](#sources-and-links)
@@ -28,25 +30,33 @@ An API to drive disaster and emergency response systems.
2830

2931
## Documentation
3032
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)
3438

3539
### 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.
3741

3842
### 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.
4047

4148
# 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:
4350

4451
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)
4856
Once you have the prerequisite software installed you can proceed to setup this application.
4957

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+
5060
## Node and Express setup
5161
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:
5262
```
@@ -62,7 +72,7 @@ echo 'NODE_ENV=local
6272
PORT=<your port>
6373
DATABASE_SCHEMA=<your database schema>
6474
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>
6676
' >> ./.env
6777
```
6878
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:
7585
- `DATABASE_URL` = The URL string for your db connection. For example: `postgres://user:[email protected]:5432/dbname`
7686
- `DATABASE_SCHEMA` = Your local database schema. Postgres default is `public`.
7787
- `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
8292
- `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`.
8393

8494
_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
102112
## PostgreSQL
103113
***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
104114

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:
106116
```
107117
docker run -d -e POSTGRES_PASSWORD=<your chosen password> -p 5432:5432 postgres
108118
```
@@ -116,21 +126,15 @@ To properly start the application the database needs to be built by Sequlize ahe
116126

117127
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`.
118128

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-
123129
## 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:
127131
```
128132
docker build -t bmoreres .
129133
docker run -d -p 3000:3000 --env-file=.env bmoreres
130134
```
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.
132136

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:
134138
```
135139
-e NODE_ENV=development
136140
-e PORT=3000
@@ -139,8 +143,12 @@ You can manually set the environment variables and not use a `.env` file by sett
139143
-e DATABASE_DATABASE_SCHEMA=<your database schema>
140144
```
141145

146+
### docker-compose
147+
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+
142149
# 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+
144152
To run the application--after the above steps are completed--run `npm start`.
145153

146154
## Testing
@@ -151,8 +159,6 @@ To check your linting you may run `npm run lint` and to format and automatically
151159
# Sources and Links
152160
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
153161

154-
We will be including multi-repo build processes with the front-end that will reference this project.
155-
156162
## Contributors ✨
157163

158164
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

docs/Best_Practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Static code analysis tools should be used when possible, to monitor and improve
5959
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.
6060

6161
### 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`.
6363

6464
### Merging and Pull Requests
6565

sequelize/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ This repo has simplified a few of the Sequelize CLI options that would be common
1818
- `npm run db-create` will create the database and run all migrations.
1919
- `npm run db-delete` will delete all tables and revert all migrations.
2020
- `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

Comments
 (0)