{"id":37147409,"url":"https://github.com/kazdevl/prelviz","last_synced_at":"2026-01-14T17:23:31.038Z","repository":{"id":213566521,"uuid":"726837112","full_name":"kazdevl/prelviz","owner":"kazdevl","description":"a vizualization tool for self custom package relation","archived":false,"fork":false,"pushed_at":"2023-12-26T14:15:55.000Z","size":3052,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-26T16:31:59.255Z","etag":null,"topics":["dot","go","golang","graphviz"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kazdevl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-03T14:51:54.000Z","updated_at":"2023-12-21T18:46:52.000Z","dependencies_parsed_at":"2023-12-26T16:13:52.184Z","dependency_job_id":null,"html_url":"https://github.com/kazdevl/prelviz","commit_stats":null,"previous_names":["kazdevl/prelviz"],"tags_count":4,"template":null,"template_full_name":null,"purl":"pkg:github/kazdevl/prelviz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazdevl%2Fprelviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazdevl%2Fprelviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazdevl%2Fprelviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazdevl%2Fprelviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kazdevl","download_url":"https://codeload.github.com/kazdevl/prelviz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kazdevl%2Fprelviz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dot","go","golang","graphviz"],"created_at":"2026-01-14T17:23:30.385Z","updated_at":"2026-01-14T17:23:31.033Z","avatar_url":"https://github.com/kazdevl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prelviz\nA **visualization tool** for **self custom package** relation by creating dot format file.\nThis tool help you to understand self custom package relation and maintain project architecture.\n\n![png](images/1.png)\n※ above image is the result of using `prelviz` to `testdata/sample_project` without config.\n\n## Install\n\nYou can get `prelviz` by `go install` command.\n\n```bash\n$ go install github.com/kazdevl/prelviz/cmd/prelviz@v1.1.0\n```\nNOTE: you need go 1.21 or later.\n\n## How to use\n```bash\n$ prelviz -i {{project directory path}}\n```\n\n```bash\n$ prelviz -i {{project directory path}} -l {{dot layout}}\n```\n\n```bash\n$ prelviz -i {{project directory path}} -o {{output file path}}\n```\n\n```bash\n$ prelviz -i {{project directory path}} | dot -Tsvg -o sample.svg\n```\nNOTE: if you want to exec above usage, you need to install [graphviz](https://www.graphviz.org/).\n\n### Use with config\nIf you want to use `prelviz` with config, you need to create `.prelviz.config.json` in project directory path.\n`.prelviz.config.json` have four fields, `ng_relation`, `grouping_grouping_directory_path`, `exclude_package` and `exclude_directory_path`.\n\nexample)\n\n```json\n{\n  \"ng_relation\": [\n    {\n      \"from\": \"github.com/kazdevl/sample_project/app/usecase\",\n      \"to\": [\"github.com/kazdevl/sample_project/app/domain\"]\n    }\n  ],\n  \"grouping_directory_path\": [\"app/domain\"],\n  \"exclude_package\": [\n    \"github.com/kazdevl/sample_project/app/util\",\n    \"github.com/kazdevl/sample_project/app/domain/entity\"\n  ],\n  \"exclude_directory_path\": [\"github.com/kazdevl/sample_project/app/exclude\"]\n}\n```\n\nYou can set `from` and `to` value in `ng_relation` when you want to **detect dependencies that violate the project's architecture**.\nWhen you set `from` and `to` value, you have to set package path.\nIf `prelviz` detects architecture violation, the color of edges between the target packages turns red.\n\nexample)\n\n![png](images/2.png)\n\nYou can set `grouping_directory_path` when you want to **group packages in the result image of `prelviz`**.\nWhen you set `grouping_directory_path` value, you have to set directory path.\n\nexample)\n\n![png](images/3.png)\n\nYou can set `exclude_package` when you want to **exclude packages in the result image of `prelviz`**.\nWhen you set `exclude_package` value, you have to set package path.\n\nexample)\n\n![png](images/5.png)\n\nYou can set `exclude_directory_path` when you want to **exclude packages in target directoies in the result image of `prelviz`**.\nWhen you set `exclude_directory_path` value, you have to set directory path.\n\n### Point\nThe values in `grouping_directory_path` are treated as package, so it must also be considered when setting `ng_relation`.\n\nexample)\n\nthe sample go project\n- module name: `github.com/kazdevl/sample_project`\n- package list\n  - `github.com/kazdevl/sample_project/app/usecase`\n  - `github.com/kazdevl/sample_project/app/domain/service`\n  - `github.com/kazdevl/sample_project/app/domain/repository`\n  - `github.com/kazdevl/sample_project/app/domain/entity`\n  - `github.com/kazdevl/sample_project/app/domain/model`\n- directory path\n```\n.\n└── app\n    ├── domain\n    |   ├── service\n    |   |   ├── sample1.go\n    |   |   └── sample2.go\n    |   ├── repository\n    |   |   ├── sample1.go\n    |   |   └── sample2.go\n    |   ├── entity\n    |   |   ├── sample1.go\n    |   |   └── sample2.go\n    |   └── model\n    |       ├── sample1.go\n    |       └── sample2.go\n    └── usecase\n        ├── sample1.go\n        └── sample2.go\n```\n- config before setting `grouping_directory_path`\n```json\n{\n  \"ng_relation\": [\n    {\n      \"from\": \"github.com/kazdevl/sample_project/app/usecase\",\n      \"to\": [\"github.com/kazdevl/sample_project/app/domain/model\"]\n    }\n  ]\n}\n```\n\nIn the above situation, when setting the `grouping_directory_path`, you need to modify the config as follows\n```json\n{\n  \"ng_relation\": [\n    {\n      \"from\": \"github.com/kazdevl/sample_project/app/usecase\",\n      \"to\": [\"github.com/kazdevl/sample_project/app/domain\"]\n    }\n  ],\n  \"grouping_directory_path\": [\"app/domain\"]\n}\n```\n`to` value is `github.com/kazdevl/sample_project/app/domain`, not `github.com/kazdevl/sample_project/app/domain/model`.\n![png](images/4.png)\n\n\n### Recomendation\nIf you try to use `prelviz` to the go project that have a lot of packages, it is recommended to set `grouping_directory_path` and `exclude_directory_path` in `.prelviz.config.json`.\nOtherwise, when the output is converted to an image, the number of elements is too large and visibility is catastrophic.\n\n### Flags\n```\n  -i string\n        requreid: \"true\", description: \"input project directory path\"\n  -l string\n        requreid: \"false\", description: \"dot layout. ex) dot, neato, fdp, sfdp, twopi, circo\" (default \"dot\")\n  -o string\n        requreid: \"false\", description: \"output file path(default is stdout)\"\n```\n\n## Prelviz Image Description\n- color of node indicates node type\n  - `blue`: package\n  - `green`: directory\n- color of edge indicates dependency type\n  - `white`: default\n  - `red`: architecture violation\n- `pkg` in blue node indicates package name\n- `pkg` in green node indicates the number of packages under the node\n- `path` in blue node indicates directory path that package exists\n- `path` in green node indicates directory path\n- `dep` on edge indicates number of dependencies on structures, functions, etc. of the package to which the arrow points\n\n## Example\nThe result of using `prelviz` to [pipecd](https://github.com/pipe-cd/pipecd) with the following `.prelviz.config.json` settings.\n\n```json\n{\n    \"grouping_directory_path\": [\n        \"examples\",\n        \"pkg/admin\",\n        \"pkg/app/helloworld\",\n        \"pkg/app/launcher\",\n        \"pkg/app/ops\",\n        \"pkg/app/pipectl\",\n        \"pkg/app/piped\",\n        \"pkg/app/server\",\n        \"pkg/cache\",\n        \"pkg/cli\",\n        \"pkg/config\",\n        \"pkg/crypto\",\n        \"pkg/datastore\",\n        \"pkg/diff\",\n        \"pkg/filestore\",\n        \"pkg/git\",\n        \"pkg/insight\",\n        \"pkg/jwt\",\n        \"pkg/log\",\n        \"pkg/redis\",\n        \"pkg/rpc\",\n        \"test/integration\",\n        \"tool\"\n    ]\n}\n```\n\n### dot layout is `dot`\n![png](images/6.png)\n\n### dot layout is `circo`\n![png](images/7.png)\n\n## Contributing\nWelcome to contribute to this project.\n\nFork and make a Pull Request, or create an Issue if you see any problem or any enhancement, feature request.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazdevl%2Fprelviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazdevl%2Fprelviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazdevl%2Fprelviz/lists"}