Skip to content

bnema/gkick-htmx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Echo HTMX Kickstart project

Overview

This is my kickstart project for building web applications. The stack is minimalist and includes the following:

  • Embedding: Embed static folder and templates into the binary.
  • HTMX: Enables dynamic content updates without requiring a full page reload.
  • Hyperscript: Simplifies frontend interactivity with syntactic sugar.
  • Go Templates Rendering: HTML rendering with Go's standard library.
  • Tailwind CSS: Integrated for utility-first CSS styling (because i'm too lazy to write CSS).
  • Air for Hot Reloading: Enables a smooth development experience by automatically reloading the application on code changes.
  • Sanitize HTML: Sanitize HTML inputs with the bluemonday package.

The project also aims to maintain a structure that aligns with Golang's standard project layout.

Getting Started

Prerequisites

Installation

  1. Clone the repository.
    git clone https://github.com/bnema/kickstart-echo.git .
    
  2. Remove the .git folder and initialize a new one.
    rm -rf .git && git init
    
  3. Remove go.mod, go.sum and create a new project.
    rm go.mod go.sum && go mod init github.com/username/project
    
  4. Install package dependencies.
    go mod tidy
    
  5. Run Bun install for Tailwind CSS dependencies.
    bun install
    
  6. Execute Tailwind with Bun.
    bun run dev:css
    
  7. Create a .env at the root of the project (see .env.example).
  8. Run the Application (Air will rebuild and restart the application on code changes).
    air
    
  9. If the 2 previous commands are successful, you can run dev.sh who will run them in parallel.
    chmod +x dev.sh
    ./dev.sh
    
  10. Bonus: The superlazy, one-liner command.
    export MODULE_NAME=github.com/CHANGE_ME/I_MEAN_SERIOUSLY; git clone http://github.com/bnema/kickstart-echo.git . && go mod tidy && rm -rf .git && git init && rm go.mod go.sum && go mod init $MODULE_NAME && bun install && cp .env.example .env && chmod +x dev.sh && ./dev.sh
    

License

Under the GPL-3.0 license. Please see the LICENSE file for more details.

About

Go Echo HTMX Kickstart project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published