Giter Club home page Giter Club logo

chatroom's Introduction

Simple CLI Chat Application Written in C!

sample-image

This CLI chat application got developed as part of the programming course 1 at the DHBW Stuttgart and is based on the MQTT protocol.

Build

Build CMakeLists.txt as CMake project. The .exe file is then located in out/build/x64-Debug/chatroom.exe and can be executed from there. Required .h, .lib and .dll files get added to the right folders and get linked accordingly.

Features

The CLI application allows users to chat with multiple other users in various chatrooms. After selecting a username at start-up, the user connects to the default chatroom and they can start chatting. Own messages are colored in red while doing so.

Some simple commands are also available for users. Commands are generally initiated with a starting !:

Command Description
!help Shows all available commands.
!logout Logs out the user.
!switch ROOMNAME* Changes the chatroom.

*Chatroom names aren't predefined and can freely be chosen

The application currently connects to a public server to allow connecting at any time hence please do not use it for sensitive information!

Implementation

Project is build using CMake.

The CLI application is fully written in C and uses the Eclipse Paho C Client Library for the MQTT Protocol. The libraries enable applications to connect to an MQTT broker to publish messages, subscribe to topics and receive published messages.

Chatrooms of this application are based on MQTT topics. MQTT Topics allow multiple clients to communicate with each other, if they are subscribed to the same topic and can consist of one or more topic levels.

In this context all chatrooms can freely be chosen and are at topic level 1 while being unified with an unique topic identifer at topic level 0. Users can join only one chatroom at a time with the help of !switch ROOMNAME instead of multiple ones to ease the useabilty due to the project scope. In terms of MQTT, clients unsubscribe their current chatroom and then subscribe to the new one when they try to switch a room.

Furthermore it is required to use a CLI with ANSI escape sequences support to enable coloring.

The client currently connects to a public broker hosted by HiveMQ.

chatroom's People

Contributors

j-c-v avatar hesoyam01 avatar

Watchers

 avatar Lilian avatar  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.