https://github.com/pythoninthegrass/twu
Toy app to get better at Go and dabble in HTMX
https://github.com/pythoninthegrass/twu
go golang htmx
Last synced: 10 months ago
JSON representation
Toy app to get better at Go and dabble in HTMX
- Host: GitHub
- URL: https://github.com/pythoninthegrass/twu
- Owner: pythoninthegrass
- License: unlicense
- Created: 2024-04-13T22:44:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-07T23:33:05.000Z (11 months ago)
- Last Synced: 2025-02-11T14:27:47.097Z (11 months ago)
- Topics: go, golang, htmx
- Language: Go
- Homepage:
- Size: 192 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# twu
`twu` consumes the [OpenWeatherMap API](https://openweathermap.org/current) to provide weather information for a given city.
It's built with Go and uses [HTMX](https://htmx.org/) to make the application interactive without writing _any_ JavaScript.
## Quickstart
* To run the application, execute the following commands:
```bash
# run the application
go run main.go
# quit the application
Ctrl + C
```
* Once it's running, you can access the application at `http://localhost:8080`.
* To build the application, execute the following commands:
```bash
# build the application
go build -o ./build/twu .
```
* To run the built application, execute the following commands:
```bash
# run the application
./build/twu
```
* To run the tests, execute the following commands:
```bash
# run the tests
go test ./...
```
## Setup
1. Install [Go](https://golang.org/doc/install).
2. Install [Visual Studio Code](https://code.visualstudio.com/).
3. Install [Go extension](https://code.visualstudio.com/docs/languages/go).
4. Clone and open this repository.
5. `F1` -> `Go: Install/Update Tools` -> (select all) -> OK.
## Build
### Terminal
* `make`: execute the build pipeline.
* `make help`: print help for the [Make targets](Makefile).
### Visual Studio Code
`F1` โ `Tasks: Run Build Task (Ctrl+Shift+B or โงโB)` to execute the build pipeline.
## Release
The release workflow is triggered each time a tag with `v` prefix is pushed.
_CAUTION_: Make sure to understand the consequences before you bump the major version.
More info: [Go Wiki](https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher),
[Go Blog](https://blog.golang.org/v2-go-modules).
## Maintenance
Notable files:
* [.github/workflows](.github/workflows) - GitHub Actions workflows,
* [.github/dependabot.yml](.github/dependabot.yml) - Dependabot configuration,
* [.vscode](.vscode) - Visual Studio Code configuration files,
* [.golangci.yml](.golangci.yml) - golangci-lint configuration,
* [.goreleaser.yml](.goreleaser.yml) - GoReleaser configuration,
* [Dockerfile](Dockerfile) - Dockerfile used by GoReleaser to create a container image,
* [Makefile](Makefile) - Make targets used for development, [CI build](.github/workflows) and [.vscode/tasks.json](.vscode/tasks.json),
* [go.mod](go.mod) - [Go module definition](https://github.com/golang/go/wiki/Modules#gomod),
* [tools.go](tools.go) - [build tools](https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module).
## Contributing
Feel free to create an issue or propose a pull request.
Follow the [Code of Conduct](CODE_OF_CONDUCT.md).