Skip to content

部員の活動紹介サービス traPortfolio

Notifications You must be signed in to change notification settings

traPtitech/traPortfolio

Repository files navigation

traPortfolio

GitHub release CI Build image codecov OpenAPI

Requirements

  • Go 1.22.5 or later
  • Docker 27.1.0 or later
  • Docker Compose 2.22.0 or later

Quick Start

docker compose up # --build -d

or

# enable live reload
docker compose watch

Now you can access to

Contributing

If you want to contribute to traPortfolio, then follow these pages.

Tasks

Usable tasks are below.

Tip

You can use xc to run the following tasks easily. See https://xcfile.dev for more details.

go install github.com/joerdav/xc/cmd/xc@latest

gen

Generate code.

go generate -x ./...

lint

Run linter (golangci-lint).

go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run --fix ./...

test:unit

Run unit tests.

go test -v -cover -race ./internal/...

test:integration

Run integration tests.

go test -v -cover -race ./integration_tests/...

test:all

Run all tests.

Requires: test:unit, test:integration

RunDeps: async

db:migrate

Migrate the database.

# TODO: use environment variables for config
docker compose run --build --entrypoint "/traPortfolio -c /opt/traPortfolio/config.yaml --db-host mysql --only-migrate" backend

db:gen-docs

Generate database schema documentation with tbls.

Requires: db:migrate

rm -rf ./docs/dbschema
go run github.com/k1LoW/tbls@latest doc

db:lint

Lint the database schema with tbls.

Requires: db:migrate

go run github.com/k1LoW/tbls@latest lint

openapi:lint

Lint the OpenAPI schema with Spectral.

docker run --rm -it -w /tmp -v $PWD:/tmp stoplight/spectral:latest lint ./docs/swagger/traPortfolio.v1.yaml