halcyon-org / kizuna

:ribbon: Connector uniting worlds unseen
0 stars 0 forks source link
backend

Kizuna

Dev dependencies

Tasks

[!NOTE] You can use xc(https://xcfile.dev/) to run the commands

See https://xcfile.dev/getting-started/#installation for installation instructions

init

Init development environment.

Run: once

if [ ! -f .env ]; then
  cp .env.example .env
fi
if [ ! -f .env.test ]; then
  cp .env.test.example .env.test
fi

check

Check golang code.

Requires: init, fmt, vet, lint, test RunDeps: async

fmt

Format golang code.

Requires: init

go fmt ./...

lint

Lint golang code.

Requires: init

golangci-lint run

vet

Vet golang code.

Requires: init

go vet ./...

test

Test golang code.

Requires: init, up, migrate:apply

go test ./...

build

Build golang code.

Requires: init, gen

go build -o bin/kizuna cmd/kizuna/main.go

gen

Generate golang code.

Requires: init

go generate ./...

up

Up the development environment.

Requires: init

docker compose up -d

migrate

Dry run the migrations.

Requires: init, up

go run cmd/migration/main.go --dry | sqlfluff fix - --dialect postgres

migrate:apply

Apply the migrations.

Requires: init, up

go run cmd/migration/main.go

down

Down the development environment.

Requires: init

docker compose down

down:all

Down the development environment and remove volumes.

Requires: init

docker compose down -v

run

Run the development environment.

Requires: init, up, migrate:apply

go run cmd/kizuna/main.go

cli

Run the cli.

Requires: init, up, migrate:apply

echo "RUN: go run cmd/kizuna-cli/main.go"

clean

go clean -testcache