GoTTH is designed to quickly spin up a Full-Stack Golang Web Application with database support.
Includes following Languages and Technologies:
- Golang with ServeMux.
- TailwindCSS Standalone Executable.
- Turso LibSQL (SQLite for Production).
- HTMX with Templ as Templating Engine.
air
- Using Docker
docker pull amitsuthar69/gotth:1.0
docker run -p 8080:8080 amitsuthar69/gotth:1.0
OR
- Build from source
git clone https://github.com/amitsuthar69/GoTTH.git
go install github.com/cosmtrek/air@latestgo install github.com/a-h/templ/cmd/templ@latestYou can add templ to your local bashrc or zshrc profile config to avoid absolute path while using templ command.
-
Install the executable binary for your platform from the latest release from GitHub in the root of project.
-
Make sure to give it executable permissions:
chmod +x ./tailwindcssgo get github.com/tursodatabase/libsql-client-go/libsql- Then Install the Turso CLI, create your database, generate the AuthToken & DB_URL and add them in the
.envfile. - You can refer this awesome Turso Quickstart Go Docs if you get stuck anywhere.
PORT=8080
DB_URL=libsql://yourDBName-tursoUserName.turso.io?authToken=yourAuthToken
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
If you really appreciate the efforts :
