Giter Site home page Giter Site logo

rooms's Introduction

Meeting Room Display

Meeting Room Display

This is a side project we built at Aerolab to show which meeting rooms are currently available (and for how long), as well as giving you the ability to anonymously book them for 30' with a single tap. This is all based on Google Calendar in a typical Google Apps for Business package.

The motivation behind this is that most meeting room software is needlessly complicated (and expensive!), so we built exactly what we needed as a Web App, which is then deployed to a bunch of cheap Fire HD 8 tablets using a headless web browser. It's simple, it works well to let people know that they shouldn't use a specific meeting room, and it looks kind of cool.

Setup & Config

This is a standard Node.js project, so you just need to run npm ci to install the dependencies and npm run dev to start development mode with live reload. Run npm run build and then npm start to run the app in production mode.

This is the most complicated step, as you are going to need to add two JSON files to make things work: A Google Credentials File, and a list of Meeting Rooms (also known as Resources in Google Calendar).

Google Credentials

Go to the Google Developer Console and create a new Project. After that's done, you need to do a few more things:

  • From the Library menu, you need to Enable the Google Calendar API (use the search if it's not in the popular list)
  • From the Credentials menu, Create a Service Account, and select JSON as the key type. Save this file as you'll need it in a while.
  • Take note of the Service Account ID as well (it looks like accountname@(...).iam.gserviceaccount.com)
  • Rename the JSON key file to rooms-client.json and place it in the root of the project.

Configure the supported Meeting Rooms

Go to Google Calendar and click edit on each meeting room calendar. For each one of them do the following:

  • On the Calendar Details tab, Take note of the Calendar ID (it looks like [email protected]).
  • Under the Share this Calendar, Share it with the Service Account ID (add accountname@(...).iam.gserviceaccount.com to the calendar and give it full access)

After you've done that, you need to Create a rooms.json file in the root of the project detailing all the enabled rooms, their names and Calendar IDs, using a slug as the key. It should look like this:

{
    "lounge": {"name": "Lounge", "slug": "lounge", "position": "right", "id": "[email protected]"},
    "super-room": {"name": "Super Room", "slug": "super-room", "position": "left", "id": "[email protected]"},
}

The position just shows where the room is located relative to the display. The only options are left or right.

Using the app

Open a browser on http://localhost:3000/room-slug (not literally, replace room-slug with the proper room key, like lounge or super-room). You should be able to see the current status of the room and book it.

Deploying

We provide a Dockerfile, which you can easily use on Now, or any other service you prefer. We are not using any sort of authentication or env variables as this is a quick internal project, but you're free to add some sort of auth if you want.

License

MIT, of course.

rooms's People

Contributors

robertogonzalez avatar torresandres 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  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  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  avatar  avatar  avatar  avatar

Watchers

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

rooms's Issues

Links don't work on simple online server

Hi,

I'm not at all familiar with making a node & react app working on a server online. Everything works fine locally with npm run dev but when I make the build and upload the dist folder and the api folder then I reach a url like mydomain.com/my-room-slug it doesn't work : I get a 404.

Thanks for your help

Background colour favicon.ico isn't referenced?

I can't seem to get the favicon.ico to appear as the background colour. The favicon changes on my browser, but the background colour is black whether it's booked or available. Can't see the favicon.ico being referenced in the css files either. Any ideas how to get it to work? Great project by the way, thanks for supporting open source.

Any chance it would be updated?

I managed to make it work eventually, but I get only "Cargando..." message and cannot interact with it in any way.

I have no idea how the code works, but still in big need of finding a solution for booking conference rooms.

Calendar Help!

Thank you very much for this repo, I think it will help me and my team out immensely.
I'm having issues seeing the details of the events in a particular calendar. It seems as though when you try and share the calendar with the service ID it only gives you the options to see busy/free rather than full permissions.

I wondered if you had this problem and if so how you overcome it?
I had to set up a role for our service account which is set up as 'owner' and we still can't see information about an event on the service.

Any help much appreciated.

Cannot find module './rooms.json'

So sorry to bother you with this, but it's the first time I am using any command line at all, so some instructions are not exactly clear to me. I keep getting Error: Cannot find module './rooms.json', probably because I failed to create rooms.json properly. I just created a text file with the code in instructions and changed the type to .json. Is there any way you could just send this file, so I put the IDs in it?

Thanks in advance, I hope you can help me.

google-auth-library problem

Hi, since yesterday i have this problem, nothing changed on my side, was working fine till now.

> [email protected] start
> NODE_ENV=production node server.js

API available at port 8184
/home/virtual/rooms-new/rooms-bak/node_modules/google-auth-library/lib/transporters.js:85
        err = new Error(body.error.errors.map(
              ^

Error: Internal error encountered.
    at Request._callback (/home/virtual/rooms-new/rooms-bak/node_modules/google-auth-library/lib/transporters.js:85:15)
    at Request.self.callback (/home/virtual/rooms-new/rooms-bak/node_modules/request/request.js:185:22)
    at Request.emit (node:events:390:28)
    at Request.<anonymous> (/home/virtual/rooms-new/rooms-bak/node_modules/request/request.js:1161:10)
    at Request.emit (node:events:390:28)
    at IncomingMessage.<anonymous> (/home/virtual/rooms-new/rooms-bak/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (node:events:509:28)
    at IncomingMessage.emit (node:events:402:35)
    at endReadableNT (node:internal/streams/readable:1343:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 500,
  errors: [
    {
      message: 'Internal error encountered.',
      domain: 'global',
      reason: 'backendError'
    }
  ]
}

Problem with JWT / GoogleToken

Hello,

I'm trying to run Docker version of the rooms app but without success.

When I try to open http://127.0.0.1:3000/lounge or http://127.0.0.1:3000/api/rooms/lounge it throws this error:

> [email protected] start /usr/src/app
> NODE_ENV=production node server.js

API available at port 3000
(node:20) UnhandledPromiseRejectionWarning: Error: No key or keyFile set.
    at GoogleToken.getToken (/usr/src/app/node_modules/gtoken/lib/index.js:52:16)
    at /usr/src/app/node_modules/google-auth-library/lib/auth/jwtclient.js:137:21
    at JWT._createGToken (/usr/src/app/node_modules/google-auth-library/lib/auth/jwtclient.js:226:12)
    at JWT.refreshToken_ (/usr/src/app/node_modules/google-auth-library/lib/auth/jwtclient.js:133:15)
    at JWT.OAuth2Client.getRequestMetadata (/usr/src/app/node_modules/google-auth-library/lib/auth/oauth2client.js:284:15)
    at JWT.getRequestMetadata (/usr/src/app/node_modules/google-auth-library/lib/auth/jwtclient.js:79:52)
    at JWT.OAuth2Client.request (/usr/src/app/node_modules/google-auth-library/lib/auth/oauth2client.js:379:15)
    at Object.createAPIRequest [as default] (/usr/src/app/node_modules/googleapis/lib/apirequest.js:151:26)
    at Object.list (/usr/src/app/node_modules/googleapis/apis/calendar/v3.js:1042:40)
    at Promise (/usr/src/app/api/calendar.js:65:21)
(node:20) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:20) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

How to create calendar entries?

Hey there,

great project! We will extend it with multi-localization / i18n soon to contribute back to it. One question that we have in the meantime is how to exactly add new calendar entries from remote / via calendar invitation. We tried sending an event invite to our service account email address, but it doesn't appear on the rooms app.

Thanks in advance!

UnhandledPromiseRejectionWarning: Error: Can't set headers after they are sent.

After building Docker image...

docker run -p 3000:3000 rooms

> [email protected] start /usr/src/app
> node server.js

Starting Webpack compilation...
API available at port 3000
Compiled successfully in 3409 ms.
(node:17) UnhandledPromiseRejectionWarning: Error: Can't set headers after they are sent.
    at validateHeader (_http_outgoing.js:491:11)
    at ServerResponse.setHeader (_http_outgoing.js:498:3)
    at Object.handleRangeHeaders (/usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/lib/Shared.js:71:8)
    at processRequest (/usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/middleware.js:63:22)
    at Object.ready (/usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/lib/Shared.js:159:29)
    at Object.handleRequest (/usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/lib/Shared.js:202:10)
    at /usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/middleware.js:44:11
    at new Promise (<anonymous>)
    at webpackDevMiddleware (/usr/src/app/node_modules/nwb/node_modules/webpack-dev-middleware/middleware.js:43:10)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3)
    at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12)
    at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13)
    at /usr/src/app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12)
    at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)
    at /usr/src/app/node_modules/connect-history-api-fallback/lib/index.js:73:5
(node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

There were a few dependency warnings:

warning "node-google-calendar > [email protected]" has unmet peer dependency "request@^2.34".
warning "request-promise > [email protected]" has unmet peer dependency "request@^2.34".
warning " > [email protected]" has unmet peer dependency "request@^2.34".

I fixed the errors by switching all ^s to ~ in package.json and added

"request-promise": "~4.2.2",
"request":"~2.34.0"

However, these dependency updates didn't make any difference on the UnhandledPromiseRejectionWarning exception.

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.