This project is a refactor of an application previously written with SvelteKit and PocketBase, now using Go, HTMX, Alpine.js, and Tailwind CSS.
- Go: The backend server, responsible for handling HTTP requests and serving static files.
- HTMX: Handles interactivity with the backend by enabling dynamic updates to the HTML without the need for full page reloads.
- Alpine.js: Provides declarative reactive components for a simpler, more lightweight approach to JavaScript behavior.
- Tailwind CSS: A utility-first CSS framework for rapid UI development.
- Tailwind CLI: Used for building Tailwind CSS without the need for Node.js.
- Go: Ensure you have Go installed on your system. You can download it from golang.org.
- Tailwind CSS CLI: The standalone CLI is used for building Tailwind CSS. No Node.js required. Read more about this here: Tailwind CSS CLI.
-
Clone the repository
git clone https://github.com/yourusername/go-dls.git cd go-dls
-
Setup environment variables
Create a
.env
file or rename.evn.example
in the root of the project and add/modify the following:HTTP_LISTEN_PORT=3000
-
Run Tailwind CSS CLI
Download the Tailwind CSS standalone CLI from the official website and place it in your project directory.
Build Tailwind CSS:
./tailwindcss -i ./static/css/tailwind-input.css -o ./public/styles.css --watch
This command will watch for changes and automatically rebuild the CSS.
-
Run the Go server
go run main.go
The server will start and be accessible at
http://localhost:3000
.
- /public: Contains static files including the built Tailwind CSS.
- /src: Contains source files for Tailwind CSS.
- /templates: Contains template files.
- /handlers: Contains Go handler functions for various routes.