Real-time Chat Application with Bot Integration
This project is a real-time chat application that allows users to communicate instantaneously and includes a decoupled bot for automated message broadcasting. The application is built using Go for the backend, React for the frontend, and Docker for easy setup and deployment.
Getting Started
Prerequisites
- Docker
- Go 1.19
- Node.js 14.17.0
- npm 6.14.13
Installation
-
Clone the repo
git clone git@github.com:esirangelomub/go-chat-application.git
-
Build and Run the Docker image
Run the Docker container
docker-compose up --build -d
-
Install backend dependencies
go mod download
or
go get -d ./...
or
go mod tidy
-
Install frontend dependencies
cd frontend
npm install
or
cd frontend
yarn install
-
Setup the database
cd cmd/dbsetup
go run main.go
Note: This action will delete all records in the relational database.
- Run the application
Backend server
cd cmd/server
go run main.go
Backend chat
cd cmd/server
go run main.go
Frontend
- Run the application
cd frontend
npm start
or
cd frontend
yarn start
Usage
- Open your browser and go to http://localhost:3000
- Register a new account
- Login with your new account
- Start chatting with other users
- To test the bot, send a message with the following format: /stock=stock_code
Note: You'll need to open two different browsers (e.g. Chrome and Firefox)
Testing
go test ./...
Feel free to reach out if you have any questions or would like to discuss this project further.
License
Distributed under the MIT License. See LICENSE
for more information.