Go Module Recommendations
Chi HTTP Framework
Installation
go get -u github.com/go-chi/chi/v5Features
- Lightweight — cloc’d in ~1000 LOC for the chi router
- Fast — yes, see benchmarks
- 100% compatible with net/http — use any http or middleware pkg in the ecosystem that is also compatible with
net/http - Designed for modular/composable APIs — middlewares, inline middlewares, route groups and sub-router mounting
- Context control — built on new
contextpackage, providing value chaining, cancellations and timeouts - Robust — in production at Pressly, CloudFlare, Heroku, 99Designs, and many others (see discussion)
- Doc generation —
docgenauto-generates routing documentation from your source to JSON or Markdown - Go.mod support — as of v5, go.mod support (see CHANGELOG)
- No external dependencies — plain ol’ Go stdlib +
net/http
SQL /w BunSQL
Bun is a SQL-first database client for Go. SQL-first means that most SQL queries can be automatically compiled to Bun expressions and Bun expressions look and feel like SQL queries.
The purpose of Bun is to allow writing queries using the good old SQL and to help scanning results into common Go types: structs, maps, slices, and scalars (— Bun Team)
Installation
Bun Module
go get github.com/uptrace/bun@latest(Example) postgres Driver & Dialect
Bun offers multiple different drivers/dialects for most types of SQL — As an example, I’m using Postgres, so I will install the Postgres Driver & Dialect.
go get github.com/uptrace/bun/driver/pgdriver && go get github.com/uptrace/bun/dialect/pgdialect</> TEMPL Templating Engine
Get Urban (@officialurbanus)’s stories in your inbox
Join Medium for free to get updates from this writer.
Create components that render fragments of HTML and compose them to create screens, pages, documents, or apps.
- Server-side rendering: Deploy as a serverless function, Docker container, or standard Go program.
- Static rendering: Create static HTML files to deploy however you choose.
- Compiled code: Components are compiled into performant Go code.
- Use Go: Call any Go code, and use standard
if,switch, andforstatements. - No JavaScript: Does not require any client or server-side JavaScript.
- Great developer experience: Ships with IDE autocompletion.
Installation
CLI Installation
go install github.com/a-h/templ/cmd/templ@latestModule Installation
go get github.com/a-h/templVS-Code Settings
Official TEMPL VS-Code Extension
"tailwindCSS.includeLanguages": {
"templ": "html"
},
"[templ]": {
"editor.defaultFormatter": "a-h.templ"
},
"emmet.includeLanguages": {
"templ": "html"
},BabyAPI — The EASIEST Way To Create APIs
babyapi is a super simple framework that automatically creates an HTTP API for create, read, update, and delete operations on a struct. Simply extend the babyapi.DefaultResource type to get started.
Implement custom request/response handling by implemented Renderer and Binder from go-chi/render. Use provided extension functions to add additional API functionality:
OnCreateOrUpdate: additional handling for create/update requestsStorage: set a different storage backend implementing thebabyapi.StorageinterfaceAddCustomRoute: add more routes on the base APIPatch: add custom logic for handlingPATCHrequests- And many more! (see examples and docs)
- Override any of the default handlers and use
babyapi.Handlershortcut to easily render errors and responses
Installation
go get github.com/calvinmclean/babyapiExample
package main
import (
"github.com/calvinmclean/babyapi"
)
type Person struct {
babyapi.DefaultResource
Name string `json:"name"`
Age int `json:"age"`
}
func main() {
api := babyapi.NewAPI[*Person](
"PERSONs", "/api/persons",
func() *Person {
// Return Default Person
return &Person{
Name: "<NAME>",
Age: -1
}
},
)
// This code sets up a FULL REST/CRUD API, endpoints and everything!
// (GET) /api/persons - Returns all persons
// (GET) /api/persons/{id} - Returns person by ID
// (POST) /api/persons - POST a new person
// (DELETE) /api/persons/{id} - Delete a person
// & More...
}





