Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 update documentation #6

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 29 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# The Capital Planning Platform

A Single Page Application(SPA) for the various front-end map and data tools produced by the NYC DCP Capital Planning Team
> A Single Page Application(SPA) for the various front-end map and data tools produced by the NYC DCP Capital Planning Team

[![](docs/landing.png)](capitalplanning.nyc.gov)

## Architecture
As an SPA, all of the business logic and routing are done client-side. The app is comprised of various React.js Components and makes use of React-Router for client-side routing. The React JSX files are built with webpack to create a single `bundle.js` file.
Expand All @@ -11,7 +13,6 @@ At the time of writing, the app is "backendless", and is using an in-house carto

We are not storing carto api keys in the client-side code, so all interactions with the carto server are read-only.


## Main Products

Our initial products are map-based data explorers for Capital Planning's 3 new data products
Expand All @@ -26,51 +27,36 @@ Facilities DB is a new dataset of government-related facilities. The map applic
Shows locations of new housing units compiled primarily from DOB permit records and certificates of occupancy.


###Development Environment

We use `webpack-dev-server` to serve the app locally, which takes care of building the bundle and hot-reloading the browser when changes are saved to the code.
## Develop
Since `staging` will likely be ahead of `master`, do work in feature branches off of `staging`, incorporate/publish to production by creating PRs from `staging` into `master`.

To get serve the project locally:

- Clone this repository
`git clone https://github.com/NYCPlanning/capital-planning-platform.git`

- Navigate to the directory
`cd capital-planning-platform`

-Install dependencies
`npm install`

-Serve the application
`npm run devserve`
This command uses webpack dev server to build the bundle and serve the app.

-Load the app
You should be able to access the app at `http://localhost:8080`



### Development Workflow

#### Letsencrypt
Traffic to the various Dokku apps is encrypted with SSL, using the [dokku letsencrypt plugin](https://github.com/dokku/dokku-letsencrypt). When a certificate expires, a simple command `dokku letsencrypt:auto-renew` can be run on the server to automatically renew old certificates.

### Deploying
By using dokku, the app can be deployed simply by pushing the repo to a different remote:

To set up the production app:
`git remote add dokku [email protected]:cpp`

To set up the staging app:
`git remote add staging [email protected]:staging`

To deploy to production:
`git push dokku master`

To deploy to staging:
`git push staging staging:master` (This is because dokku only works with a branch called master, so we are calling staging master when pushing to the staging dokku app)
1. Clone this repository
```sh
git clone https://github.com/NYCPlanning/capital-planning-platform.git
```
2. Navigate to the directory
```sh
cd capital-planning-platform
```
3. Install dependencies
```sh
npm install
```
4. Serve locally
```sh
# uses webpack dev server to bundle and hot reload
npm run devserve
```
5. Go to `localhost:8080` in your web browser

## Deploy
The SPA is hosted on Netlify.
- `master` branch is automatically deployed to capitalplanning.nyc.gov.
- `staging` branch is automatically deployed to
- each pull request will get a preview deploy for viewing before merge. See the PR for details on the URL for this preview deploy, or head to the application on Netlify.

Update readme

#### Updating data

Expand Down
2 changes: 1 addition & 1 deletion app/config/totalcounts.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"cpMapped":5682,"cpAll":12042,"facilities":33084,"housing":56745,"housingRaw":66896,"cbbr":1271,"cpdbTotalCommitMin":-20000000,"cpdbTotalCommitMax":9300000000,"cpdbSpentToDateMax":2200000000}
{"cpMapped":5682,"cpAll":12042,"facilities":33084,"housing":56745,"housingRaw":66896,"cbbr":1271,"cpdbTotalCommitMin":-20000000,"cpdbTotalCommitMax":9300000000,"cpdbSpentToDateMax":2200000000}
Binary file added docs/landing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.