server

command module
v0.0.0-...-f46f3e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 12 Imported by: 0

README

@chorro/server

Go application that interfacing between Chorro's frontends and its database (amond other things).

Developing

Pre-requisites
Getting Started
  1. Create a Postgres database, user, and password for Chorro guide

  2. Create a .env file with environment variables that suit your particular setup - use the included ./env.example as a starting point:

    $ cp ./env.example .env
    
  3. You need to make sure you download all the necessary Go dependencies

    $ go mod download
    
Running the dev server

The dev server should restart if its source code is changed while it is running:

$ yarn dev
Codegen

We use gqlgen to generate a lot of the code in the server/graphql directory. Some files in this server/graphql are purely written by humans, others are purely generated, and some others are sort of co-written by humans and code generator. In general,

  • Any file named generated.go is purely generated
  • Any *.graphql file
  • All *.resolves.go files have their structure generated and their implementations written by hand
Updating server/graph

You will need to re-run codegen after changing anything in:

  • server/graphql/model, or
  • server/graphql/schema

We use go generate to run codegen:

$ go generate ./...

For guidance on tweaking anything server/graph, check out gqlgen's Getting Started guide.

Building the self-contained binary

You can generate the self-contained, compiled Go binary within the ./build using the build step:

$ yarn build

Building and deploying the Docker image

You can deploy to Kubernetes using using the release and deploy scripts:

$ yarn release
$ yarn deploy

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL