> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/tools/openg2p-developer-setup/custom-registry-gen2-extension.md).

# Custom Registry Gen2 extension

You choose a slug (example: `disability-registry`). That drives DB names, ports, Keycloak client, and image names - everything else (Postgres, Keycloak realm, IAM, AWE, ID Generator, Celery pattern) is common.

| Item             | Example (`disability-registry`)                       |
| ---------------- | ----------------------------------------------------- |
| Package          | `make extension-package NAME=disability-registry`     |
| Bootstrap        | `make extension-setup NAME=…`                         |
| Run              | `make extension-run NAME=…`                           |
| Extension folder | `disability-extension`                                |
| Python module    | `openg2p_registry_disability_extension`               |
| DBs              | `disability_registry_db`, `disability_master_data_db` |
| Keycloak client  | `disability-registry-staff-portal`                    |
| Default ports    | API `8041`, UI `3020` (auto-increment if taken)       |
| Generated env    | `generated/<NAME>/`                                   |

### Commands

```bash
cp .env.example .env
make setup && make infra-up          # common
make extension-package NAME=disability-registry
make extension-setup NAME=disability-registry
make extension-run NAME=disability-registry
```

Options:

```bash
make extension-package                                    # interactive
make extension-package NAME=… REPO_URL=https://github.com/you/….git
make extension-package NAME=… SETUP=1                     # package + setup
```

### Scaffold layout

```
disability-registry/
├── docker/          # staff API, celery, partner, UI, db-seed, scripts/build.sh
├── helm/openg2p-disability-registry/
└── disability-extension/src/openg2p_registry_disability_extension/
```

### Docker images / Helm (product repo)

```bash
chmod +x docker/scripts/build.sh
./docker/scripts/build.sh
PUSH=1 ./docker/scripts/build.sh --push staff-portal-api/develop.txt
```

```bash
cd ../openg2p-workspace/disability-registry/helm/openg2p-disability-registry
helm dependency update
helm install disability-registry . --namespace openg2p-disability-registry --create-namespace
```

Add `id_types` in openg2p-developer `config/id-generator/default.yaml` if functional IDs are required; restart id-generator.

### Makefile

| Target                                                    | Purpose                               |
| --------------------------------------------------------- | ------------------------------------- |
| `extension-package`                                       | Scaffold                              |
| `extension-setup`                                         | IAM/AWE/migrate/seed (like nsr-setup) |
| `extension-run`                                           | API + Celery + IAM + AWE + UI         |
| `extension-migrate` / `extension-seed` / `extension-init` | Schema / SQL / both                   |

Login still uses common `staff` / `staff`. Re-run `make keycloak-init` if the client was added after first infra start.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.openg2p.org/tools/openg2p-developer-setup/custom-registry-gen2-extension.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
