A pirate-themed terminal chat app built with Go, WebSockets, and colorful CLI screens.
Beginner-friendly to run, fun to demo, and simple enough to learn from.
CHAT-INIT is a real-time terminal chat project with:
- a Go server in
CHAT_INIT/ - a Go client in
CLIENT/ - WebSocket-powered direct messaging
- OTP-based signup and password reset support
- a playful pirate-style terminal interface
This repo is especially nice for:
- beginners who want to see a full client/server Go project
- developers learning HTTP + WebSockets together
- people who want a CLI project that feels more alive than a plain CRUD demo
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
- Real-time chat over WebSockets instead of fake terminal prompts
- Bright, styled CLI screens using Lipgloss
- Friend management built into the client flow
- OTP-based registration and password reset flow
- Small enough to understand, big enough to feel like a real project
CHAT_INIT/
├── CHAT_INIT/ # Main chat server
├── CLIENT/ # Main terminal chat client
├── test/ # Practice and experimental code
├── 1.png ... 8.png # Project screenshots
└── README.md
Main folders you’ll actually run:
CHAT_INIT/for the serverCLIENT/for the client
The test/ folder contains side experiments and practice code. It is useful for learning, but it is not the main app entrypoint.
- Real-time direct messaging
- Login with stored token support
- Friend requests, accept, reject, and delete flow
- Password hashing with bcrypt
- OTP email support for signup and password reset
- Terminal UI with multiple menus and styled output
Make sure you have:
- Go installed
- a terminal on macOS, Linux, or Windows
- a Gmail address with an App Password if you want OTP signup/reset to work
Check Go:
go versiongit clone https://github.com/anzydev/CHAT_INIT.git
cd CHAT_INITOpen terminal 1:
cd CHAT_INIT
go run .Important:
- on first startup, the server will ask for
GMAIL_USERandGMAIL_PASS - it stores them in
CHAT_INIT/.env - this is used for OTP email features
If you do not want to use OTP features yet, you can still learn the codebase, but the current server startup flow expects those values.
Open terminal 2:
cd CLIENT
go run .Inside the client:
- choose
1to log in - choose
2to register - choose
3to reset password - type
111to open friend management - choose a friend number to start chatting
- type
0to exit
CHAT-INIT uses Gmail SMTP for OTP delivery.
You need:
GMAIL_USER=your-email@gmail.comGMAIL_PASS=your-16-character-google-app-password
Example:
GMAIL_USER=your-email@gmail.com
GMAIL_PASS=your-app-passwordHow to get the password:
- Enable 2-step verification on your Google account.
- Create a Google App Password.
- Use that app password, not your normal Gmail password.
- handles login, signup, OTP, friend actions, and WebSocket chat
- stores users in
CHAT_INIT/database.json - validates tokens before allowing chat actions
- talks to the server over HTTP for login and friend actions
- opens a WebSocket connection for real-time chat
- stores the session token in
CLIENT/.env
- Go
- Gorilla WebSocket
- Charmbracelet Lipgloss
- bcrypt for password hashing
- JSON file storage for user data
- Gmail SMTP for OTP
Run the server:
cd CHAT_INIT
go run .Run the client:
cd CLIENT
go run .Format code:
gofmt -w CHAT_INIT/*.go CLIENT/*.go test/*.go test/client/*.go test/practis/*.goRun tests in the practice modules:
cd test
go test ./...That is expected on first run. Enter your Gmail address and App Password so OTP can work.
Make sure:
- the server is already running on port
4040 - you started the client from the
CLIENT/folder
Check:
- the Gmail address is valid
- the App Password is correct
- Gmail account security settings allow App Password usage
- You can trace a full feature from client input to HTTP route to WebSocket message.
- The codebase uses familiar Go packages and simple JSON storage instead of heavy infrastructure.
- It shows both networking and terminal UI in one project.
If you are new to Go, this is a good repo to practice:
- structs
- JSON encoding/decoding
- HTTP handlers
- WebSocket connections
- goroutines
- terminal UX
- persistent database instead of JSON files
- group chat rooms
- chat history
- better error messages in the client
- Docker setup
- tests for the main server/client flow
- GitHub: mikeyoni
- Discord:
@ui_mikey - Instagram:
@ui__mikey
This project is licensed under the MIT License. See LICENSE.







