- Backend repository
- traPtitech/traPortfolio (this repository)
- Frontend repositories
- Go 1.22.5 or later
- Docker 27.1.0 or later
- Docker Compose 2.22.0 or later
docker compose up # --build -dor
# enable live reload
docker compose watchNow you can access to
- http://localhost:1323 for backend server.
- http://localhost:3001 for adminer
- username:
root - password:
password - database:
portfolio - port:
3306
- username:
If you want to contribute to traPortfolio, then follow these pages.
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@latestGenerate code.
go generate -x ./...Run linter (golangci-lint).
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run --fix ./...Run unit tests.
go test -v -cover -race ./internal/...Run integration tests.
go test -v -cover -race ./integration_tests/...Run all tests.
Requires: test:unit, test:integration
RunDeps: async
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" backendGenerate database schema documentation with tbls.
Requires: db:migrate
rm -rf ./docs/dbschema
go run github.com/k1LoW/tbls@latest docLint the database schema with tbls.
Requires: db:migrate
go run github.com/k1LoW/tbls@latest lintLint the OpenAPI schema with Spectral.
docker run --rm -it -w /tmp -v $PWD:/tmp stoplight/spectral:latest lint ./docs/swagger/traPortfolio.v1.yaml