Code Monkey home page Code Monkey logo

chattyapp's Introduction

ChattyApp

A minimal and light chat application.

Usage

Install dependencies with npm install.

npm install

Run the websocket server.

node chatty_server/server.js

Run the app server and visit the homepage in your browser.

npm start
open http://localhost:3000

Static Files

You can store static files like images, fonts, etc., in the build folder.

For example, if you copy a file called my_image.png into the build folder, you can access it using http://localhost:3000/build/my_image.png.

Linting

This project includes React ESLint configuration.

npm run lint

Dependencies

chattyapp's People

Contributors

atsosie avatar monicao avatar kvirani avatar

Watchers

James Cloos avatar  avatar

chattyapp's Issues

First message gets sent but never displays on front end.

When a new client connects, the first message submitted doesn't display. The message event is triggered and evidence of this is logged to the console for both client and server, so the connection is good. Why does only the second (and later) message show?

This started happening after I implemented the user count feature. After setting up that feature, I deleted the "initial state" message in chatty_server that used to be broadcast upon connection:

wss.on('connection', (ws) => {
    let message = {
        type: 'initialState',
        content: '',
        username: ''
    }
    broadcast(message);
}

Currently, instead of sending this message, the userCountUpdate message is sent.

Improve the way event handlers work in ChatBar

When user changes his name, the postNotification only sends after he hits enter. If user changes his name (without hitting enter), then enters a new message, then hits enter, postNotification is not sent. This is proper behavior according to the code, so it's not a bug, but it could be better.

Improve error handling

Some errors are handled on the back end, but not comprehensively. No error handling on front-end. Add flash messages for better user experience.

Preserve data after client disconnects.

Right now, refreshing the page means you lose all chat history and user info. Setup user accounts and some way to preserve data (how much data? which data? for how long?)

Allow users to see chat history?

New users can't see messages sent before they entered the chat. I think this is common for chat apps like Kik or What's App, but iMessage and Slack allow this. Research how, why, and why not.

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.