A blazing-fast Go template combining Echo, HTMX, and templ for building modern hypermedia-driven web applications with minimal JavaScript and maximum efficiency.
- Go Echo Framework - High performance, minimalist web framework
- Templ Integration - Type-safe HTML templates for Go
- TailwindCSS - Utility-first CSS framework
- OpenBSD Ready - Configured for OpenBSD deployment
- Redis Support - Prepared for Redis integration
- GitHub Actions - Automated PR and Production workflows
# Clone the template
git clone https://github.com/jrswab/go-htmx-forge your-project-name
# Navigate to project
cd your-project-name
# Install dependencies
go mod tidy
go install github.com/a-h/templ/cmd/templ@latest
# Start development server
make run
To run Tailwind use Tailwind's Standalone CLI. This forge does not use the npm/npx version when running locally.
Visit http://localhost:3000
to see your application running.
.
├── .github/
│ └── workflows/ # GitHub Actions workflows
│ ├── pr-workflow.yml
│ └── prod-workflow.yml
├── cmd/
│ └── main.go # Application entrypoint
├── config/
│ └── config.go # Application configuration
├── handlers/
│ ├── handlers.go # Handlers for serving pages
│ └── utils.go # Application utilities
├── logs/ # Application logs
├── media/ # Media files
├── static/ # Static assets
│ ├── input.css # TailwindCSS input
│ ├── manifest.json # PWA Metadata for your site
│ ├── offline.html # What to serve when the client is offline
│ ├── output.css # Generated CSS
│ └── sw.js # Specific Javascript for the PWA Service Worker
├── views/
│ ├── home/
│ │ ├── home_content.templ # The content for the home page
│ │ └── home_content_templ.go # Generated Go file from Templ
│ └── layout/
│ ├── base.templ # Main structure of you website (this won't change per page)
│ └── base_templ.go # Generated Go file from Templ
- Go 1.20 or higher
- HTMX (dowload and save into
static/
) - Make
make run
- Starts a local development server with templ generation and TailwindCSS compilationmake pipeline
- Build assets for deployment (this is used by Github)
The template includes two GitHub Actions workflows:
- Triggers on pushes to non-master branches
- Runs linting and tests
- Deploys to
/var/www/builds/<branch-name>/
- Triggers on pushes to master
- Runs linting and tests
- Deploys to
/var/www/
- Restarts the OpenBSD service
SSH_HOST
- Deployment server hostnameSSH_USER
- SSH usernameSSH_PRIVATE_KEY
- SSH private keyREDIS_HOST
- Redis server hostname (production only)REDIS_PASS
- Redis password (production only)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the BSD 3-Clause License.
If you find this template useful, consider:
- ⭐ Starring the repository
- 🐛 Opening issues for feature requests or bugs
- 🔀 Submitting pull requests
- ☕ Supporting the project on Liberapay
Created by jrswab - Building tools to enhance developer workflows.