ljungmark / eggup-node

🥚 Node, websockets, audio context, l10n, RFID client, DOM node toggles, feGaussianBlur & feColorMatrix filters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eggup Node

Documentation

Changelog | Contributing | License: CC BY-NC-SA 4.0 | Privacy | TOS

About the app

This app is used by the office to order eggs in the morning.

Modules

  • Init
    • Loads cache or creates new one
    • Loads thread or creates new one
      • Performs synchronization to fetch the latest application state
    • Sets input threshold
  • Order
  • Review
  • Cooking
  • Docket

Technical

State management

The application has a local storage cache and application thread. The purpose of the thread is to keep a application state so even if a user reloads their applicaiton, the state will be persitent. On each load, a syncronization with the server is performed, providing the latest state to the client.

Cache

Key Type Values Default value Description
variant String 1, 2 1 What variant does the user perfer
quantity Integer 1, 2 1 What quanity does the user perfer
notify Boolean TRUE, FALSE TRUE Receive sound notifications

Thread

Key Type Values Default value Description
tokenstamp [DEPRECATED] Date DATE, NULL NULL At which date was the user's order requested
variant Integer 1, 2, NULL NULL User's perfered variant
quantity Integer 1, 2, NULL NULL User's perfered quantity
heap_1 Integer 0-N 0 Egg pool for soft boiled eggs
heap_2 Integer 0-N 0 Egg pool for hard boiled eggs
gateway Boolean TRUE, FALSE TRUE Can new orders be requested?

Environment

The application is runned on a Ubuntu machine with Nginx and Process Manager 2. Given that there are other applications (that is not built on Nodejs) on the same IP address, a reverse proxy is utilized for routing.

Settings

Debug console

We print all server respones in the JS console, append ?debug=true to the URI.

UI Sounds

eggup.settings('notify', false);

Turn on or off the UI sounds for your device. This setting is not cross-device. If this is set to true, the app will send a sound notification when your eggs are done (when soft boiled are done if that's what you chose, or when hard boiled are done if that's your perference). As a controller, you'll always get a sound for both soft- and hard boiled eggs.

Internationalization and localization

eggup.i18n('set', 'en');

Will change the application language internally. 'sv' and 'en' available.

eggup.i18n('get', 'pointer.to.key');

Will get a translated string from the langmap.

eggup.i18n('update');

Will update the DOM with whatever language is chosen internally. Is called within 'set'.

Login

Navigate to /login to login with your social media account.

The following services are available:

  • Facebook
  • Twitter
  • Instagram [DEACTIVATED]
  • Spotify
  • Github
  • Steam
  • Reddit
  • Google+ [DEACTIVATED]
  • LinkedIn

Logout

Navigate to /logout to logout from the application.

Hotkeys

Eggup listens to hotkeys to perform actions. The actions differ depending on the current module.

Kiosk setup

Provide details in wpa_supplicant configuration file:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Edit with content from autostart file:

sudo nano ~/.config/lxsession/LXDE/autostart

Reboot:

sudo reboot

Module: Order

Set to one soft-boiled: 1+1 or 1+L

Set to one hard-boiled: 1+2 or 1+H

Set to two soft-boiled: 2+1 or 2+L

Set to two hard-boiled: 2+2 or 2+H

Confirm/send order: Space or Return

Module: Review

Revert order: Backspace

Konami

p+a+r+t+y

s+n+o+o+k

About

🥚 Node, websockets, audio context, l10n, RFID client, DOM node toggles, feGaussianBlur & feColorMatrix filters


Languages

Language:JavaScript 58.3%Language:HTML 22.6%Language:CSS 19.1%