Build a Fully Functional Messaging Platform in 30 Minutes
Nick Parsons

Nick Parsons @nickparsons

About: Software Eng ➡️ Marketer

Location:
Boulder, CO
Joined:
Jun 29, 2017

Build a Fully Functional Messaging Platform in 30 Minutes

Publish Date: Feb 4 '20
100 2

Learn how to build a fully functional messaging platform using Stream's Messaging API in under 30 minutes!

The build uses the Stream Chat React Components, Create React App, and a few other libraries to get up and running quickly. Enjoy! :)

Comments 2 total

  • Saad Alem
    Saad AlemFeb 4, 2020

    What are the cons ?

  • Rishad Omar
    Rishad OmarSep 7, 2020

    Hi Nick, Do you have a link to the source in github?
    I've copied the code from your video but getting an error on server with 'updateUser()':

        const token = serverSideClient.createToken(username);
        console.log('Token for ' + username, token);
        try {
            await serverSideClient.updateUser({
                id: username,
                name: username
            }, token);
        } catch (err) {
            res.status(500).send("Error encountered updating user")
        }
    
    Enter fullscreen mode Exit fullscreen mode
    (node:68217) UnhandledPromiseRejectionWarning: Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
        at ServerResponse.setHeader (_http_outgoing.js:485:11)
        at ServerResponse.header (/home/rishad/projects/learn/group-messaging-demo/node_modules/express/lib/response.js:771:10)
        at ServerResponse.send (/home/rishad/projects/learn/group-messaging-demo/node_modules/express/lib/response.js:170:12)
        at /home/rishad/projects/learn/group-messaging-demo/server.js:38:19
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
    (node:68217) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)
    
    Enter fullscreen mode Exit fullscreen mode

    Discovered that I didn't have permission to create a Chat. printing out the error message in server.js is a good idea:

        } catch (err) {
            console.log("Error encountered updating user", err)
    
    Enter fullscreen mode Exit fullscreen mode

    Now getting the error:

    Both secret and user tokens are not set. Either client.setUser wasn't called or client.disconnect was called
        at TokenManager.getToken
    
    Enter fullscreen mode Exit fullscreen mode
Add comment