goreact

Example Go (backend) React (frontend) Application

  • 所有者: cbrake/goreact
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Go/React Web app

Overview

This is a web application that can be used to receive data over REST interface, store in a db, and then display it.

Technologies

  • Go (backend)
    • https://golang.org/
    • used on the server (backend)
    • greatly simplifies development and deployment
    • very popular in new companies and startups
    • cross platform -- can easily target Linux, MacOS, or Windows.
    • relatively "safe" language
      • statically typed so compiler catches a lot of problems
      • garbage collected (memory leaks are very rare)
    • Go is efficient and well suited for embedded Linux targets
      • compiles to a single, statically linked binary that is relatively small
      • compiled and runs similar to C/C++
  • React (frontend)
  • Bootstrap 4 (css toolkit)
  • https://parceljs.org/ (frontend build)
    • very powerful and simple frontend build tool
    • development and production modes
    • in development, automatically updates page in browser if sources change.

Additional Note:

  • all assets and files (including the frontend) are embedded in the golang server binary. This makes deployment of new versions very simple for development or production -- all you need is a single binary.
  • There is no separate run-time to install (like Python, Ruby, Nodejs, Java, or C# environments). Everything is statically included in the binary. Again, this makes deployment very simple.
  • there are no dependencies or stack that needs to be installed on the server -- only a single binary.

Setup

To set up a build environment (only tested under Linux):

Production Build

  • app_build (build Linux production binaries)
  • app_build_windows (build windows binaries)
  • ./goreact

Development

Install the following:

The following commands can be run (in separate terminal windows) during development.
Any time one of the source files in the project are changed, then appropriate parts of
the project are rebuilt, and automatically reloaded (if frontend change).

  • app_watch_backend
  • app_watch_frontend

Editors/Tooling

There are a number of editors that support Golang and React development very well including Vim, Atom, Visual Studio Code, etc. If you don't have a strong preference, Visual Studio Code is a good one to start with.

Visual Studio

Visual Studio Code is an advanced editor that runs well under Linux, and has extensions for both Go and Elm development. It also integrates well with Git and allows you to commit/push changes to a git repo directly from the editor.

To install:

Visual Studio is configured to auto-format Go and Javascript code automatically when saved.
This helps keep code clean looking and consistent.

VS Code also has an integrated terminal that will allow you to run the app_build from within your editor.

主要指標

概覽
名稱與所有者cbrake/goreact
主編程語言Go
編程語言JavaScript (語言數: 5)
平台
許可證
所有者活动
創建於2018-01-29 22:50:58
推送於2018-01-30 02:47:19
最后一次提交2018-01-29 21:47:06
發布數0
用户参与
星數84
關注者數2
派生數18
提交數8
已啟用問題?
問題數1
打開的問題數1
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?