This is a simple chat application built using Go and WebSockets. The application allows multiple users to send messages to each other in real-time.
- Real-time messaging using WebSockets
- Broadcast messages to all connected users
The project is organized into several packages, each responsible for specific functionalities:
handlers
: Contains the HTTP request handlers for different API endpoints.config
: Contains basic configuration for the Database.models
: Defines the data models used in the application.drivers
: Contains functions for establish a connection to database.helpers
: Custom package that contains all the constants.
-
Clone the repository Or Download:
git clone https://github.com/muthukumar89uk/go-chatapp-websocket.git
Click here to directly download it.
go mod tidy
- Run the Server:
go run .
- Create the users using the
http://localhost:8080/user
URL. - Websocket server will start on
ws://localhost:8080/ws
URL.