Skip to content

Automated Golang project creation with a CLI tool. Includes Air and Makefile dev tools. It integrates the Goth auth library and the Gotth stack

Notifications You must be signed in to change notification settings

santedev/gothBase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

GothBase

GothBase is a Go templating system optimized for Linux development, using Air and a Makefile, along with the Goth and Gotth stack.

  • you can see the structure of the template at example

Requirements:

Ensure you have Golang and Linux. WSL may work if it supports curl, go commands, and chmod.

Makefile and Air work with Bash commands.

Installation steps

  • clone the project with the next command:
git clone https://github.com/santedev/gothBase
  • Install Golang here

  • Install Templ here

Or run next command to install templ:

go install github.com/a-h/templ/cmd/templ@latest

Run CLI

  • Build the CLI:
cd cli
go build -o ../GothBase
../GothBase

Or run next command:

cd cli
go run .

Note: The output directory will be one level up from the cli cloned folder.

Command Line Navigation

Command Line Navigation when input is required

  • Next Step: Key Enter.
  • Previous Step: Key ctrl+u.
  • Confirm Creation: Key Enter.

Command Line Navigation

  • Move Up/Down: Use arrow keys or k and j.
  • Next Step: Arrow right or n.
  • Previous Step: Arrow left or b.
  • Select Options: Enter or Space.
  • Confirm Creation: Press y to confirm or n to cancel.

Post-Setup

with templ installed run next command

templ generate

if errors encountered try

~/go/bin/templ generate

Script and Style Customization

In the public/scripts directory, you'll find files like htmx.min.js, jquery.min.js, and alpine.js, depending on the options you selected during setup. For example, if you only need HTMX, you can opt for that by selecting all options except JavaScript and then choosing HTMX.

With the default setup, which includes JavaScript minified files, you're equipped to use jQuery's ecosystem if needed or leverage Alpine UI libraries with Tailwind UI. Explore Pines JS, Penguin UI, and Alpine UI Components for more.

To add your own JavaScript scripts, place them in the public/scripts folder for consistency. Then, include them in views/layout/ if you want to add the script to the base layout, either within the HTML <head> or <body> tags using the Templ component.

Similarly, the public directory is intended for your CSS files. You can create a css folder and add your stylesheets there, following a similar process as with JavaScript.

For windows users

Here's how you can update the manual installation instructions for Windows, specifically for PowerShell: Manual Installation for Windows (PowerShell)

  • Install TailwindCSS:
Invoke-WebRequest -Uri "https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-win-x64.zip" -OutFile "tailwindcss.zip"
Expand-Archive -Path "tailwindcss.zip" -DestinationPath "."
Remove-Item -Path "tailwindcss.zip"
  • Install JS Min Files:
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/htmx.org/dist/htmx.min.js" -OutFile "public/scripts/htmx.min.js"
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/alpinejs/dist/cdn.min.js" -OutFile "public/scripts/alpine.js"
Invoke-WebRequest -Uri "https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js" -OutFile "public/scripts/jquery.min.js"

CLI Screenshots

Screenshot from 2024-08-14 12-47-21

Screenshot from 2024-08-14 12-48-24

About

Automated Golang project creation with a CLI tool. Includes Air and Makefile dev tools. It integrates the Goth auth library and the Gotth stack

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages