> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
