Skip to content

east2dd/golang-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang React Boilerplate (golang, mysql, react)

Golang - REST API
React - Frontend

REST API

Installing project with go get and install dependencies

go get -u github.com/xyingsoft/golang-vue

go get -u github.com/go-sql-driver/mysql
go get -u github.com/subosito/gotenv
go get -u github.com/gorilla/mux

Editing .env file for app db configuration

export APP_URL=http://localhost
export APP_PORT=3000
export APP_ENV=development

export DB_USERNAME=root
export DB_PASSWORD=
export DB_HOST=localhost
export DB_PORT=3306
export DB_DATABASE=store

Seeding sample data to database

$ cd $GOPATH/src/path/to/project/root
go run seed.go

Running project

$ cd $GOPATH/src/path/to/project/root
go run main.go

Frontend

Setting API Endpoint. Edit path-to-project-root/client/src/config.js

export const API_BASE_URL = 'http://localhost:3000/'

Running project

$ cd $GOPATH/src/path/to/project/root
cd client
npm install
npm start

bring browser up and browse http://localhost:8080

About

Golang React Boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published