A boilerplate for fastly building web application based on React & Go.
- Linux or Mac OS
- Node.js (7.10.0 or higher)
- Go (1.8.1 or higher)
-
Frontend
- Components powered by React
- State management powered by Redux
- Stylesheet management powered by Radium
- Fully-featured router management powered by react-router
- Hot reload powered by react-hot-loader (module level hot reload only for stateful component)
- Auto re-lint your js/jsx files after editing powered by eslint-watch
-
Backend
-
Clone the repo and install all dependencies:
go get github.com/MrHuxu/react-go-boilerplate && cd $GOPATH/src/github.com/MrHuxu/react-go-boilerplate go get -u github.com/golang/dep/cmd/dep dep ensure npm install
-
It's recommended to install the React DevTools and Redux DevTools for frontend debugging.
-
Launch the server:
# execute the command below, then you'll see the dashboard shown # go visit http://localhost:8283 in your browser # editing any file will let the server or frontend reload go get -u github.com/codegangsta/gin npm run dev
It is highly recommended to use Docker to deploy this project!!
-
Clone the repo and build Docker image:
go get github.com/MrHuxu/react-go-boilerplate && cd $GOPATH/src/github.com/MrHuxu/react-go-boilerplate docker build . -t react-go-boilerplate docker run -p 13109:13109 -d react-go-boilerplate
-
Use
docker logs
command to monitor the logs of the server:docker logs -f [container_id]
-
Clone the repo and install all dependencies(same as above).
-
Launch the server:
# go visit http://localhost:13109 in your browser after executing the command npm run prd