Code Monkey home page Code Monkey logo

quaranchat's Introduction

🏠🏠quaranChat🏠🏠

Chat with friends when staying at ~.

This project is currently being developed for the Tecnologie Internet course @Università di Parma. We're using PeerJS and React to build a P2P chat app based on WebRTC.

Main features

We developed the web app with performance, security and responsiveness in mind. It is strictly tied to the PeerJS APIs, which we use to make videocalls, send text messages, and ping the peers. Let's have a quick overview over the components that were required to build the app.

PeerJS

When a user logs in, we generate a peer through the official PeerServer. We then tie its ID to a username in our login server, so that other users can search him by his username, not his Peer ID. This enables us to establish multi-session chats: once a user has a chat open with a friend, the ID is automatically updated by the login server.

User interface

We used the beautiful Material-UI components to build our UI. The library contains most of the UI components a developer will ever need, including grids, TextFields, themes, buttons. Not to mention it is also blazingly fast!

react-chat-elements

Some components of the UI were obviously missing from Material-UI. react-chat-elements contains what we needed. We used this library to get message boxes and chat lists.

Requests to the REST API

We used Axios to execute async requests to the APIs.

Password hashing

Saving passwords in plain text is so 1990. We decided to use bcrypt, a universally trusted hashing algorithm, available through a lightweight npm module.

Persistency

No one wants to lose its chats when closing a web app. We decided to save chats data in the local storage, enabling a user to just enter the password and login. Beware: the chats are not encrypted, so use Incognito Mode if you're working on a public workstation.

Username server

We built a login server using Node.js and Express which tracks associations between peer.js IDs and our usernames. You can find it here.

Course notes

You can find the course notes here.

How to run

Clone the repository, and install the npm modules like you always do:

npm install

You can then run

npm start

To run the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GPL License. See LICENSE for more information.

quaranchat's People

Contributors

montali avatar belericks11 avatar

Watchers

James Cloos 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.