diff --git a/server/boot/randomAPIs.js b/server/boot/randomAPIs.js index a7282e1ca0..1f504c6575 100644 --- a/server/boot/randomAPIs.js +++ b/server/boot/randomAPIs.js @@ -7,6 +7,7 @@ var Rx = require('rx'), debug = require('debug')('freecc:cntr:resources'), constantStrings = require('../utils/constantStrings.json'), + bootcampJson = require('../utils/bootcamps.json'), secrets = require('../../config/secrets'); var slack = new Slack(secrets.slackHook); @@ -328,7 +329,8 @@ module.exports = function(app) { function bootcampCalculator(req, res) { res.render('resources/calculator', { - title: 'Coding Bootcamp Cost Calculator' + title: 'Coding Bootcamp Cost Calculator', + bootcampJson: bootcampJson }); } diff --git a/server/utils/bootcamps.json b/server/utils/bootcamps.json new file mode 100644 index 0000000000..8a92d5e17d --- /dev/null +++ b/server/utils/bootcamps.json @@ -0,0 +1,247 @@ +[{ + "name": "App Academy", + "cost": "18000", + "weeks": "12", + "finance": false, + "housing": "500", + "cities": [ + "new-york-city", + "san-francisco" + ] +}, { + "name": "Viking Code School", + "cost": "18000", + "weeks": "14", + "housing": "0", + "finance": false, + "cities": [ + "online" + ] +}, { + "name": "Hack Reactor", + "cost": "17780", + "housing": "500", + "weeks": "12", + "finance": true, + "cities": [ + "new-york-city", + "san-francisco" + ] +}, { + "name": "Hack Reactor Online", + "cost": "17780", + "housing": "0", + "weeks": "12", + "finance": true, + "cities": [ + "online" + ] +}, { + "name": "Hackbright Academy", + "cost": "15000", + "housing": "500", + "weeks": "10", + "finance": true, + "cities": [ + "san-francisco" + ] +}, { + "name": "Dev Bootcamp", + "cost": "13950", + "finance": true, + "housing": "500", + "weeks": "19", + "cities": [ + "new-york-city", + "san-francisco", + "chicago" + ] +}, { + "name": "General Asssembly", + "cost": "11500", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "washington-dc", + "austin", + "boston", + "chicago", + "hong-kong", + "london", + "los-angeles", + "melbourne", + "new-york-city", + "san-francisco", + "seattle", + "singapore" + ] +}, { + "name": "Angel Hack", + "cost": "14250", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "san-francisco" + ] +}, { + "name": "Bitmaker Labs", + "cost": "12000", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "toronto" + ] +}, { + "name": "CoderVox", + "cost": "9980", + "housing": "400", + "finance": true, + "weeks": "12", + "cities": [ + "austin" + ] +}, { + "name": "Coding Dojo", + "cost": "12500", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "new-york-city", + "san-francisco", + "chicago" + ] +}, { + "name": "Epicodus", + "cost": "4500", + "housing": "400", + "finance": false, + "weeks": "15", + "cities": [ + "portland" + ] +}, { + "name": "Flat Iron School", + "cost": "15000", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "new-york-city" + ] +}, { + "name": "Galvanize", + "cost": "21000", + "housing": "500", + "finance": true, + "weeks": "24", + "cities": [ + "boulder", + "denver", + "seattle", + "san-francisco" + ] +}, { + "name": "The Iron Yard", + "cost": "12000", + "housing": "500", + "finance": true, + "weeks": "19", + "cities": [ + "austin", + "washington-dc" + ] +}, { + "name": "Launch Academy", + "cost": "12500", + "housing": "500", + "finance": true, + "weeks": "10", + "cities": [ + "boston" + ] +}, { + "name": "Maker Square", + "cost": "16920", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "los-angeles", + "san-francisco", + "austin" + ] +}, { + "name": "Refactor U", + "cost": "13500", + "housing": "400", + "finance": true, + "weeks": "10", + "cities": [ + "boulder" + ] +}, { + "name": "Rocket U", + "cost": "12500", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "new-york-city", + "san-francisco", + "chicago" + ] +}, { + "name": "Sabio", + "cost": "13450", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "los-angeles" + ] +}, { + "name": "Shillington School", + "cost": "12950", + "housing": "500", + "finance": true, + "weeks": "12", + "cities": [ + "new-york-city", + "sydney", + "brisbane", + "london", + "manchester", + "melbourne" + ] +}, { + "name": "The Tech Academy", + "cost": "9000", + "housing": "400", + "finance": true, + "weeks": "20", + "cities": [ + "portland" + ] +}, { + "name": "Turing School", + "cost": "17500", + "housing": "400", + "finance": true, + "weeks": "27", + "cities": [ + "denver" + ] +}, { + "name": "Free Code Camp", + "cost": "0", + "housing": "0", + "finance": false, + "weeks": "0", + "cities": [ + "online" + ] +}] diff --git a/server/views/resources/calculator.jade b/server/views/resources/calculator.jade index 9775b1d1d5..312f293620 100644 --- a/server/views/resources/calculator.jade +++ b/server/views/resources/calculator.jade @@ -7,31 +7,77 @@ block content .col-xs-12.col-sm-10.col-sm-offset-1 h2#one Where do you live? #city-buttons - button#austin.btn.btn-primary.btn-block Austin - button#brisbane.btn.btn-primary.btn-block Brisbane - button#boulder.btn.btn-primary.btn-block Boulder - button#chicago.btn.btn-primary.btn-block Chicago - button#denver.btn.btn-primary.btn-block Denver - button#hong-kong.btn.btn-primary.btn-block Hong Kong - button#london.btn.btn-primary.btn-block London - button#los-angeles.btn.btn-primary.btn-block Los Angeles - button#manchester.btn.btn-primary.btn-block Manchester - button#melbourne.btn.btn-primary.btn-block Melbourne - button#san-francisco.btn.btn-primary.btn-block San Fransisco - button#new-york-city.btn.btn-primary.btn-block New York City - button#portland.btn.btn-primary.btn-block Portland - button#singapore.btn.btn-primary.btn-block Singapore - button#seattle.btn.btn-primary.btn-block Seattle - button#toronto.btn.btn-primary.btn-block Toronto - button#other.btn.btn-primary.btn-block Other + .row + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#atlanta.btn.btn-primary.btn-block.btn-lg Atlanta + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#austin.btn.btn-primary.btn-block.btn-lg Austin + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#brisbane.btn.btn-primary.btn-block.btn-lg Brisbane + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#boulder.btn.btn-primary.btn-block.btn-lg Boulder + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#chicago.btn.btn-primary.btn-block.btn-lg Chicago + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#denver.btn.btn-primary.btn-block.btn-lg Denver + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#hong-kong.btn.btn-primary.btn-block.btn-lg Hong Kong + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#london.btn.btn-primary.btn-block.btn-lg London + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#los-angeles.btn.btn-primary.btn-block.btn-lg Los Angeles + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#manchester.btn.btn-primary.btn-block.btn-lg Manchester + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#melbourne.btn.btn-primary.btn-block.btn-lg Melbourne + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#new-york-city.btn.btn-primary.btn-block.btn-lg New York City + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#portland.btn.btn-primary.btn-block.btn-lg Portland + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#raleigh-durham.btn.btn-primary.btn-block.btn-lg Raleigh-Durham + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#san-francisco.btn.btn-primary.btn-block.btn-lg San Fransisco + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#seattle.btn.btn-primary.btn-block.btn-lg Seattle + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#singapore.btn.btn-primary.btn-block.btn-lg Singapore + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#toronto.btn.btn-primary.btn-block.btn-lg Toronto + .col-xs-12.btn-nav + button#other.btn.btn-primary.btn-block.btn-lg Other h2#two How much money did you make last year (in USD)? #income - button#0.btn.btn-primary.btn-block(href='#') $0 - button#20000.btn.btn-primary.btn-block(href='#') $20,000 - button#40000.btn.btn-primary.btn-block(href='#') $40,000 - button#60000.btn.btn-primary.btn-block(href='#') $60,000 - button#80000.btn.btn-primary.btn-block(href='#') $80,000 - button#100000.btn.btn-primary.btn-block(href='#') $100,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#0.btn.btn-primary.btn-block.btn-lg(href='#') $0 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#20000.btn.btn-primary.btn-block.btn-lg(href='#') $20,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#30000.btn.btn-primary.btn-block.btn-lg(href='#') $30,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#40000.btn.btn-primary.btn-block.btn-lg(href='#') $40,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#50000.btn.btn-primary.btn-block.btn-lg(href='#') $50,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#60000.btn.btn-primary.btn-block.btn-lg(href='#') $60,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#70000.btn.btn-primary.btn-block.btn-lg(href='#') $70,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#80000.btn.btn-primary.btn-block.btn-lg(href='#') $80,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#90000.btn.btn-primary.btn-block.btn-lg(href='#') $90,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#100000.btn.btn-primary.btn-block.btn-lg(href='#') $100,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#120000.btn.btn-primary.btn-block.btn-lg(href='#') $120,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#140000.btn.btn-primary.btn-block.btn-lg(href='#') $140,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#160000.btn.btn-primary.btn-block.btn-lg(href='#') $160,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#180000.btn.btn-primary.btn-block.btn-lg(href='#') $180,000 + .col-xs-12.col-sm-6.col-md-4.btn-nav + button#200000.btn.btn-primary.btn-block.btn-lg(href='#') $200,000 svg.chart | Sources: a(href='#') Link to Data Sources Here @@ -44,258 +90,11 @@ block content | Stacked script. + $(document).ready(function () { + var bootcamps = !{JSON.stringify(bootcampJson)}; var city = ""; - //major cities array to check against users location for housing costs - var cityArray = ["san-fransisco", "los-angeles", "chicago", "austin", "new-york-city"]; - //this is the raw bootcamps file allowing easy addition of new code camps - var bootcamps = [{ - "name": "App Academy", - "cost": "18000", - "weeks": "12", - "finance": false, - "housing": "500", - "cities": [ - "new-york-city", - "san-francisco" - ] - }, { - "name": "Viking Code School", - "cost": "18000", - "weeks": "14", - "housing": "0", - "finance": false, - "cities": [ - "online" - ] - }, { - "name": "Hack Reactor", - "cost": "17780", - "housing": "500", - "weeks": "12", - "finance": true, - "cities": [ - "new-york-city", - "san-francisco" - ] - }, { - "name": "Hack Reactor Online", - "cost": "17780", - "housing": "0", - "weeks": "12", - "finance": true, - "cities": [ - "online" - ] - }, { - "name": "Hackbright Academy", - "cost": "15000", - "housing": "500", - "weeks": "10", - "finance": true, - "cities": [ - "san-francisco" - ] - }, { - "name": "Dev Bootcamp", - "cost": "13950", - "finance": true, - "housing": "500", - "weeks": "19", - "cities": [ - "new-york-city", - "san-francisco", - "chicago" - ] - }, { - "name": "General Asssembly", - "cost": "11500", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "washington-dc", - "austin", - "boston", - "chicago", - "hong-kong", - "london", - "los-angeles", - "melbourne", - "new-york-city", - "san-francisco", - "seattle", - "singapore" - ] - }, { - "name": "Angel Hack", - "cost": "14250", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "san-francisco" - ] - }, { - "name": "Bitmaker Labs", - "cost": "12000", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "toronto" - ] - }, { - "name": "CoderVox", - "cost": "9980", - "housing": "400", - "finance": true, - "weeks": "12", - "cities": [ - "austin" - ] - }, { - "name": "Coding Dojo", - "cost": "12500", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "new-york-city", - "san-francisco", - "chicago" - ] - }, { - "name": "Epicodus", - "cost": "4500", - "housing": "400", - "finance": false, - "weeks": "15", - "cities": [ - "portland" - ] - }, { - "name": "Flat Iron School", - "cost": "15000", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "new-york-city" - ] - }, { - "name": "Galvanize", - "cost": "21000", - "housing": "500", - "finance": true, - "weeks": "24", - "cities": [ - "boulder", - "denver", - "seattle", - "san-francisco" - ] - }, { - "name": "The Iron Yard", - "cost": "12000", - "housing": "500", - "finance": true, - "weeks": "19", - "cities": [ - "austin", - "washington-dc" - ] - }, { - "name": "Launch Academy", - "cost": "12500", - "housing": "500", - "finance": true, - "weeks": "10", - "cities": [ - "boston" - ] - }, { - "name": "Maker Square", - "cost": "16920", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "los-angeles", - "san-francisco", - "austin" - ] - }, { - "name": "Refactor U", - "cost": "13500", - "housing": "400", - "finance": true, - "weeks": "10", - "cities": [ - "boulder" - ] - }, { - "name": "Rocket U", - "cost": "12500", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "new-york-city", - "san-francisco", - "chicago" - ] - }, { - "name": "Sabio", - "cost": "13450", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "los-angeles" - ] - }, { - "name": "Shillington School", - "cost": "12950", - "housing": "500", - "finance": true, - "weeks": "12", - "cities": [ - "new-york-city", - "sydney", - "brisbane", - "london", - "manchester", - "melbourne" - ] - }, { - "name": "The Tech Academy", - "cost": "9000", - "housing": "400", - "finance": true, - "weeks": "20", - "cities": [ - "portland" - ] - }, { - "name": "Turing School", - "cost": "17500", - "housing": "400", - "finance": true, - "weeks": "27", - "cities": [ - "denver" - ] - }, { - "name": "Free Code Camp", - "cost": "0", - "housing": "0", - "finance": false, - "weeks": "0", - "cities": [ - "online" - ] - }]; + var cityArray = ["san-fransisco", "los-angeles", "chicago", "austin", "new-york-city", "melbourne", "hong-kong", "seattle", "singapore", "london", "toronto", "portland", "brisbane", "atlanta", "raleigh-durham"]; $('#two').css({opacity: '0.25'}); $('#three').css({opacity: '0.25'}); $('#four').css({opacity: '0.25'}); @@ -364,7 +163,7 @@ block content var xStackMax = d3.max(bootcamps, function (d) { return d.total; }), //Scale for Stacked - xGroupMax = bootcamps.map(function (camp) { //Scale for Grouped + xGroupMax = bootcamps.map(function (camp) { return camp.mapping.reduce(function (a, b) { return a.value > b.value ? a.value : b.value; }); @@ -548,5 +347,5 @@ block content .text(function (d) { return d; }); + }); }); - });