go-chat-application

module
v0.0.0-...-f349414 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2023 License: MIT

README

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
  1. Clone the repo

    git clone git@github.com:esirangelomub/go-chat-application.git
    
  2. Build and Run the Docker image

    Run the Docker container

    docker-compose up --build -d  
    
  3. Install backend dependencies

    go mod download
    

    or

    go get -d ./...
    

    or

    go mod tidy
    
  4. Install frontend dependencies

    cd frontend
    npm install
    

    or

    cd frontend
    yarn install
    
  5. Setup the database

    cd cmd/dbsetup
    go run main.go
    

Note: This action will delete all records in the relational database.

  1. Run the application Backend server
    cd cmd/server
     go run main.go
    
    Backend chat
    cd cmd/server
     go run main.go
    
    Frontend
  2. Run the application
    cd frontend
    npm start
    
    or
    cd frontend
    yarn start
    

Usage

  1. Open your browser and go to http://localhost:3000
  2. Register a new account
  3. Login with your new account
  4. Start chatting with other users
  5. 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 ./...

Contact

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL