This repository provides a quickstart template for projects using Goilerplate, a modern UI component library for Go and Templ. Get a head start on your project with a pre-configured environment and example setup.
Ensure you have the following installed:
make
(usually pre-installed on macOS and Linux; Windows users might need to install it separately)Clone the Repository
git clone https://github.com/axzilla/goilerplate-quickstart.git
cd goilerplate-quickstart
Install Go Dependencies
go mod tidy
Install Templ
go install github.com/a-h/templ/cmd/templ@latest
Start the Development Server
make dev
This command will use npx to run Tailwind CSS, so no separate npm install is needed.
View Your Project Open your browser and navigate to http://localhost:7331
make dev
command starts a development server with hot-reloading for Go, Templ, and Tailwind CSS.ui
directory to modify layouts and pages.assets/css/input.css
.main.go
.ui/pages/
and new layouts in ui/layouts/
.tailwind.config.js
.Makefile
for additional build processes if needed.This quickstart is pre-configured to use Goilerplate. To use Goilerplate components:
Import Goilerplate in your Templ files:
import "github.com/axzilla/goilerplate/pkg/components"
Use components in your Templ templates:
@components.Button(components.ButtonProps{Text: "Click me"})
Refer to the Goilerplate documentation for a full list of available components and their usage.
templ generate
manually.input.css
file is correctly linked in your HTML.Contributions to improve this quickstart template are welcome. Please feel free to submit issues or pull requests.
This quickstart project is open-source and available under the MIT License.
Happy coding with Goilerplate! We're excited to see what you build. If you create something cool, consider sharing it with the community!