๐Ÿ“ฆ irbekrm / Chat

Realtime chat app

โ˜… 0 stars โ‘‚ 1 forks ๐Ÿ‘ 0 watching
chat-roomexpress-jsjavascriptmongodbnodejssocket-io
๐Ÿ“ฅ Clone https://github.com/irbekrm/Chat.git
HTTPS git clone https://github.com/irbekrm/Chat.git
SSH git clone git@github.com:irbekrm/Chat.git
CLI gh repo clone irbekrm/Chat
Irbe Krumina Irbe Krumina header added to README fb3ecd6 7 years ago ๐Ÿ“ History
๐Ÿ“‚ master View all commits โ†’
๐Ÿ“ config
๐Ÿ“ controllers
๐Ÿ“ models
๐Ÿ“ public
๐Ÿ“ routes
๐Ÿ“ test
๐Ÿ“ views
๐Ÿ“„ .gitignore
๐Ÿ“„ .travis.yml
๐Ÿ“„ app.js
๐Ÿ“„ db.js
๐Ÿ“„ package-lock.json
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ server.js
๐Ÿ“„ README.md

Chat ===== Build Status

Description

Realtime chat app. Users can sign up, join a chat room, see who else is there and post and view messages in real time.

Use

Clone the repo https://github.com/irbekrm/Chat.git npm install (install dependencies) mongod start mongo server npm start (start the server)
Test
mongod npm test

User stories

  • A user can sign up / log in
  • A user can enter a chatroom and:
  • post a message
  • see dynamically updated list of users in chatroom
  • see all messages posted in real time

Learning Objectives

  • Understand the basics of websockets
  • Learn more about different connection models/patterns
  • Use GH Wiki and GH issues to improve workflow

Technologies

Node with Express and MongoDB for backend, plain JavaScript for frontend, Socket.io for the chat itself. API is tested using Mocha, Chai and Chai HTTP libraries, Travis CI is used for continuous integration.
Server- client connection
A mix of standard AJAX calls/ HTTP requests and Websockets connections. Messages related to user signup/login are sent using AJAX. Once a user enters a chat room a new socket connection is opened. State of a chat room- messages posted, users currently online - is then updated using the socket connection. When a user leaves a room, the connection is closed.
Users
User data is stored in a MongoDB database. Passwords are encrypted using bcrypt. JSON Web Tokens are used for user authorisation. When a user signs up/logs in they are issued a token that will be verified when they attempt to access a chat room.