# Libraries

A project can contain package repositories whose pipeline publishes your own packages and Docker images to the private GitLab registries of your organization.

> Source: https://www.application-platform.com/en/docs/libraries/

Code that several applications share does not belong in an app or a backend but in its own package repository. Besides apps, homepages, and backends, a project can contain several of them. Each package repository comes with a pipeline that versions the package and publishes it to the matching registry of your GitLab.

## Package types and their registries

When you create a package repository, you choose its type. The type determines where the pipeline publishes:

| Type | Registry |
|------|----------|
| Flutter/Dart package | GitLab Package Registry |
| npm package | GitLab npm Registry |
| PyPI package | GitLab PyPI Registry |
| Docker image | GitLab Container Registry |
| Go package | directly from the repository through the GitLab Go proxy |
| Terraform module or provider | GitLab Terraform Module or Provider Registry |
| Composer package | GitLab Composer Registry (coming next) |
| Maven package | GitLab Maven Registry (coming next) |

Composer and Maven packages are next in line. The wizard also knows Kotlin packages and VS Code plugins as package types. All registries belong to the GitLab group of your project and stay private unless you open them explicitly.

## From repository to registry

1. Create the package repository as a **Package** component when creating or editing a project and choose the type.
2. Develop the package as usual. The pipeline is already in place, and you do not edit `.gitlab-ci.yml` by hand.
3. On every push to `main`, the pipeline computes the version from the commit messages (`feat:`, `fix:`) and publishes the package to the registry from the table.
4. In your apps and backends, you include the package through the private registry.

When you import an existing repository with the ap CLI or the agent, the platform recognizes a folder as a package only if it clearly is one; the list of recognized types is in [Import an existing repository]({{< relref "agent-project-import" >}}).

