GoChat is a real-time chat application built with Go for the backend and React for the frontend. It uses WebSockets for real-time communication between clients and the server.
git clone https://github.com/aayushxrj/gochat
cd ./gochat/
Now you can get the app up and running. You can do this either by running it locally on your machine or via Docker or within a GitHub Codespace.
To get started with GoChat, you need to have Go and Node.js installed on your machine. Go is used for running the backend server, and Node.js is used for managing frontend dependencies and running the development server.
- Install Prerequisites
- Start the backend server
cd src/backend/
go run .
- Start the frontend development server
Open a new terminal session and run:
npm install
npm run dev
You can access the app at http://localhost:5173/
If you have Docker installed and running, you can also run the application using Docker. Follow these steps:
Directly pull and run from Docker Hub (recommended):
docker-compose up
or Build and run the Docker image locally:
docker-compose up --build
You can access the app at http://localhost:5173/
If you're running this inside a GitHub Codespace, follow these steps to get the app up and running:
- Execute the following command in the terminal to get the Codespace name:
export $CODESPACE_NAME
- Copy the output and add it to the .env file in the root directory of the project. Your dotenv file should look like this:
VITE_CODESPACE_NAME=your_codespace_name
- Build and run the Docker image:
docker-compose up --build
You can then access the app at https://your_codespace_name-5173.app.github.dev/
- Join the chat
When you first open the GoChat application, you will be prompted to enter a username. Enter a username of your choice and click "Join" to enter the chat room.
- Send a message
Once in the chat room, you can start typing messages in the input field at the bottom of the screen and click the "Send" button to send a message.
- Receive messages
Messages from other users will appear in real-time. You can see who sent each message along with the message content.
Contributions to GoChat are welcome! If you have an idea for an improvement or have found a bug, please open an issue or submit a pull request
GoChat is open-source software licensed under the MIT license.