Giter VIP home page Giter VIP logo

replication's Introduction

Client-Server Chat Application

Authored by Adarsh Hiremath and Andrew Palacci

OverviewSetupHow to Use

Key Features

  • We implemented an end- to-end client-server chat application, first with our own wire protocol and later with gRPC.
  • As currently implemented, our chat application supports the following:
    • Account creation, login, deletion, and disconnection.
    • Sending messages between accounts, even when some accounts are offline.
    • Listing or filtering all users who have created accounts.
  • The source code for our chat application can be found in the main directory here. The gRPC implementation is in grpcApp.
  • We have done extensive manual unit testing, as documented in tests.txt
  • You can also find our project writeup at template.pdf

Setup

To clone and run this application, you'll need Python. We have a list of requirements which you can find in the requirements.txt file. To install these requirements, run the following in your command line:

$ pip3 install -r requirements.txt

Next, you'll need to set the appropriate IP address and port number in server.py and client.py (for both the regular implementation and the gRPC implementation).

Run the following command to get your private IP address (on wireless networks):

$ ipconfig getifaddr en0

Run this command for wired networks:

$ ipconfig getifaddr en1

Finally, turn off your Firewall so that your machine can accept incoming network connections.

How to Use

First, run server.py <IP> <PORT> using the IP you found above, and then using a port of your choice. In order to ensure 2-fault tolerance, we must do this using 3 different ports (e.g. 3 different machines). This can also be done by running server.py with a test flag --- server.py test. Finally, run client.py <IP> <PORT1> <PORT2> <PORT3> on all the machines you want to be clients, with the 3 ports representing each of the replica machines.

Congratulations! You've now established a connection between your client and server. You can begin making commands by using the following usage.

Syntax Description
Usage: c | <username> Create an account.
Usage: l | <username> Log into an account.
Usage: u List all users and their activity status.
Usage: s | <recipient_username> | <message> Send a message to a user.
Usage: d | <confirm_username> Delete an account.
Usage: f | <filter_regex> Filter accounts using a wildcard.
Usage: h Print a list of all the commands.

replication's People

Contributors

adarsh-hiremath avatar andrewp2303 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.