politicker / lifts.quinn.io

track quinns lifts in near real time

Home Page:https://lifts.hborg.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Backend Template

This template repo is a starting place for any Go backends I write. It is largely inspired by the beautifully written apollo-backend (RIP 🪦).

Project structure

Most of the interesting bits live in the internal directory. I based the structure off the apollo-backend source as well as this blog post from the Go team about organizing a project. It's not prescriptive but it serves as a good starting point.

The top-level cmd folder contains a binary that serves as the entrypoint to the entire codebase. It proxies commands into internal/cmd which contains the domain-specific commands like worker, api, and scheduler. Each of those commands take their own flags and arguments to specify behavior.

Dependencies

Running services

The top-level cmd directory contains the entrypoint CLI to run all of the services. Each service exposes its own CLI that can take whatever flags & arguments it needs.

To run a service, use the root CLI like so:

go-backend-template api --with-flags args

go-backend-template worker --queue send-emails

This repo includes run configurations for VS Code as well, which allows you to run & debug the services from within the editor.

About

track quinns lifts in near real time

https://lifts.hborg.org


Languages

Language:Go 78.6%Language:HTML 9.3%Language:CSS 8.4%Language:Just 3.7%