Live data from Hacker News

Ask HN: What is your Golang web-dev tech stack?

news.ycombinator.com

11–20 of 47 posts

Re: Ask HN: What is your Golang web-dev tech stack?

#11
post #10

I've started using Echo[1] and it seems to provide most of what I'm looking for (routing, context, sessions, CSRF protection, form/json binding, etc). For templating, I'm using QuickTemplate[2] which creates statically generated templates, but Pongo2[3] and Jet[4] also look reasonable. sqlx[5], gorm[6], and sqlboiler[7] all seem reasonable for database access, depending on what your style is (sqlx being oriented towa…

Sweet! Buffalo looks really interesting. I was playing with Sails the other day, which is a Rails-like framework for nodejs, I will try Buffalo and try to compare the experience. Would you recommend Buffalo for a JSON Web API mobile backend project or would it be an overkill?

Re: Ask HN: What is your Golang web-dev tech stack?

#12
Even though I know they're well-designed, I find Go's web templates hard to work in. So I avoid them.

My stack is basically:

- Postgres, using pq and sqlx

- A codegen ORM I wrote that scrapes schemas and generates CRUD and lookup functions for all my database types. I don't think dynamic ORMs like gorm are the way to go for Go.

- A session library I wrote a year ago, and simple Go wrapper handlers to require sessions, enforce authentication, &c, passing things like "current user" and "current session" down to standard net/http Handlers through Context.

- 10-or-so JSON utility functions I take with me from project to project.

- React, via create-react-app, so I all my templating is done in JSX.

- net/http/httptest for testing.

Re: Ask HN: What is your Golang web-dev tech stack?

#13
post #10

I've started using Echo[1] and it seems to provide most of what I'm looking for (routing, context, sessions, CSRF protection, form/json binding, etc). For templating, I'm using QuickTemplate[2] which creates statically generated templates, but Pongo2[3] and Jet[4] also look reasonable. sqlx[5], gorm[6], and sqlboiler[7] all seem reasonable for database access, depending on what your style is (sqlx being oriented towa…

Is there a way to use Echo where you're not using their weird handler interface, but rather just standard net/http Handlers?

Re: Ask HN: What is your Golang web-dev tech stack?

#14
Gophers tend to roll their own and forego larger frameworks.

Piecing together libraries can absolutely be daunting, but once you get a starter app built your productivity will go way, way up.

I'd really recommend this (paid) course at https://www.usegolang.com

It walks you through pulling in different libraries (Gorilla Mux, GORM, etc), gluing them together, and structuring your code in a maintainable way.

A couple of other folks have mentioned Buffalo. It's a great ecosystem for building applications quickly, but I would strongly urge you to go through gluing the packages together yourself first to really understand what is going on underneath the magic.

Re: Ask HN: What is your Golang web-dev tech stack?

#16
post #11
post #10

I've started using Echo[1] and it seems to provide most of what I'm looking for (routing, context, sessions, CSRF protection, form/json binding, etc). For templating, I'm using QuickTemplate[2] which creates statically generated templates, but Pongo2[3] and Jet[4] also look reasonable. sqlx[5], gorm[6], and sqlboiler[7] all seem reasonable for database access, depending on what your style is (sqlx being oriented towa…

Sweet! Buffalo looks really interesting. I was playing with Sails the other day, which is a Rails-like framework for nodejs, I will try Buffalo and try to compare the experience. Would you recommend Buffalo for a JSON Web API mobile backend project or would it be an overkill?

It's fine for an api as well. When you create your app, just use the --api flag and it will leave out all of the front-end stuff.

Re: Ask HN: What is your Golang web-dev tech stack?

#19
HTTP: - gRPC for microservices - graphql for combining microservices for the frontend

DB: - dynamodb/psql depending on features. aws-sdk or base go sql package. - redis for caching. go-redis package.

Stats/logging: - statsd/graphite/grafana - sirupsen/logrus for logging

I usually write a wrapper for packages that will automatically report stats + logging.

Re: Ask HN: What is your Golang web-dev tech stack?

#20
Also check out Træfik. A fast reverse proxy. With support for kubernetes, prometheus, let's encrypt, grpc, websockets and more. It may change the way you design your web backend ;)

https://traefik.io/

Am also looking forward to trying the new GoLand IDE from the JetBrains team. Currently using Atom but would be interested in dedicated integrations with gcloud sdk.

https://www.jetbrains.com/go/

Post reply on HN