htmxual is a demonstration application for building frontends without JavaScript. It utilizes Go Gin as the web server, Templ (a library for JSX-style templating in Go), and HTMX in the frontend. ๐
There are multiple examples included:
- /count shows a basic counter implemented without JavaScript.
- /todo demonstrates a simple todo list.
- /sse shows a simple chat application using server-sent events.
- /secure shows a simple login form with a protected page using basic auth
Counter Example: Visit /count/ to see a basic counter implemented without using JavaScript.
Todo List Example: Access /todo/ to explore a simple todo list demonstration.
Server-Sent Events: Visit /sse/ to see a simple chat application using server-sent events.
Secure Login: Access /secure/ to see a simple login form with a protected page using basic auth.
Go Gin: Web framework used for the backend.
Templ: Library for JSX-style templating in Go.
HTMX: Used in the frontend to enable interactions without traditional JavaScript.
To get the project up and running locally, follow these steps:
Clone the Repository: git clone https://github.com/niklastreml/htmxual.git
Navigate to the Directory: cd htmxual
Run the Application: Execute go run ./cmd/app
in your terminal.
Access the Application: Open your browser and go to http://localhost:8080/. ๐
To run htmxual
, you'll need to use Air to streamline the development process. Follow these steps:
Make sure you have Go installed on your machine.
- Install Air by running:
go get -u github.com/cosmtrek/air
-
Once Air is installed, navigate to the project directory.
-
In your terminal, run the following command:
air
-
Air will watch for file changes and automatically rebuild and restart the server.
-
Access the application by opening your browser and going to
http://localhost:8080/
.
- Access
/count/
to view the counter example. - Visit
/todo/
to explore the todo list functionality.
Contributions are welcome! If you'd like to add features, fix bugs, or improve the documentation, please feel free to submit pull requests.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE
file for details. ๐