Digital and mobile queue for events, which allows the interested parties to share the waiting time for more meaningful activities as standing the whole time in the real queue.
Mobile Ticket Queue (alpha testversion) on Google Play-Store
Mobile Ticket Queue as Browser App
Feel free to translate the i18n-Files by forking this repo and publish a pull-request.
- Client-Server
- Mobile-First
- Hybrid Client to take advantage of device-apis such as Vibrate or Background-Mode
Entity | Description |
---|---|
User | A User is identified primarily by his used device's id. He can have more than one device-id, but then he should use a password. Actually, we just want to know his username. |
Event | A Event represents a digital counter-desk for somewhat-ever kindful thing. On that digital counter-desk, User can issue tickets to be invited in the correct order of issuance. |
Ticket | A Ticket represents the promise to be called, when the ticket-holders turn will start. |
Client | A Client is the physical connection to the User's device. If the user is online, he has always a Client per used device as companion. If the User uses two or more Clients, such as a Mobile-Device and a Tablet-Device at the same time, there will be two Clients instantiated. All messages from and to the user go through his device's Client. Also, all messages are propagated to all Clients of the user. |
As it's a kind of CQRS-Application, new state comes from Events/Actions and is propagated to all subscribers
- No persistence (atm),
- Per Entity a Akka-Actor (Event => EventRegistryActor), could be regional shared (scaling)
- Hierarchical Supervision (EventRegistryActor owns per Event a TicketRegistryActor)
- Beyond, the UserRegistryActor as root-actor (could be outplaced or connected with a external user-service)
- As Facade per Websocket-Connection exists a ClientActor.
- HTML5-LocalStore to remember Device-ID and Username
- Not yet implemented Redux-Store.
Layer | Technology |
---|---|
Backend | Java8, Scala, Akka-http |
Api | Rest, Websocket over https/wss |
Frontend | Ionic3 / Angular4, Rxjs, Cordova |
State | Issued | Called | Skipped | Confirmed | Closed
Actor (Action) | | | | |
---------------|----------|----------|---------|--------------|--------
User subscribe
System ----------->O
System (Next n) 1)[O----------O]->O
2) O----------->O
3) O<---------------------O
User (confirm) O---------------------->O
User (skip) 1) O---------->O
2)[O----------O]->O
User (unsubscribe)[O----------O-----------O]---------------------->O
Statistic
---------------|----------|----------|---------|--------------|--------
Sums | Waiting | Accepted |
-----------------------------------------------------------------------
From \ To | Event Registry | Ticket Registry | User Registry | ClientActor | Web-Client | Protocol
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
Event Registry | | IssueTicket | EventCreated(*) | | | Akka
| **** | CloseTicket | EventUpdated(*) | | | Akka
| | EventUpdated | EventDeleted(*) | | | Akka
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
Ticket Registry | | | | TicketIssued | ** | Akka
| | | | TicketCalled | ** | Akka
| | **** | | TicketConfirmed | ** | Akka
| | | | TicketClosed | ** | Akka
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
User Registry | | | | UserAuthenticated | ** | Akka
| | | | UserAuthenticationFailed | ** | Akka
| | | | TicketIssuedPropagated | ** | Akka
| | | | TicketCalledPropagated | ** | Akka
| | | **** | TicketConfirmedPropagated | ** | Akka
| | | | TicketClosedPropagated | ** | Akka
| | | | EventCreated | ** | Akka
| | | | EventUpdated | ** | Akka
| | | | EventDeleted | ** | Akka
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
ClientActor | | | | | **>> | WS
| IssueEventTicket | TicketConfirmed | Authenticate(*) | | | Akka
| CloseEventTicket | TicketSkipped | TicketIssued(*) | | | Akka
| | | TicketCalled(*) | **** | | Akka
| | | TicketConfirmed(*) | | | Akka
| | | TicketClosed(*) | | | Akka
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
Web-Client | request all events | | request user-names | | | Rest
(Device-App) | getNextTickets | | | | | Rest
| addEvent | | | | | Rest
| updateEvent | | | | | Rest
| deleteEvent | | | | **** | Rest
| | | | HiImOnline | | WS
| | | | Subscribe | | WS
| | | | TicketConfirmed | | WS
| | | | TicketSkipped | | WS
-----------------|--------------------|-----------------|--------------------|----------------------------|----------------|---------
(*) Propagation via user to broadcast the event to all connected Clients
** Events, that are streamed to the Web-Client's Websocket
sbt -Dsbt.version=0.13.15 new https://github.com/akka/akka-http-scala-seed.g8