# golang-standards/project-layout architecture

> Architecture diagram of the GitHub repository golang-standards/project-layout, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/golang-standards/project-layout
- Repository: https://github.com/golang-standards/project-layout

## Overview

This repository is a generic Go project-layout template, not an implemented application or runtime library. Its README describes where application entry points, private code, and reusable public packages belong; the tree contains placeholders only, so there is no concrete user-to-result workflow to map. The only indexed source file is go.mod. The graph therefore shows documented layout roles, not inspected runtime calls.

Main entry points: [`cmd`](https://github.com/golang-standards/project-layout/tree/master/cmd) (App entry points), [`internal/app`](https://github.com/golang-standards/project-layout/tree/master/internal/app) (Private app code), [`pkg`](https://github.com/golang-standards/project-layout/tree/master/pkg) (Public libraries), [`internal/pkg`](https://github.com/golang-standards/project-layout/tree/master/internal/pkg) (Private shared packages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application code"]
  node_commands["App entry points"]
  node_private_app["Private app code"]
  node_private_shared["Private shared packages"]
end

subgraph group_libraries["Go libraries"]
  node_public_lib["Public libraries"]
end

subgraph group_support["Project support"]
  node_api["API definitions"]
  node_configs["Configuration"]
  node_deployments["Deployment assets"]
  node_web["Web assets"]
  node_module["Go module<br/>[go.mod]"]
end

node_developer(("Project developer"))

node_developer -->|"creates apps"| node_commands
node_commands -.->|"invokes privately"| node_private_app
node_commands -.->|"imports libraries"| node_public_lib
node_private_app -.->|"may share code"| node_private_shared
node_developer -->|"publishes reusable code"| node_public_lib

click node_commands "https://github.com/golang-standards/project-layout/tree/master/cmd"
click node_private_app "https://github.com/golang-standards/project-layout/tree/master/internal/app"
click node_private_shared "https://github.com/golang-standards/project-layout/tree/master/internal/pkg"
click node_public_lib "https://github.com/golang-standards/project-layout/tree/master/pkg"
click node_api "https://github.com/golang-standards/project-layout/tree/master/api"
click node_configs "https://github.com/golang-standards/project-layout/tree/master/configs"
click node_deployments "https://github.com/golang-standards/project-layout/tree/master/deployments"
click node_web "https://github.com/golang-standards/project-layout/tree/master/web"
click node_module "https://github.com/golang-standards/project-layout/blob/master/go.mod"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_private_app,node_private_shared toneBlue
class node_public_lib toneAmber
class node_api,node_configs,node_deployments,node_web,node_module toneMint
class node_developer toneIndigo
```

## Components

### Application code

- [App entry points](https://github.com/golang-standards/project-layout/tree/master/cmd): `cmd`
- [Private app code](https://github.com/golang-standards/project-layout/tree/master/internal/app): `internal/app`
- [Private shared packages](https://github.com/golang-standards/project-layout/tree/master/internal/pkg): `internal/pkg`

### Go libraries

- [Public libraries](https://github.com/golang-standards/project-layout/tree/master/pkg): `pkg`

### Project support

- [API definitions](https://github.com/golang-standards/project-layout/tree/master/api): `api`
- [Configuration](https://github.com/golang-standards/project-layout/tree/master/configs): `configs`
- [Deployment assets](https://github.com/golang-standards/project-layout/tree/master/deployments): `deployments`
- [Web assets](https://github.com/golang-standards/project-layout/tree/master/web): `web`
- [Go module](https://github.com/golang-standards/project-layout/blob/master/go.mod): `go.mod`

### Other components

- **Project developer**

## Connections

- Project developer → App entry points: creates apps (evidence: `README.md`)
- App entry points → Private app code: invokes privately (evidence: `README.md`)
- App entry points → Public libraries: imports libraries (evidence: `README.md`)
- Private app code → Private shared packages: may share code (evidence: `README.md`)
- Project developer → Public libraries: publishes reusable code (evidence: `README.md`)
