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
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.
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'
}
};
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';
}