Go Htmx Demo screenshot

Go Htmx Demo

Author Avatar Theme by Emarifer
Updated: 8 Nov 2023
46 Stars

Simple full-stack web application for saving notes to a Sqlite database (CRUD), with HTML template rendering using </> htmx & _hyperscript. This is a minimalist application that does not use any additional libraries beyond the standard Go library.

Categories

Overview

The Golang Full-stack Web App is a simple web application that allows users to save notes into a Sqlite database. It follows the minimalist approach of using only the standard Go library, with the exception of the necessary Sqlite driver. The application uses the “html/template” package for rendering HTML templates and the “</> htmx” JavaScript library for making backend requests without reloading the page.

Features

  • CRUD functionality for saving notes to a Sqlite database.
  • HTML template rendering using the “html/template” package.
  • Backend requests (GET, POST, PATCH, DELETE) without page reloading using the “</> htmx” JavaScript library.
  • Minimalist approach with no additional libraries beyond the standard Go library.

Installation

To install the Golang Full-stack Web App, follow these steps:

  1. Ensure you have Go installed on your machine.
  2. Install Air for hot reloading when editing code.
  3. Install NodeJs.
  4. Run the following NodeJs commands in the project root:
    npm install tailwindcss
    npm install postcss-cli
    npm install autoprefixer
    
  5. To make code changes or create production CSS, run the following commands:
    npx tailwindcss init
    npx tailwindcss -o static/css/tailwind.css
    npm run build
    
  6. Start the application in development mode by running the command:
    air
    

Summary

The Golang Full-stack Web App is a simple web application that allows users to save notes into a Sqlite database. It follows the minimalist approach of using only the standard Go library and utilizes the “html/template” package for rendering HTML templates. With the “</> htmx” JavaScript library, the application enables backend requests without reloading the page, providing a smoother user experience. Overall, this application provides a lightweight and efficient solution for managing and saving notes in a web environment.