template-tanukistack

module
v0.0.0-...-8a16859 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2026 License: MIT

README

Template of tanukistack

What is tanukistack?

Tanukistack is a template for the development of web application. This contains the following components:

How to use

Requirements
  • gonew command
$ go install golang.org/x/tools/cmd/gonew@latest
Create a new project
$ gonew github.com/mackee/template-tanukistack path/to/your/module ./your_directory
$ cd path/to/your/project
$ aqua i
Settings

.env file is required to run the application. Create a .env file in the root directory of the project and write the following contents.

$ echo 'DATABASE_DSN="postgres://user:password@localhost:5432/dbname?sslmode=disable"' > .env
Run the application
$ task dev
Run the test
$ task test

Use with devcontainer

A devcontainer setup is provided so you can develop without installing Go, task, or PostgreSQL on the host.

Requirements
  • Docker
  • devcontainer CLI
    $ brew install --cask devcontainer
    # or: npm install -g @devcontainers/cli
    
Usage
$ task dc:up                       # build & start the container (first run takes a while)
$ task dc:exec -- task test        # run tests against the postgres sidecar
$ task dc:exec -- task dev         # run the dev server (forwarded to host :8080)
$ task dc:shell                    # open a shell inside the container
$ task dc:down                     # stop & remove containers (volumes are kept)
Notes
  • DATABASE_DSN is set in containerEnv to point at the bundled postgres sidecar, so a host .env is not required.
  • aqua-managed tools (go, task) are installed on postCreate and cached in a named volume.
  • The postgres data volume (pgdata) is preserved across dc:down / dc:up.

License

MIT

Directories

Path Synopsis
cmd
app command
Code generated by github.com/mackee/go-sqlla/v2/cmd/sqlla - DO NOT EDIT.
Code generated by github.com/mackee/go-sqlla/v2/cmd/sqlla - DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL