Hubble Order manager is responsible for making sure that people know that their food is ready in Hubble.
Once an order is finished, the kitchen will cross the order off, this is propegated to the Star Community Project. This app receives a message from the Star Community Project. Alternatively, there is also a small webpage in this app where it is possible to put in custom orders. After an order has been received, it is propegated to Aurora to be displayed on the poster screens in the room. At the same time, the order is also display on the webpage associated with this app. This webpage can be visited by any customer of Hubble on their phone, where it will continue to receive live updates on new orders that are incoming. The flow is schematically described below.
The flow of the order after being finished by the kitchen
- Mobile first. The app must be usuable on your phone in terms of UI and UX, as this is primary source where people will look for their orders.
- Reliable. The app must be reliable and fault tolerant, to make sure the orders are always available for the customers.
- Real-time. The orders must be directly visible in all faucets of the app.
The system is built with Phoenix Framework in Elixir. At the heart of the whole is app is a Phoenix PubSub server. This handles all the events.
The order input and display are live views that subscribe and publish to the PubSub server. The will update the pages live to reflect the changes in real time. Phoenix/Elixir handle most of heavy lifting here.
Webhook verification is done to authenticate the Star Community Project, an signature of the body is verified according to the docs from Star Community.
There is also a subscriber that takes order creation events, and calls Aurora to add the order, this is done using the integration user from Aurora
Finally, there is a subscriber that schedules the removal of the order after it has been created. This also publishes these events, the live views listen for these and update their views as well. This also allows the order input to delete orders if necessary.
Authentication is done using a simple token, once authenticated another token is stored in the cookie.
- Live updating orders
- Backoffice for adding orders
- Order propegation to Aurora