6. Chat - rolling-scopes-school/RS-Short-Track GitHub Wiki

Deadline Folder Name Branch Coefficient
09.05.2018 23:59 chat-ui chat-ui 0.7

Your task is implement UI for chat.

  • Connection must be WS based.
  • You must use ws://st-chat.shas.tel as connection url.

Message should strictly follow protocol:

{
  from: String,
  message: String,
}

You always will receive an array of messages from server (when you first connected, and when somebody (includes you) send some message to server.

Message that you receive from server strictly follow protocol:

[{
  from: String,
  message: String,
  id: String, // unique id of message
  time: Number, // time when message has been received
},]

Note, that you can receive more than 1 message in Array (up to 100).

Requirements:

  • Nickname should be stored in LocalStorage and reused across app launches.
  • Components should be rendered fully by JavaScript (document.body is empty).
  • Please define a project structure and (optionally) use patterns if they will be needed.
  • You should implement reconnection mechanism
  • App should properly work in latest stable chrome

You can receive bonus point:

  • Add notifications for new messages (+10).
  • Display notification only when app is not visible (+10).
  • You should separately handle cases when app goes online/offline (+10);