Centers for Disease Control and Prevention's Information Viewer (2004-2013)
This is an application built with ExpressJS and React/Redux that presents County Data Indicators regarding diabetes collected by the CDC between 2004 and 2013.
Returns paginated counties with no specific filtering.
-
URL:
GET /api/counties
-
Success Response:
- Code: 200
- Example content:
counties: { docs: [ { _id: "591b887662794d376bf85830", state: "Alabama", fipsCode: "01001", name: "Autauga County" }, { _id: "591b887662794d376bf85868", state: "Alabama", fipsCode: "01003", name: "Baldwin County" }, { _id: "591b887662794d376bf858a0", state: "Alabama", fipsCode: "01005", name: "Barbour County" }, { ... } ], total: 3224, limit: 25, page: 1, pages: 129 }
Searches counties containing a specific name (case-insensitive), and returns them in a paginated way.
-
URL:
GET /api/counties/search/:name
-
URL Params
name
: name, or part of a name, to filter counties with.
-
Success Response:
- Code: 200
- Example content:
counties: { docs: [ { _id: "591b887762794d376bf8aa83", state: "Florida", fipsCode: "12115", name: "Sarasota County" }, { _id: "591b887b62794d376bf97b6b", state: "Minnesota", fipsCode: "27037", name: "Dakota County" }, { _id: "591b887d62794d376bfa0493", state: "North Carolina", fipsCode: "37139", name: "Pasquotank County" }, { ... } ], total: 4, limit: 25, page: 1, pages: 1 }
Returns the specified county.
-
URL:
GET /api/counties/:id
-
URL Params
id
: id of the requested county.
-
Success Response:
- Code: 200
- Example content:
county: { _id: "591b887b62794d376bf97b6b", state: "Minnesota", fipsCode: "27037", name: "Dakota County", __v: 0, statistics: { obesityPrevalenceBySex: [ { year: 2009, maleNumber: 40455, malePercent: 29, maleLowerConfidenceLimit: 25.9, maleUpperConfidenceLimit: 32.4, maleAgeAdjustedPercent: 28.5, maleAgeAdjustedLowerConfidenceLimit: 25.5, maleAgeAdjustedUpperConfidenceLimit: 31.9, femaleNumber: 34579, femalePercent: 23.9, femaleLowerConfidenceLimit: 21.2, femaleUpperConfidenceLimit: 26.9, femaleAgeAdjustedPercent: 23.5, femaleAgeAdjustedLowerConfidenceLimit: 20.8, femaleAgeAdjustedUpperConfidenceLimit: 26.5, _id: "591b887b62794d376bf97b70" }, { ... } ], obesityPrevalence: [...], leisureTimePhysicalInactivityPrevalenceBySex: [...], diagnosedDiabetesIncidence: [...], diagnosedDiabetesPrevalenceBySex: [...], diagnosedDiabetesPrevalence: [...] } }
- Clone and cd into this repository
- run
npm install
(oryarn install
) - Export the environment variables
MONGODB_HOST
andMONGODB_PORT
(27017 by default), or alternativelyMONGODB_URI
. - Turn on your local mongodb server if that is the case.
- run
nodemon server/index.js
(turns on the backend server) - run
npm run startDev
(turns on the frontend development server)
# Pull and run the application and mongodb
$ docker run -d --name=mongo_db mongo:3.0.15
$ docker run -d --name=countydata -p 80:9000 --link=mongo_db:mongo_db sasalatart/county-data
# Setup the database
$ docker exec countydata npm run seed
The server's machine should now be redirecting its port 80 to the container's port 9000.
- Fork this repository
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'add my feature'
) - Push to your feature branch (
git push origin my-new-feature
) - Create a new Pull Request