https://github.com/macu/go-vue-starter
Boilerplate server using Go, Postgres, Vue, SCSS, and webpack
https://github.com/macu/go-vue-starter
golang mysql scss vue vue-router vuex webpack
Last synced: 6 months ago
JSON representation
Boilerplate server using Go, Postgres, Vue, SCSS, and webpack
- Host: GitHub
- URL: https://github.com/macu/go-vue-starter
- Owner: macu
- License: mit
- Created: 2020-02-04T00:11:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T23:35:47.000Z (almost 3 years ago)
- Last Synced: 2024-11-18T04:25:42.066Z (over 1 year ago)
- Topics: golang, mysql, scss, vue, vue-router, vuex, webpack
- Language: Go
- Size: 1.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Vue Starter
Create env.json with database and server configuration for local development:
```
{
"dbUser": "matt",
"dbPass": "somepassword",
"dbName": "starterdemo",
"httpPort": "2020",
"versionStamp": ""
}
```
Version stamp is updated automatically when running `restart.sh`.
Run `sh init.sh` to build the frontend, start the server, and initialize the database.
Run `sh restart.sh` to rebuild the frontend and start the server.
You may have to delete package-lock.json and re-install the dev dependencies
listed in package.json at their latest versions to get a working build.
All files in css, img, and js are public.
## Add libraries
```
go mod init github.com/macu/go-vue-starter
go get github.com/jackc/pgx/v4/stdlib
go get github.com/gorilla/mux
```
## Mac setup
A postgres password must be set before the app can connect.
```
$ brew install postgresql go node jq
$ psql postgres
postgres=# ALTER USER matt WITH PASSWORD 'somepassword';
postgres=# \q
$ cd starterdemo
// Update env.json
$ npm install
$ sh init.sh
```
## Create Postgres database
```
$ psql postgres
postgres=# CREATE DATABASE starterdemo;
```
### Access database from command line
```
$ psql starterdemo
postgres=# \dt
postgres=# \d+ user_account
```
## Build and run
On first use, or to re-initialize database:
```
$ sh init.sh
```
To rebuild client and server, and run:
```
$ sh restart.sh
```