aepyornis / hpd-violations-web

Look up NYC housing violations

Home Page:https://violations.nycchr.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HPD Violations Web

A website to easily look up housing violations for any building in NYC.

See it in action: violations.nycchr.org

There are two companion projects that this relies on:

hpd-violations - A postgres database built from HPD open data.

hpd-violations-server - A simple nodejs server serving JSON from the database

Develop:

This is a react/redux app.

Install dependencies: npm install

Develop: npm start and npm run test:watch

Test: npm test

Build: npm run prod and then host the dist/ folder.

config.js:

module.exports = {
  geoclient: {
    appid: 'your-nyc-developer-geoclient-app-id',
    appkey: 'your-nyc-developer-geoclient-appkey',
    proxyurl: 'geoclient proxy url'
  },
  violations: {
    url: 'url-to-hpd-violations-server'
  }
};

NYC GEOCLIENT proxy pass

The geoclient api does not accept cross-origin requests. I proxy pass the requests via ngnix using this configuration:

location / {
                proxy_pass https://api.cityofnewyork.us/geoclient/v1/address.json;
                add_header 'Access-Control-Allow-Origin' '*';
                add_header 'Access-Control-Allow-Credentials' 'true';
                add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
                add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
        }

About

Look up NYC housing violations

https://violations.nycchr.org/

License:GNU General Public License v3.0


Languages

Language:JavaScript 98.4%Language:CSS 1.2%Language:HTML 0.3%