Skip to content

BroKisD/Chat_room

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chat Room Application

A feature-rich chat room application written in Go. It provides real-time messaging, file transfer, end-to-end encryption, emoji support, user sessions, and a desktop GUI built with the Fyne framework.

Report for details here

Project Structure

chatroom/
├── cmd/                    # Application entrypoints (server & client)
├── internal/               # Private application code (client, server, networking)
├── pkg/                    # Public libraries/helpers
├── assets/                 # Static resources (images, icons)
└── uploads/ downloads/     # File transfer storage

Application Construction

  • Server: implemented under cmd/server and internal/server, accepts client connections, routes messages, manages users and file transfers.
  • Client: implemented under cmd/client and internal/client, provides the GUI, handles user input, encryption, and file transfer logic.
  • Shared: protocol definitions and utilities are in internal/shared (message formats, encryption helpers, models).
  • GUI: Desktop GUI uses the fyne toolkit (see internal/client/gui).

Setup & Run Instructions

  • Prerequisites:

    • Go: 1.21 or newer installed and on your PATH.
    • Git: to clone the repository (optional if you already have the workspace).
  • Install Go module dependencies (from project root):

go mod download
  • Run server (development):
go run cmd/server/main.go
  • Run client (development):
go run cmd/client/main.go

List of Necessary Dependencies

  • Go toolchain: go (version 1.21 recommended).

  • Primary modules (declared in go.mod):

    • fyne.io/fyne/v2 (GUI toolkit)
    • Other modules are used indirectly by Fyne and for utilities; run go mod tidy and go mod download to fetch them.
  • Optional / environment:

    • A desktop environment for the GUI client (X11 / Wayland on Linux).
    • Network connectivity between client and server hosts.

Login page (GUI image)

Login Page

Main GUI (after login)

Main GUI

Demo video

Click below to download or view the demo:

Computer_Networks_Demo.mp4

Quick Troubleshooting

  • If you see missing module errors: run go mod tidy then go mod download.
  • If the GUI doesn't start on Linux, ensure you have a graphical session and display drivers installed; run the client from a desktop session (not a headless SSH session) or use X11 forwarding if necessary.

Server flags & configuration

  • The server binary accepts two optional flags (set when starting the server):

    • -n : Generate a NEW room key and delete any existing save state files (room.key, server_state.json).
    • -o : Use an existing room key if available (default behavior when present).
  • Example: start a fresh server with a new room key:

go run cmd/server/main.go -n
  • The server listens by default on TCP port 9000. This is configured in cmd/server/main.go where server.New(":9000") is used; if you need to change the port, edit that file or build a small wrapper.

State & Storage Files

  • room.key — symmetric room key used for message encryption; generated by the server and stored in the server working directory.
  • server_state.json — serialized server state (connected users, file transfers, etc.).
  • uploads/ and downloads/ — local folders used by the server/client for storing transferred files (in the repository root).

Client connection behavior

  • The GUI client will attempt to connect to :9000 (localhost port 9000) by default. The connection address is hard-coded in the GUI at internal/client/gui/gui.go in the login dialog (a.client.Connect(":9000")).
  • To connect to a remote server, either run the client on the same host (with port forwarded), or change the address in internal/client/gui/gui.go (or extend the client to accept a CLI flag or environment variable).

Usage examples

  • Start server (reuse existing key/state if present):
go run cmd/server/main.go
  • Start server (create fresh room key & state):
go run cmd/server/main.go -n
  • Start client GUI (connects to localhost:9000):
go run cmd/client/main.go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages