A site showing all the businesses that have been charged with a violation from the SLA due to the new COVID restrictions.
NOTES:
- The updater is pretty janky, and there's some manual address correction that needs to happen after a successful run
To manually run the updater:
- node ./scripts/updater.js
To run the validator:
- node ./scripts/premiseValidator.js
To run the batch premise updater:
- edit the list of entries at the top of scripts/dataCleaner.js
- premiseID,lat,long;
- node ./scripts/dataCleaner.js
To manually update a premise, do this in the console in node:
- const models = require('/app/models/');
- let premise = {};
- premise = {}; models.Premise.findByPk('1280481').then(prem => { premise = prem;});
- premise.longitude = '-73.9929738';
- premise.latitude = '40.7249134';
- premise.save().then(result => { console.log('done'); });
TODO:
- Better styles?
- Add premises that don't have violations
This Slackbot uses a basic webapp powered by Express to pull updates from the SLA site and display violations using OpenStreetMap. It uses:
- Bull for job scheduling (with Arena to view queued jobs)
- Redis for the datastore for Bull
- Sequelize and SQLite3 DB for violation data
- Nominatim to geocode addresses (Search API)
- SheetJS for the XLSX parsing
- OpenStreetMaps/OpenLayers for the maps display
- Eater's July Article on citations for the source for the original spreadsheet
- OpenLayer's popup example for how to do popups in open layers
- Mohit Gupta's guide to markers with OpenLayers for how to setup custom markers
- Harry Wood's marker popups example for an outdated view on how to make popups in open layers
- David Nichols' colorblind calculator to make sure the red/yellow/orange worked well for different color blindness
Are you going to remix this? Dope! Follow these steps to get setup.
- Remix into your own project
- Follow these notes to get Redis up and running your Glitch app: https://glitch.com/~redis-notes
- Copy .env.sample to your .env and update your properties
- Update views/components/footer.ejs to include your made by information