pjebs / go-react-chat-app

A simple chat application using GoLang (for the first-time) + React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Chat Application with Golang + React

First time using Go! Including the following that helped setup the backend structure

go-react-chat-app-gif

Setup

  • Install Golang: https://golang.org/doc/install
  • Make sure you have mysql installed and proper permissions and (npm or yarn)
  • Log into mysql console and create a DB in mysql: create database sharedchat
  • Load db from sql structure sql, replace following command with your username and password: mysql -u username -p sharedchat < sharedchat_db_structure.sql
  • export SHAREDCHAT_DB_URL=username:password@/sharedchat?charset=utf8
  • go install
  • yarn or npm install
  • npm install -g webpack
  • webpack
  • go-react-chat-app
  • Go to localhost:5000 and use the chat!

Resources I learned a lot from

Improvements for following iterations

  • separate timestamp and username from stored message
  • extract reusable parts of golang server into separate funcs and files
  • use redigo to register websockets and allow chat to scale above one server
  • add testing for golang server
  • add testing for react app
  • make it prettier

About

A simple chat application using GoLang (for the first-time) + React


Languages

Language:JavaScript 99.6%Language:Go 0.4%Language:HTML 0.0%