https://github.com/traptitech/traportfolio
部員の活動紹介サービス traPortfolio
https://github.com/traptitech/traportfolio
hacktoberfest
Last synced: about 1 year ago
JSON representation
部員の活動紹介サービス traPortfolio
- Host: GitHub
- URL: https://github.com/traptitech/traportfolio
- Owner: traPtitech
- Created: 2020-06-03T04:45:38.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T17:54:38.000Z (over 1 year ago)
- Last Synced: 2025-04-09T21:51:10.993Z (about 1 year ago)
- Topics: hacktoberfest
- Language: Go
- Homepage: https://portfolio.trap.jp
- Size: 9.39 MB
- Stars: 6
- Watchers: 11
- Forks: 0
- Open Issues: 60
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# traPortfolio
[](https://GitHub.com/traPtitech/traPortfolio/releases/) [](https://github.com/traPtitech/traPortfolio/actions/workflows/main.yaml) [](https://github.com/traPtitech/traPortfolio/actions/workflows/image.yaml) [](https://codecov.io/gh/traPtitech/traPortfolio) [](https://apis.trap.jp/?urls.primaryName=traPortfolio)
- Backend repository
- [traPtitech/traPortfolio](https://github.com/traPtitech/traPortfolio) (this repository)
- Frontend repositories
- [traPtitech/traPortfolio-UI](https://github.com/traPtitech/traPortfolio-UI)
- [traPtitech/traPortfolio-Dashboard](https://github.com/traPtitech/traPortfolio-Dashboard)
## Requirements
- Go 1.22.5 or later
- Docker 27.1.0 or later
- Docker Compose 2.22.0 or later
## Quick Start
```bash
docker compose up # --build -d
```
or
```bash
# enable live reload
docker compose watch
```
Now you can access to
- for backend server.
- for adminer
- username: `root`
- password: `password`
- database: `portfolio`
- port: `3306`
## Contributing
If you want to contribute to traPortfolio, then follow these pages.
- [Architecture memo (in Japanese)](./docs/architecture.md)
- [API schema](./docs/swagger/traPortfolio.v1.yaml)
- [DB schema](./docs/dbschema)
## Tasks
Usable tasks are below.
> [!TIP]
> You can use `xc` to run the following tasks easily.
> See for more details.
>
> ```bash
> go install github.com/joerdav/xc/cmd/xc@latest
> ```
### gen
Generate code.
```bash
go generate -x ./...
```
### lint
Run linter (golangci-lint).
```bash
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run --fix ./...
```
### test:unit
Run unit tests.
```bash
go test -v -cover -race ./internal/...
```
### test:integration
Run integration tests.
```bash
go test -v -cover -race ./integration_tests/...
```
### test:all
Run all tests.
Requires: test:unit, test:integration
RunDeps: async
### db:migrate
Migrate the database.
```bash
# 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
```bash
rm -rf ./docs/dbschema
go run github.com/k1LoW/tbls@latest doc
```
### db:lint
Lint the database schema with tbls.
Requires: db:migrate
```bash
go run github.com/k1LoW/tbls@latest lint
```
### openapi:lint
Lint the OpenAPI schema with Spectral.
```bash
docker run --rm -it -w /tmp -v $PWD:/tmp stoplight/spectral:latest lint ./docs/swagger/traPortfolio.v1.yaml
```