The goal of Footprint-finder is to empower people to understand their footprint and give them the tools to reduce it.
Right now I'm trying to catalogue the CO2 footprint of things and from there figure out the best ways to reduce one's footprint.
You will need the following:
- Node (I'm using version 6.9)
- Npm
- Webpack (install with npm install -g webpack)
- MongoDb
- RoboMongo (GUI for MongoDb)
Follow the MongoDb documentaion to get MongoDb running locally. -Start MongoDb. Find mongo at ~/mongo/bin. Command: ./mongod -dbpath ~/mongo-data Use RoboMongo to access mongo on your localhose. Create a database called EnvWebsite.
Once you have that and MonogDb is running, run 'npm install' to get all of my dependencies. Then run 'npm run compile' to build the js. Also run export page='costs'. I have webpack configured to look at enviornment variables. Then do 'npm run webstart' to run the server. After this point you will be able to go to the route at localhost:3000/. . .
PM note: Google analytics url: https://analytics.google.com/analytics/web/#report/visitors-overview/a104075818w155429254p157100584/%3F_u.date00%3D20180301%26_u.date01%3D20180331/
To start testing (Mac)
- Start MongoDb. Find mongo at ~/mongo/bin. Command: ./mongod -dbpath ~/mongo-data
- Start Node server. run this file!
To start testing (Windows 10)
- Start MongoDB. Command: "\Program Files\MongoDB\Server\3.6\bin\mongod.exe"
- Start Node server, run this file!
This repo has about 8 code splits based on the page. You will need to specify which page you want to bundle with webpack. You can do this by the bash environment variable "page". Pages are:
- footprint (homepage and form)
- results (form results)
- usenergy (US energy map)
- stateenergy (state energy pages)
- localenergy (local energy page)
- static (all pages under the static folder)
- costs (all costs pages)
- solar (the solar calculator which exists only in code) To set the env, run the command "export page=footprint"
From here you can use any standard webpack and node commands. There is a custom "npm run build" which will compile the js bundle and then start the server.