Logo

dev-resources.site

for different kinds of informations.

The GoTTH Stack

Published at
9/28/2024
Categories
go
tailwindcss
turso
htmx
Author
amitsuthar69
Categories
4 categories in total
go
open
tailwindcss
open
turso
open
htmx
open
Author
12 person written this
amitsuthar69
open
The GoTTH Stack

GoTTH is designed to quickly spin up a Full-Stack Golang Web Application with HTMX, Tailwindcss and Turso SQLite database support.


About the Stack

Includes following Languages and Technologies:

  1. Golang with ServeMux.
  2. TailwindCSS Standalone Executable.
  3. Turso LibSQL (SQLite for Production).
  4. HTMX with Templ as Templating Engine.

Basic Project Guide

GOTTH
│
├── /internal/                 # Private application and business logic
│   ├── /server/               # Server-specific logic
│   │   ├── server.go          # Core server logic
│   │   └── routes.go          # Route definitions
│   ├── /database/             # Database-related logic
│   |   └── database.go        # Database connection and queries
│   └── /middleware/           # Middlewares
│       └── logger.go          # Logger middleware
│
├── /static/                   # Static assets (CSS, JS, images, etc.)
│   ├── /css/                  # CSS files
│   │   ├── input.css          # Tailwind input file
│   │   └── style.css          # Generated CSS file
│   └── /scripts/              # JavaScript files
│       └── htmx.min.js        # HTMX JavaScript library
│
├── /web/                      # Web UI-related handlers
│       ├── hello.templ        # Templating file for the hello page
│       └── hello.go           # Hello handler logic
│
├── main.go                    # Application entry point
├── Makefile                   # Build automation scripts
├── .air.toml                  # Air live reloading config file
├── tailwind.config.js         # Tailwind CSS configuration
└── tailwindcss                # Tailwind CSS binary
Enter fullscreen mode Exit fullscreen mode

Run the project

air
Enter fullscreen mode Exit fullscreen mode

Installation Guide

Air for Live Reload

go install github.com/cosmtrek/air@latest
Enter fullscreen mode Exit fullscreen mode

Templ

go install github.com/a-h/templ/cmd/templ@latest
Enter fullscreen mode Exit fullscreen mode

You can add templ to your local bashrc or zshrc profile config to avoid absolute path while using templ command.

TailwindCSS

  1. Install the executable binary for your platform from the latest release from GitHub in the root of project.

  2. Make sure to give it executable permissions:

chmod +x ./tailwindcss
Enter fullscreen mode Exit fullscreen mode

Turso

go get github.com/tursodatabase/libsql-client-go/libsql
Enter fullscreen mode Exit fullscreen mode
  1. Then Install the Turso CLI, create your database, generate the AuthToken & DB_URL and add them in the .env file.
  2. You can refer this awesome Turso Quickstart Go Docs if you get stuck anywhere.

.env

PORT=8080
DB_URL=libsql://yourDBName-tursoUserName.turso.io?authToken=yourAuthToken
Enter fullscreen mode Exit fullscreen mode

GoTTH

htmx Article's
30 articles in total
Favicon
Creating a To-do app with HTMX and Django, part 9: active search
Favicon
Creating a To-do app with HTMX and Django, part 8: inline edit, and using Iconify
Favicon
Creating a To-Do app with HTMX and Django, part 7: infinite scroll
Favicon
Creating a To-Do app with HTMX and Django, part 6: implementing Delete with tests
Favicon
Creating a To-Do app with HTMX and Django, part 5: Testing the views
Favicon
Creating a To-Do app with HTMX and Django, part 4: adding new Todos
Favicon
Creating a To-Do app with HTMX and Django - Part 3: Creating the frontend and adding HTMX
Favicon
Creating a To-Do app with HTMX and Django - Part 1: Creating the Django project with uv
Favicon
Creating a To-Do app with HTMX and Django - Part 2: Adding the Todo model with tests
Favicon
Htmx alpine component
Favicon
Don't Fall Into the CDN Trap! 🪤
Favicon
How to Set Up Authorization in a Bookstore Management System with Go, HTMX, and Permit.io
Favicon
Django project - Part 4 HTMX, TailwindCSS and AlpineJS
Favicon
Implement reCAPTCHA in htmx + expressjs
Favicon
htmx and ExpressJS
Favicon
</> htmx post json
Favicon
</> htmx handle array response
Favicon
Building Simple Real-Time System Monitor using Go, HTMX, and Web Socket
Favicon
🔥HMPL — best alternative to HTMX
Favicon
I've built the TodoMVC app with HTMX and lived to tell the story
Favicon
Summary of the AJAX frameworks comparison
Favicon
A minimalist newsletter signup app with HTMX and Manifest
Favicon
Leveraging Go Tailwind Template (GoTTH) for Efficient Microservices Architecture
Favicon
.
Favicon
</> htmx in 5 minutes
Favicon
Handling form errors in htmx
Favicon
Refactoring RATOM: Day ...604
Favicon
Personal Finance Management App with Django, HTMX, Alpine, Tailwind, and Plaid
Favicon
Augmenting the client with HTMX
Favicon
The GoTTH Stack

Featured ones: