Name: secret-map-dashboard
Owner: International Business Machines
Description: **work in progress**
Created: 2017-11-30 18:25:45.0
Updated: 2018-05-07 23:33:03.0
Pushed: 2018-05-07 23:33:02.0
Size: 30123
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Create a MongoDB instance with IBM Cloud
Export credentials in your environment
rt MONGODB_URL="<your_mongodb_url_found_in_ibmcloud>"
Encode your MongoDB's SSL certificate in base64 then export them in your environment
-n "<paste_your_certificate_here>" | base64
export MONGODB_CERT_BASE64=“
stall dependencies and Run the app
npm install
npm start
e app will run in `http://localhost:8080`
nit tests
e unit tests will look for a local MongoDB. You can start one easily with Docker.
docker run -d -p 27017:27017 –name local-mongo mongo
n the test script
npm test
top your MongoDB container: `docker stop local-mongo`
tart your MongoDB container back up, simply run: `docker start local-mongo`
ermanently delete the MongoDB container: `docker rm local-mongo`
Endpoints
ons
tting list of beacons: http://localhost:8080/beacons
tting a specific beacon: http://localhost:8080/beacons/:beaconId
ding a beacon: http://localhost:8080/beacons/add
ST request with JSON body
ple of adding a beacon:
curl -X POST -H 'Content-Type: application/json' -d '{ “beaconId”: “B01”, “x”: 1, “y”: 1, “minCount”: 0, “maxCount”: 100}' http://localhost:8080/beacons/add
hs
tting list of booths: http://localhost:8080/booths
tting a specific booth: http://localhost:8080/booths/:boothId
ding a booth: http://localhost:8080/booths/add
ST request with JSON body
ple of adding a booth:
curl -X POST -H 'Content-Type: application/json' -d '{ “boothId”: “A22”, “unit”: “swift”, “description”: “swift booth description”, “measurementUnit”: “metre”, “shape”: {“type”: “circle”,“cx”:5, “cy”: 5, “radius”: 10}, “contact”: “Jane Doe”}' http://localhost:8080/booths/add
hs
tting list of events: http://localhost:8080/events
tting a specific event: http://localhost:8080/events/:eventId
ding an event: http://localhost:8080/events/add
ST request with JSON body
ple of adding an event:
curl -X POST -H 'Content-Type: application/json' -d '{ “eventId”:“index”,“eventName”:“Index”,“location”:“San Francisco”,“startDate”:“2018-02-20”,“endDate”:“2018-02-24”, beacons: “B01,B02,B03,B04”, map:“A01,A02,A03,A04,A05,A06,A07”}' http://localhost:8080/events/add
cret-map-dashboard front-end
project was implemented using with [Angular 2 CLI](https://cli.angular.io/)
etting Started
cd containers/front-end npm install -g @angular/cli npm install npm start
lication will be served on http://localhost:4200_
roject Structure
mponents, directives and services are angular.js terminology
Componenets
mepage - landing page that shows endpoints for all conferences that are registered
in-dispaly - shows the event name, the event booth blocks with centered text ( which is the Map area componenet), and a footer that displays the total tally number of the distance traveled, the calories burned, and the fitcoins accumlated by conference attendees at a conference.
atmap - display a NxM grid that will display different gradients of color depending on the conference attendee's footsteps
p-area - displays the event booth blocks with centered text as well as a movement heatmap of the conference attendees
de-display - displays theme related images as well as a running count of the number of steps walked and the number calories burned by the conference attendees at the conference
shboard - contains Main-dispaly and Side-display componenets
o create a componenent run this commmand_ `ng generate component < component-name >`
Services
shboard service - handles all of the http requests towards the map-api server
o create a service run this commmand_ `ng generate service < service-name >`
Directives
p-area directive - handles the responsiveness of the size and positioning of the event booth blocks in regards to changing of the browser window's size
o create a directive run this commmand_ `ng generate directive < directive-name >`
yntax Checking
pm run lint` _(checks for typescript syntax)_
2E tests
pm run e2e`
nit tests
pm run test`
oT/Analytics dashboards
app will require a separate setup. Please check the iot-analytics-node-red-json folder for more information on how you can start using IoT as part of this project.