go-htmx-templ-tailwind

command module
v0.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 8 Imported by: 0

README

Go - Templ - Tailwind -- Template Project

This project serves as a template project for simple applications using Go (programming language), Templ (templating library), and Tailwind (CSS framework) including testing & release workflows.
For the database, Sqlite is used.

Goreleaser with the Ko integration is used to 1) create GitHub releases and 2) build and push Docker images.

Development Stack

The dev stack uses Air, Templ, and Tailwind.
Air is used to automatically reload the application when any Go file changed.
Templ is the templating framework used.
Tailwind generates css styles fom HTML classes.

Structure
  • main.go: Routes & DB initialization
  • /internal/persistence: DB access
  • /internal/views: Frontend files
  • /static/css: Style files. style.css is generated by Tailwind from input.css.
Development

Execute the following commands in parallel:

  • air: Restarts the app if any Go files change
  • templ generate --watch: Compile *templ files to Go source
  • npx tailwindcss -i ./static/css/input.css -o ./static/css/style.css --watch: Re-compile any css files if any template files change.
GitHub

GitHub integrations are provided with two workflows.

integration.yaml

Executes tests & vets all pushes.

release.yaml

Used to create releases. The pipeline is run on every push. If no tag is present, the release is not performed but validated. If a tag in the form of v* is present, a GitHub release is created, as well as the Docker images are created and pushed.

Kubernetes

./deployment/deployment.yaml contains a basic Kubernetes deployment file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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