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.
- Install Air for Hot Reloading. Follow the Air installation guide.
- Install Bun for Tailwind CSS. Follow the Bun installation guide.
- Clone the repository.
git clone https://github.com/bnema/kickstart-echo.git .
- Remove the .git folder and initialize a new one.
rm -rf .git && git init
- Remove go.mod, go.sum and create a new project.
rm go.mod go.sum && go mod init github.com/username/project
- Install package dependencies.
go mod tidy
- Run Bun install for Tailwind CSS dependencies.
bun install
- Execute Tailwind with Bun.
bun run dev:css
- Create a .env at the root of the project (see .env.example).
- Run the Application (Air will rebuild and restart the application on code changes).
air
- If the 2 previous commands are successful, you can run dev.sh who will run them in parallel.
chmod +x dev.sh ./dev.sh
- 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
Under the GPL-3.0 license. Please see the LICENSE file for more details.