Skip to content

Harvard University COMPSCI 2620: Introduction to Distributed Computing, Design Exercise 1

Notifications You must be signed in to change notification settings

KevenLi8888/wire-protocols

Repository files navigation

wire-protocols

Introduction

This is a client-server chat application using two different wire protocols communicating on TCP socket - a custom designed wire protocol, and a JSON-based protocol for better readability and interoperability. The application provides a complete chat experience with account management, real-time messaging, and message history features.

Features

Account Management

  • Create new accounts with email, username and password
  • Secure password handling (not transmitted and stored as plaintext)
  • Login with existing accounts
  • Delete account and all associated data
  • User search with substring matching

Messaging Capabilities

  • Real-time message delivery for online users
  • Message queueing for offline users
  • Configurable message retrieval (specify number of messages to fetch)
  • Message history with pagination
  • Message deletion (single or batch)
  • Unread message notifications

User Interface

  • Chat app style interface (similar to iMessage/WhatsApp)
  • Recent chats list with unread message indicators
  • Search users to start new conversations
  • Message grouping by chat conversations
  • Selection mode for batch message operations

Screenshots

Register page register Login page login Main chat page main chat New chat page new chat Receive messages receive_messages Messages received messages_received Delete messages delete_messages

Getting Started

Note: If you're grading the assignment, we provide a deployed version of the server for testing purposes so you don't have to create a MongoDB Atlas account. Please refer to the Canvas submission for the server IP address and port.

Install Dependencies

# Install required dependencies
pip install -r requirements.txt

Setup Database

Our server use MongoDB Atlas as a database. You can create a free account and get a connection string to connect to the database.

https://www.mongodb.com/atlas

Running the Server

Fill in the config-server.json file with your MongoDB connection information and run the server.

python -m server --config config-server.json

Running the Client

Fill in the config-client.json file with the server connection information and run the client.

python -m client --config config-client.json

Engineering Notebook

Link to Engineering Notebook

Including the following sections:

Wire Protocol Design

Database Design

User Flow Design

Testing

Thoughts & Future Work

Generative AI Usage Statement

About

Harvard University COMPSCI 2620: Introduction to Distributed Computing, Design Exercise 1

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages