Gooal is built on the "GOTH" stack. Go for the majority, templ for our HTML & HTMX for the interactivity.
Our CSS is using SASS and are using very minimal JS to accomplish any front end functionality. At the time of writing, sortable and HTMX are the only external libraries we have minified in the codebase outside of any code we've written ourselves.
We've also chosen MongoDB for our database for it's flexible schemas.
Providing you have the necessary development tools installed, you can get up and running using the make
commands. Use make help
to see a list of options.
- Install Golang using asdf /
asdf plugin add golang && asdf install
- Install Templ from the docs /
go install github.com/a-h/templ/cmd/[email protected]
- Install Docker
- Install SASS CLI from the docs /
brew install sass/sass/sass
- Start your docker.
- Start the docker containers using
make up
. - Start the application with hot module reloading using
make hmr
.
Alternatively, if you don't need hot module reloading, you can just run go run cmd/gooal/main.go
or make start
To add tests, create a file with the suffix _test.go
next to the file you're testing, and run make test
to run the tests.
My current go-to debugging technique is to use our pkg/logger
package. This will add some color (both literally and figuratively) to your logs when you're debugging. There is also an issue to upgrade from this makeshift debugger: #67
Due to the way templ
s watch feature works, the generated go code will look different when running a watch instead of a standard templ generate
. The differently generated code would work in production, but it's not recommended to commit it as it's less performant.
Because of this, it's recommended to run make build
before committing code. This script will compile your scss as well as generate the correct templ files to push up.
After writing your great commit messages, create a PR with closing tags for the issues you're solving and write a summary in the description.
To check the above (templ file generation & scss), we run workflows on each step per PR which have to pass before merging.
To view a collection, enter the mongo cli with make dbCli
and run the following:
use gooal
db.templates.find()
To connect, add a connection to mongodb://root:[email protected]:27017/gooal?authSource=admin