Skip to content

diagnosis/chat-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Chat App

A simple WebSocket-based chat application.

Features

  • Real-time messaging
  • Online users tracking
  • Message history (last 20 messages)
  • Join/leave notifications

Tech Stack

Backend: Go, Gorilla WebSocket
Frontend: Vanilla JavaScript, Tailwind CSS

Run Locally

go run cmd/server/main.go

Open http://localhost:8080

Project Structure

├── cmd/server/          # Entry point
├── internal/
│   ├── app/            # Application setup
│   ├── handler/        # HTTP & WebSocket handlers
│   ├── logger/         # Logging utility
│   └── ws/             # WebSocket logic (Hub, Client)
└── chat-frontend/       # SPA frontend

How It Works

  • Hub pattern manages all client connections
  • Go channels handle concurrency safely
  • Single-page application with custom router
  • WebSocket for real-time bidirectional communication

About

practicing channels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published