> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envzero.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Repository structure

> Understand how monorepo and single-repo structures work with env zero templates, including module source patterns and self-hosted Git server requirements.

env zero works with any repository structure you currently use. This page covers the key structural decisions that affect how you configure templates.

## Monorepo considerations

If multiple templates or environments share a single repository, configure each template in env zero to target the specific subdirectory for that stack. Use the [file filter pattern](/guides/admin-guide/environments/continuous-deployment) in continuous deployment settings to trigger each environment only when its subdirectory changes, not on every commit to the repo.

If your monorepo includes shared modules alongside root modules, configure the file filter to include both the root module path and the shared module path so that changes to either trigger a plan.

## Module source patterns

### Local modules

For modules sourced from the same repository (`source = "../modules/vpc"`), env zero can monitor both the root module directory and the module directory. Configure the file filter pattern to include both paths so that a change to the shared module triggers plans across all environments that use it.

### Git-sourced modules

For modules sourced via HTTPS (`source = "git::https://..."`) or SSH (`source = "git::ssh://..."`):

* **HTTPS**: requires a token. Pass it via a [custom flow](/guides/admin-guide/custom-flows) that configures git credentials before `init`.
* **SSH**: attach an [SSH key](/guides/admin-guide/variables/ssh-keys) to your template or environment.

### Terraform Registry modules

Modules from the public Terraform Registry or a [private registry](/guides/admin-guide/private-registry) work the same way in env zero as they do locally. Combine registry modules with [drift detection](/guides/admin-guide/environments/drift-detection) to catch when a new module version makes your deployed infrastructure stale.

## Self-hosted Git servers

If your infrastructure code is in a self-hosted VCS (GitHub Enterprise Server, Bitbucket Data Center, GitLab on-prem), env zero requires the [self-hosted agent](/guides/admin-guide/self-hosted-kubernetes-agent) to reach your network. Each self-hosted VCS instance needs its own agent.

See [Using self-hosted VCS](/guides/admin-guide/templates/self-hosted-vcs) for connection setup.

## Next steps

* [Managing templates](/guides/admin-guide/templates) - Create and configure templates in env zero.
* [Using self-hosted VCS](/guides/admin-guide/templates/self-hosted-vcs) - Connect private Git servers.
* [Continuous deployment](/guides/admin-guide/environments/continuous-deployment) - Trigger deployments on code changes.
