- Ensure IndoorAtlas positioning has been successfully deployed
- Create a new project on Firebase, e.g., "YOUR_ASSET_TRACKER_DEMO".
- Create a Mapbox access token and set it in
public/config.js
(seeconfig.js.example
) - Also set your cloud functions URL in
public/config.js
- Run in this folder
npm install -g firebase-tools
firebase login
- Associate this folder with the new Firebase project
firebase use --add
- select YOUR_ASSET_TRACKER_DEMO from the list
- alias: type "default"
cd functions && npm install
- Get a Firebase Service Account key
and download it as
function/serviceAccountKey.json
(which is gitignored) firebase deploy
First choose an IndoorAtlas API_KEY with positioning API scope enabled.
Point the agents to use the endpoint
https://us-central1-YOUR_ASSET_TRACKER_DEMO.cloudfunctions.net/api/$API_KEY
so that they PUT locations to
https://us-central1-YOUR_ASSET_TRACKER_DEMO.cloudfunctions.net/api/$API_KEY/report/$AGENT_ID
Then the agents related to that API_KEY can be inspected in the web address
https://YOUR_ASSET_TRACKER_DEMO.firebaseapp.com/#$API_KEY
This project uses IndoorAtlas positioning API through Firebase functions, which needs a paid Firebase plan ("Flame"), because Firebase does not let one use external cloud services with a free plan.
Authentication is based on IndoorAtlas API keys: A new Firebase user is created
for each API key (see public/custom-auth.js
and the /auth
resource) and
Firebase ensures that the users can only access the data associated with the
API key they provide in the when viewing the app. If the user does not know a
valid API key, the cannot access any data.
However, the API key is the only secret part of the system and knowing it gives
- Access to IndoorAtlas Positioning API
- read floor plan and venue data on the account
- ability to radio-locate oneself in the mapped areas of the account
- Ability to read all agent locations reported using the same API key
- Ability to report one's location as a new agent
- Ability to impersonate any agent reporting with the same API key
In particular, there is not agent-specific authentication so using this demo backend in production is not recommeded without implementing more sophisticated access control.