Giter VIP home page Giter VIP logo

presence-firebase's Introduction

Presence

This app allows you to see who's currently in your office, flat etc. It works by looking for MAC addresses of devices connected to your router and sends this info to Firebase every few minutes. The web app connects to Firebase and displays up-to-date presence information.

screenshot

Setup

  1. Setup Firebase:

    1. Sign up for a free Firebase account and create a database.
    2. Go to "Security Rules" tab, click "Load Rules" button and select rules.json file.
    3. Go to "Data" tab and add users. You can check required schema in users.json file. You can add them by hand or modify users.json file and import it by clicking "Import JSON" button.
    4. Take note of your database URL and its secret, which can be found in "Secrets" tab.
  2. Run npm install to install all dependencies.

  3. Run grunt setup - this will ask you for your Firebase URL and its secret and generate the app into dist folder.

  4. Setup scanning script on your server:

    1. Copy generated scan_macs_dist.sh file to your server:

      scp scan_macs_dist.sh your-server:/usr/local/bin/scan_macs.sh

    2. SSH to your server and change owner of the script:

      sudo chown root:root scan_macs.sh

    3. Setup cron by running sudo crontab -e. It should be ok to run the script every minute:

      * * * * * /usr/local/bin/scan_macs.sh

    NOTE: The bash script uses curl and nmap commands, so make sure you've got them installed on your server.

  5. Open dist/index.html file in your favorite browser and you're done!

The configuration is saved into config.json file. You can change your database URL or authentication token there and then run grunt build to regenerate the app using the new configuration.

Deployment

The web app doesn't need any server - once you generate it you can simply open dist/index.html file in your browser and it will work.

However, you'll probably want to host it somewhere, so that it's available for others too. You can use e.g. GitHub Pages for that. To do it, fork this repo and run grunt setup deploy. You can also host it on a custom domain - just provide custom_domain during setup task.

License

Presence is released under the MIT License.

presence-firebase's People

Contributors

morgoth avatar qoobaa avatar schoblaska avatar szimek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.