Terminal Chat
completedProject Overview
Go it's a "simple" nice language to work with, specially with web related things because of his great language features like go routines that make simple to manage threads, and his good standard library. So I built a small **terminal-based chat system**. It was an experiment to understand **how to manage WebSocket connections, rooms, and file transfers** — all without external frameworks.
The project consists of two main files:
-
server.go— a WebSocket chat server that handles:- user registration and disconnection
- message broadcasting to rooms
- joining/leaving chat rooms
- sending files between users
-
client.go— a simple terminal client that connects to the server via WebSocket and allows chatting and file sending (still minimal, but works).
The goal was to explore Go’s concurrency model (goroutines + channels) in a practical setting — where multiple clients interact in real time.
How It Works

When a client connects:
- It sends its username to the server.
- The server registers the user and assigns them to the default chat room.
- Messages are broadcast only to users in the same room.
Users can type commands like:
/list— list all available rooms/join roomname— move to another roomFILE:filename:size:receiver— send a file to another user
The server handles all communication through a Hub struct that orchestrates everything via channels.