5. NodeJS chat - rolling-scopes-school/RS-Short-Track GitHub Wiki

Deadline Folder Name Branch Coefficient
12.12.2019 23:59:59 cli-chat cli-chat 1

Your task is to implement CLI for the chat.

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

A message should strictly follow the protocol:

{
  from: String,
  message: String,
}

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

A message that you receive from server strictly follow protocol:

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

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

Requirements:

  • Nickname should be stored in FileSystem and reused across app launches.
  • Please define a project structure and (optionally) use patterns if they will be needed.
  • You should implement reconnection mechanism
  • App should properly work in node v12.13.1

You can receive bonus point:

  • Add notifications for new messages (+20).
  • Store history in fs (+10).
  • Add telegram bot to chat (+40).
  • Bot send messages back to chat (+20).
  • Config file which contains config for colors (Date, From, Message) (+15).
  • Properly store token with .env file (+10)