GithubHelp home page GithubHelp logo

gbitocchi / browser-based-chat-application Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 161 KB

A simple browser-based chat application using Node.js

License: MIT License

JavaScript 6.63% HTML 7.24% CSS 12.75% TypeScript 73.38%

browser-based-chat-application's Introduction

Browser-based chat application

A simple browser-based chat application using Node.js

Requirements

  • Allow registered users to log in and talk with other users in a chatroom.
  • Allow users to post messages as commands into the chatroom with the following format /stock=stock_code
  • Create a decoupled bot that will call an API using the stock_code as a parameter (https://stooq.com/q/l/?s=aapl.us&f=sd2t2ohlcv&h&e=csv, here aapl.us is the stock_code).
  • The bot should parse the received CSV file and then it should send a message back into the chatroom using a message broker like RabbitMQ. The message will be a stock quote using the following format: “APPL.US quote is $93.42 per share”. The post owner will be the bot.
  • Have the chat messages ordered by their timestamps and show only the last 50 messages.

Bonus (Optional)

  • Have more than one chatroom. => DONE!
  • Unit test the functionality you prefer. => DONE!
  • Handle messages that are not understood or any exceptions raised within the bot. => DONE!

Installation

  • You must have installed node in your system.
  • Pull the repository in one folder of your choice.
  • You will need to install RabbitMQ:3-management (To manage the queues between the bot and the chat app) and MongoDB (To handle the users and passwords). The first one I did it with docker toolbox with the following command: docker run -d --hostname jobsity-rabbit -p 5672:5672 -p 8081:15672 --name jobsity_rabbit rabbitmq:3-management. On the other hand, for the MongoDB, I installed and setted up a local version on my machine.
  • Edit both environment files in the jobsity-chat folder and the jobsity-decoupled-bot folder to meet your environmental requirements. Every .env file explains itself its internal variables. image
  • Execute the command: npm install inside the jobsity-chat folder and the jobsity-decoupled-bot folder to install node_modules.
  • Once you do the previous points, you can execute jobsity-chat app and jobsity-decoupled-bot apps both with the command: npm run dev in each folder (open different terminals).
  • If you want to run the test, execute the command: npm run test in the jobsity-chat folder.
  • Now you have both apps running on your machine. You could enter the Jobsity-chat application in port 8000 by default. image
  • The last thing you will need is users. You have to create a collection called user in your jobsity database on MongoDB and add as many documents as users you want. The structure of the document is the following: image
  • When you enter the application, it will ask you for a room, enter any name you want. image

browser-based-chat-application's People

Contributors

gbitocchi 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.