Minichat

Introduction

Once I wanted to send a piece of text from one computer to another, but found that such a simple requirement didn’t have a straightforward tool. I asked ChatGPT, summarized the existing tools, and found that none of them were very useful.

MethodDisadvantages
AirdropCreate a file and search for devices
iMessageLog in to Apple account
Universal ClipboardLog in to Apple account
WeChat/QQLog in to two accounts
EmailWhat era is this?

So why not write a chat room, and you can send it directly by accessing the webpage, using Cursor to develop is also very enjoyable. The chat room also made some simple adaptations for mobile devices, and the service is deployed on the Alibaba Cloud Guangzhou node, with a very fast access speed.

Minichat

https://minichat.kugarocks.com

Github Repository

kugarocks/minichat

Themes

When the service starts, you can specify the theme, and the default is Minions.

go run main.go -theme minions

Minions

NameAvatar
Stuart, KevinStuart Kevin
Bob, DaveBob Dave
Jerry, PhilJerry Phil
Tim, MarkTim Mark

One Piece

NameAvatar
Luffy, ZoroLuffy Zoro
Nami, SanjiNami Sanji
Robin, FrankyRobin Franky
Chopper, UsoppChopper Usopp
BrookBrook

Keywords

Keywords are also very simple, just define the technology stack you use, and modify it step by step according to your needs. However, the keywords below are only a small part, because the entire process also includes a lot of details and optimizations, which are not expanded here.

* Implement a simple real-time chat room
* Server-side uses Golang, Websocket
* Client-side uses web pages
* The left side of the web page displays the list of online users
* Automatically generates a username when the web page is opened
* The username is randomly selected from the roles of the Avengers
* Cannot select duplicate usernames
* The total number of usernames is 20
* The bottom right of the web page is the message input box
* The message input box supports multi-line input
* The message input box can be resized by dragging
* The chat message window supports multi-line display
* The chat content is surrounded by a border
* The username is placed outside the border, above
* A copy button is added to the top right of the message border
* After clicking the copy button, the text changes to "Copied"
* 1 second later, it returns to the original text
* The message input box and chat message window are separated by a line
* You can drag up and down to change the size of the two windows
* The style of the page is changed to a terminal style
* The color of the username is green
* Other colors use black, white, and gray