rynhndrcksn / snippetbox

Repository for coding along with the Let's Go book by Alex Edwards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snippetbox

Project built while following along with Let's Go by Alex Edwards.

Project Layout

The directory structure of this project closely follows Go's server project layout.

Cmd

The cmd directory contains the application specific code for the executable applications in the project.

Internal

The internal directory contains the ancillary non application specific code used in the project. Holds things like validation helpers, SQL database models, etc. The internal directory also carries a special meaning and behavior in Go. Any packages while live under this directory can only be imported by code inside the parent of the internal directory. That means packages that live in internal can only be imported by code inside the snippetbox project directory.

Looking at it another way, this means that any packages under internal cannot be imported by code outside our project. This is useful because it prevents other codebases from importing and relying on the (potentially un-versioned and unsupported) packages in our internal directory — even if the project code is publicly available somewhere like GitHub.

Ui

The ui directory contains the user interface assets used by the web application. Specifically ui/html will contain HTML templates while ui/static will contain static files (CSS, images, etc).

TLS

Need an easy way to generate TLS certs for HTTPS during local dev? Run go run /usr/local/go/src/crypto/tls/generate_cert.go --rsa-bits=2048 --host=localhost in your shell (assuming Linux/MacOS machine).

About

Repository for coding along with the Let's Go book by Alex Edwards


Languages

Language:Go 89.9%Language:CSS 9.8%Language:JavaScript 0.4%