A modern, lightweight web application template combining the speed of Go Fiber, the simplicity of HTMX, and the utility-first approach of Tailwind CSS. Perfect for building fast, interactive web applications with minimal JavaScript.
- ⚡ Fast Backend: Built with Go Fiber - Express-inspired web framework for Go
- 🎯 Interactive Frontend: HTMX for seamless AJAX, CSS transitions, and WebSocket support
- 🎨 Modern Styling: Tailwind CSS for rapid UI development
- 📄 Template Engine: Jet Templates for powerful, Django-like templating
- 🛠️ Development Tools: Mise for task automation and tool management
- 📦 Zero Build Complexity: Simple setup with minimal configuration
Technology | Purpose | Version |
---|---|---|
Go | Backend Language | 1.24.4+ |
Fiber | Web Framework | v2.52.8+ |
HTMX | Frontend Interactivity | 2.0.4 |
Tailwind CSS | CSS Framework | Latest |
Jet Templates | Template Engine | v6.3.1+ |
Mise | Task Runner & Tool Management | Latest |
-
Clone the repository
git clone https://github.com/Drache93/go-fiber-template.git cd go-fiber-template
-
Install dependencies
# If using Mise (recommended) mise install mise run dep mise run tidy # Or manually go mod tidy mkdir -p static/dist/js curl -o static/dist/js/htmx.min.js https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js
-
Build CSS
# If using Mise mise run build:css # Or manually npx @tailwindcss/cli -i ./static/css/app.css -o ./static/dist/css/styles.css
-
Run the development server
# If using Mise mise run dev # Or manually go run cmd/app/main.go
-
Open your browser Navigate to http://localhost:3000
├── cmd/
│ └── app/
│ └── main.go # Application entry point
├── views/
│ ├── layouts/
│ │ └── application.jet # Base HTML layout
│ └── index.jet # Home page template
├── static/
│ ├── css/
│ │ └── app.css # Tailwind CSS input file
│ └── dist/ # Built assets (auto-generated)
│ ├── css/
│ │ └── styles.css # Compiled Tailwind CSS
│ └── js/
│ └── htmx.min.js # HTMX library
├── mise.toml # Task definitions and tool versions
├── go.mod # Go module dependencies
└── README.md # This file
Task | Description | Command |
---|---|---|
dep |
Download JavaScript dependencies | mise run dep |
tidy |
Clean up Go modules | mise run tidy |
build:css |
Compile Tailwind CSS | mise run build:css |
dev |
Start development server | mise run dev |
build |
Build production binary | mise run build |
Add routes in cmd/app/main.go
:
app.Get("/your-route", func(c *fiber.Ctx) error {
// Your handler logic
return c.SendString("Hello World!")
})
-
Create a new
.jet
file in theviews/
directory -
Extend the base layout:
{{ extends "./layouts/application.jet" }} {{ block documentBody() }} <div class="p-4"> <h1 class="text-2xl font-bold">Your Content</h1> </div> {{ end }}
Use HTMX attributes for dynamic behavior:
<button
hx-get="/api/data"
hx-target="#result"
class="bg-blue-500 text-white px-4 py-2 rounded"
>
Load Data
</button>
<div id="result"></div>
The project includes Tailwind CSS with automatic compilation. Add classes directly to your HTML:
<div
class="bg-gradient-to-r from-blue-500 to-purple-600 text-white p-8 rounded-lg shadow-lg"
>
Beautiful gradient background!
</div>
# Build the application
mise run build
# The binary will be created at ./bin/app
./bin/app
- Go Fiber Documentation - Learn about the web framework
- HTMX Documentation - Master hypermedia-driven applications
- Tailwind CSS Documentation - Explore utility-first CSS
- Jet Template Documentation - Template engine guide
- Mise Documentation - Task runner and tool management
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is free and open-source. Feel free to use it as a template for your own projects!
- Fiber Team for the amazing Go web framework
- HTMX Team for revolutionizing frontend development
- Tailwind Labs for the utility-first CSS framework
- CloudyKit for the powerful template engine
Happy coding! 🎉
If you find this template helpful, please consider giving it a ⭐ on GitHub!