A minimalist web application scaffold using Go and TailwindCSS.
Install dependencies:
npm i
Run the development watcher:
go run pkg/watcher/main.go
This will start a file watcher that enables live reload when editing files.
cmd/example/main.go
: Your main application entry pointpkg/watcher/main.go
: Development file watcherstatic/
: Static assets and compiled CSStemplates/
: HTML templatesEdit your application code in cmd/example/main.go
or create new examples in the cmd
folder.
Basic example:
package main
import (
"fmt"
"github.com/renniemaharaj/go-web-scaffold/internal/app"
)
// The directory to export the document to
var dist = "static"
func main() {
// Create a new document
doc := app.MyDocument()
// Build the document and capture any error
if err := doc.Build(dist); err != nil {
fmt.Printf("Error building document: %v\n", err)
return
}
fmt.Println("Document built successfully")
}
The watcher will automatically detect changes and rebuild your application. You can build on what i've built, but I plan on integrating typescript, docker, golang linting, writing tests, templ and formatting soon.