Visualization tool for information deserts of 311 datas
- Unzip files and place in /server/src/data
- Add column "user_type" with value corresponding to user type in file name (for all rows)
- Add column "frequency" with value corresponding to reporting frequency indicated in file name (for all rows)
- Start vagrant server
- Verify csv file name is correct in line 17 of "csvToMongo.py" and run
- DB will be titled "hexData"
- Collection will be titled "hexagon"
Visualization tool for information deserts of 311 data. This application is built with MERN stack (MongoDB, Express, React.js and Node.js) and leaflet.js for interactive map. The back-end server uses Node.js + Express for REST APIs, and front-end side is a React client with React Router and Axios.
- React UI components: src/components
- BosMap.js
- HexRegression.js
- RegressionPlt.js
- Axis.js
- RenderCircles.js
- GeoJson of Boston hexagons: src/data/
- hexagon_600m_311_pop_20200707.json
- Http request and response using Axios:
- src/http-common.js
- src/services/bos311.service.js
-
Configuration of server and database:
- src/config/db.config.js
-
Database dump:
- src/db/hexagon.bson
-
MVC framework:
- src/models
- src/routers
- src/controllers
-
Vagrant:
- ./Vagrantfile
- provision/provision.sh
- Install VirtualBox and Vagrant
- Open up a terminal
- Clone this repository
- Open up another teminal window and change the directory to the client folder
- Run
npm install
to install the node modules - Run
npm start
Go to the web browser and type: http://localhost:8081/
Everything is set up on the google cloud server, please ignore following steps
- Run
cd server
- Run
vagrant up
in the server folder - Run
cd src
- Run
npm install
- Log in to the machine running
vagrant ssh
cd /vagrant/src
npm start
- The app is now running on the virtual machine. The virtual machine's port 3000 is mapped to the host machine's port 3001.
- The
/vagrant
folder in the virtual machine is synchronized with the server folder in your machine. Any changes you make in the/vagrant
folder will be visible on your machine and vice-versa.