jacob-ebey / go-graphql-boilerplate

A simple to use, deploys anywhere boilerplate to get you going in GO and GraphQL.

Home Page:https://jacob-ebey.js.org/go-graphql-boilerplate/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GO GraphQL Boilerplate

A simple to use, deploys anywhere boilerplate to get you going in GO and GraphQL.

Zeit Now Example: https://go-graphql-boilerplate.jacob-ebey.now.sh/

Heroku Example: https://go-graphql-boilerplate.herokuapp.com/

Getting started

Get started by installing GO and Node(NPM), then cloneing this repo.

Once cloned, install the GO dependencies:

> go get ./...

CD into the frontend directory and install the NPM dependencies:

> npm install

Dev mode

Create A .env file in the root of the project, feel free to copy or rename the .env.example file. This is pre-configured for use with the docker-compose.yml file provied.

Configure a combination of the following properties:

DATABASE_URL="postgres://postgres@localhost:54320/postgres"
POSTGRESS_ADDRESS="localhost:54320"
JWT_SECRET="your-jwt-secret"
GO_SERVES_STATIC="true"
ENVIRONMENT="development"
PORT="8080"

OR

POSTGRESS_ADDRESS="localhost:54320"
POSTGRESS_DATABASE="postgres"
POSTGRESS_USER="postgres"
POSTGRESS_PASSWORD=""
JWT_SECRET="your-jwt-secret"
GO_SERVES_STATIC="true"
ENVIRONMENT="development"
PORT="8080"

Both of the above configs are valid for the docker-compose.yml file provided. To spin up your DB, run:

> docker-compose up -d

Now we can start the GO backend. In if ENVIRONMENT is set to development, we will get auto rebuilding of the frontend.

Production

You have a few options for deploying the boilerplate out of the box:

About

A simple to use, deploys anywhere boilerplate to get you going in GO and GraphQL.

https://jacob-ebey.js.org/go-graphql-boilerplate/


Languages

Language:Go 49.7%Language:JavaScript 44.6%Language:HTML 3.2%Language:CSS 1.3%Language:Dockerfile 1.2%