Code Monkey home page Code Monkey logo

chatter's Introduction

Chatter Coding Challenge ๐Ÿค– ย  hard time

ย 

Goals / Outcomes โœจ

  • To test knowledge of using sockets (socket.io) and events
  • Understanding of callbacks, hooks and function references

ย 

Pre-requisites โœ…

None

ย 

Requirements ๐Ÿ“–

Most of the work needs to be done in the Messages components.

  • Implement hooks such as useEffect and useCallback to handle events
  • Scroll to the bottom of the messages list when sending/receiving a message
  • Show the initial Botty message by default (can be found in common/constants)
  • Use sockets to:
    • Send the user's message to Botty
    • Show a typing message when Botty is typing
    • Handle incoming Botty messages and display them

ย 

Botty Socket Events

See the Botty server documentation for more information.

  • bot-typing: Emitted by Botty when they are typing in response to a user message.
  • bot-message: Emitted by Botty with a message payload in response to a user message.
  • user-message: Emitted by you/the client with a messsage payload

ย 

Message Classes

We've provided Message components and classes. Here's some information about the classes.

  • .message--last: The last message in a group
  • .message--typing: The message the user sees when the recipient is typing
  • .message--me: Denotes a user message

ย 

Think about ๐Ÿ’ก

  • References to functions and current hook state
  • How to interact with socket.io, events and payloads
  • How React contexts work

ย 

What's Already Been Done ๐Ÿ

  • Socket setup/configuration with the Botty server (botty.alexgurr.com)
  • All UX and UI, including for messages
  • All components, including a message and typing message component
  • A context for setting the latest message, which will change the preview in the left user list
  • Hooks for playing send/receive sounds

ย 

Screenshots ๐ŸŒ„

ย  screenshot-desktop screenshot-mobile

chatter's People

Contributors

cdvx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.