/campusmap

Campus Map for Institut Teknologi Bandung

Primary LanguageJavaScriptMIT LicenseMIT

- c a m p u s m a p -

- by Muhammad Mustadi -

Finding coordinates of Institut Teknologi Bandung's rooms and buildings has never been this easy.

INSTALLATION

Tested on Node v6.3.1

  1. $ git clone PATH_TO_THIS_REPO this repository

  2. $ npm install

  3. $ node index.js

RESULT

init.js will provide results in data/ folder.

  1. database.js which will export (CommonJS) 5 things:
  2. buildings which is an array of building objects.
  3. floors which is an array of floor objects.
  4. rooms which is an array of room objects.
  5. polygonsOfFloors which is an array of floor objects, but instead of rooms they have polygons of each room in that floor.
  6. validatedPolygons which is an array of polygons fetched using the rooms of rooms array.
  7. db.min.json which contains buildings, floors, rooms, polygonsOfFloors, validatedPolygons in a JSON (not prettified) format.
  8. db${key}.min.json with one of the key from above, contains their value, respectively.

TODO

  • Map each floor in a building for its rooms.

  • API server

    • Rooms
    • Floors
    • Buildings
    • Floor Polygons
    • Room Polygons
  • Create Android Client

  • Create iOS Client

SERVER

Requires MongoDB

After running init, seed the Mongo database using server/seed.js or manually with the data from data/

Run $ node server/index.js.

Routes:

GET /rooms -> List all the rooms in JSON.

GET /rooms/name/:name -> Returns the rooms containing the name :name (using regex)

GET /rooms/id/:roomId' -> Returns the rooms with id :roomId

GET /floors -> List all the floors.

GET /floors/id/:id -> Returns the floors with id :id

GET /buildings -> List all the buildings

GET /buildings/name/:name -> List all the buildings containing name :name

GET /buildings/id/:id -> List all the buildings containing id :id

GET /floor-polygons -> List all the floor Polygons

GET /floor-polygons/id/:floorId -> Returns the floor polygons from floors with id :floorId

GET /v-room-polygons -> List all the Room polygons

GET /v-room-polygons/name/:name -> List all the RP with name :name.

GET /v-room-polygons/id/:roomId -> List all the RP with id :roomId.

OPTIONS / -> Gives the list of allowed request types.

HEAD / -> HTTP headers only, no body.

TRACE / -> Blocked for security reasons.

CONTRIBUTE

Reach me out here or just make a PR.

© Muhammad Mustadi - 2016