# Deployment Guide

This guide contains all the information required for successful deployment and running of Resident Portal. It includes information about the Database and template scripts, seed data, roles, OIDC client setup, etc.

## DB scripts

Resident Service DB Scripts to be run: [DB scripts](https://github.com/mosip/resident-services/tree/v1.2.1.0/db_scripts/mosip_resident)

## Master-data Template Scripts

The master-data templates required for the Resident portal are added to the [template](https://github.com/mosip/mosip-data/blob/develop/mosip_master/xlsx/template.xlsx) and [template type](https://github.com/mosip/mosip-data/blob/develop/mosip_master/xlsx/template_type.xlsx) DML excel files in [mosip/mosip-data](https://github.com/mosip/mosip-data/tree/v1.2.1.0) repository. These scripts need to be applied to the corresponding table.

## Keycloak Roles

`mosip-resident-client` needs to have below roles in keycloak:

* `RESIDENT`
* `SUBSCRIBE_AUTH_TYPE_STATUS_UPDATE_ACK_GENERAL`
* `SUBSCRIBE_AUTHENTICATION_TRANSACTION_STATUS_GENERAL`
* `SUBSCRIBE_CREDENTIAL_STATUS_UPDATE_GENERAL`
* `SUBSCRIBE_REGISTRATION_PROCESSOR_WORKFLOW_COMPLETED_EVENT_GENERAL`
* `CREDENTIAL_REQUEST`

### Resident OIDC Client setup

Here is the document which explains how `resident-oidc` partner is onboarded through [partner-onboarder after deployment](https://github.com/mosip/mosip-onboarding/tree/v1.2.0.1).

For more details on how to configure the Resident OIDC client, refer [here](/1.2.0/id-lifecycle-management/identity-management/resident-services/deploy/resident-services-configure-resident-oidc-client.md).


---

# Agent Instructions: 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:

```
GET https://docs.mosip.io/1.2.0/id-lifecycle-management/identity-management/resident-services/deploy/resident-services-deployment-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
