Go Chat Application
This Go chat application provides real-time communication between users through websockets. It's built using the Go programming language and leverages the gorilla/websocket
package for managing websocket connections. The application is designed to be simple, efficient, and easy to deploy and run.
Features
- Real-time chat communication.
- Simple and intuitive user interface.
- Supports multiple users simultaneously.
Prerequisites
Before you run or deploy the chat application, ensure you have the following installed:
- Go (version 1.13 or later recommended)
- Access to a terminal or command line interface
Getting Started
To get the chat application running locally, follow these steps:
-
Clone the repository
First, clone this repository to your local machine using Git.
git clone https://github.com/matheuspolitano/chat-app-go.git
cd chat-app-go
-
Run the application
From the root of your project directory, run the application using the go run
command. This will start the server on the default port 8080
.
go run main.go
Optionally, you can specify a different port by providing it as an argument:
go run main.go 8081
-
Access the chat application
Open your web browser and go to http://localhost:8080
(or the port you specified). You should see the chat application's user interface.
Deploying to a Server
To deploy the chat application to a server, follow these general steps. Note that specific steps may vary based on your hosting provider and server configuration.
-
Build the application
Compile your application to a binary for your server's OS and architecture.
go build -o chat-app
-
Transfer the binary and resources
Transfer the compiled binary and any necessary resources (like the public
directory, if you have a frontend component) to your server.
-
Run the application
On your server, start the application. You might want to use a process manager like systemd
or supervisord
to keep your application running after closing the terminal.
./chat-app
Ensure the server's firewall rules allow traffic on the port your application is listening on.
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
License
Specify your license here or indicate that it's available in the LICENSE file at the root of the repository.