How mosip/resident-ui works
1. Repository shape
- This repo is a multi-part delivery for the MOSIP Resident UI:
- resident-ui/ — the Angular single-page application.
- residenttest/ — a Java-based automated test rig for the UI flows.
- deploy/ and helm/ — packaging and Kubernetes deployment assets.
- The architecture is therefore split between runtime UI, test automation, and cluster deployment.
2. Primary runtime: Angular SPA
- resident-ui/ is the main product. It is a client-side Angular app built with Angular CLI, TypeScript, and npm.
- It is packaged to run behind Nginx (Dockerfile, nginx.conf, default.conf, download.conf) rather than through a custom app server.
3. Application shell and cross-cutting flow
- The app is organized around a central shell in src/app/ with:
- app.module.ts, app-routing.module.ts
- global config and constants
- HTTP interception and route protection
- Core request flow goes through services like:
- httpinterceptor.ts for API request/response handling
- authguard.service.ts, can-deactivate-guard.service.ts
- authservice.service.ts, auto-logout.service.ts, logout.service.ts
- config.service.ts and app-config.service.ts for runtime configuration
4. Feature boundary: resident self-service workflows
- The UI is divided into lazy-style feature areas under src/app/feature/, each representing a resident workflow:
- booking — appointment/center selection, including map-based selection
- downloaduin — download UIN
- getuin — retrieve UIN
- verify — verification flow
- document — document-related interactions
- uinservices — the main resident services hub
- dashboard and error
- Within uinservices, the functional sub-areas map directly to business capabilities:
- update demographic data
- lock/unlock authentication
- revoke VID
- share data with partner
- track service requests
- view history
- personalised/physical card requests
- grievance handling
5. Shared UI and reusable components
- Common functionality is centralized in src/app/shared/:
- header, dialog, captcha, progress, pdf-viewer
- sanitization pipes and router helpers
- a shared logger implementation
- This indicates a component-library-like boundary inside the app, separating reusable UI behavior from workflow-specific screens.
6. State and service model
- The app appears service-driven rather than heavily state-managed. Feature components mostly coordinate through Angular services and shared models:
- core/models and shared/models
- service classes in core/services and feature/.../*.service.ts
- Data exchange is typed with request/response models, and feature screens are thin orchestration layers over backend APIs.
7. Localization and runtime asset-driven behavior
- The UI is internationalized via src/assets/i18n/*.json with multiple languages.
- Runtime behavior is also influenced by static assets such as:
- src/assets/config.json
- change-action scripts in src/assets/changeActions/
- UI templates and icons/fonts
- This suggests the app can be deployed with environment-specific configuration without rebuilding application logic.
8. External dependencies implied by the UI
- The frontend is not self-contained; it is a client to external Resident/MOSIP platform APIs.
- It also integrates with:
- captcha handling
- PDF rendering
- authentication/session flows
- map/center selection for bookings
- The assets/sharewithpartner.json and identity spec files suggest document/schema-driven interactions with backend services.
9. Container and Kubernetes packaging
- resident-ui/Dockerfile packages the compiled Angular app into an Nginx image.
- helm/resident-ui/ defines the Kubernetes deployment boundary with:
- deployment, service, ingress, gateway, virtualservice, hpa, configmap, and service account templates
- This points to deployment in a service-mesh / ingress-based cluster environment, not a standalone VM app.
10. Operational deployment scripts
- deploy/resident-ui/ contains install, delete, restart, and certificate-upload flow scripts.
- deploy/resident-uitestrig/ provides matching deployment scripts for the test rig.
- These scripts are likely used for environment bootstrapping and operational refreshes alongside Helm.
11. CI/CD and release handling
- .github/workflows/ includes chart lint/publish, release-change, tag, and push-trigger workflows.
- The repo is set up for automated chart validation and release management, with signed key material stored under .github/keys/.
12. Automated test rig: separate Java system
- residenttest/ is a distinct Java/Maven project, not part of the UI runtime.
- It contains:
- TestNG-based test cases for each resident flow
- REST and authentication utilities
- reporting, screenshots, and email/SMTP support
- It behaves like an integration test harness that drives the Resident UI scenarios and validates end-to-end behavior.
13. Test rig external integrations
- The Java test rig includes utilities for:
- REST client calls
- Keycloak user management
- kernel authentication
- S3 access
- SMTP monitoring
- report generation
- This means the test architecture spans the UI plus supporting platform services, and is designed for realistic environment validation rather than isolated unit tests.
14. Overall architecture diagram boundary
- The cleanest diagram for this repo should show:
- Browser user → Angular SPA served by Nginx
- SPA → external Resident/MOSIP backend services
- SPA cross-cutting concerns: auth, captcha, localization, PDF, logging
- Helm/Kubernetes as the deployment layer
- Java Test Rig as a separate verification pipeline exercising the same workflows against deployed environments
Main entry points: app.module.ts App shell · main.ts Resident UI · Chart.yaml Helm chart · pom.xml UI test rig
Components 22
Resident UI runtime
Angular SPA and its cross-cutting application layers
- Browser user · Resident accessing the UI
- Resident UI · Client-side application served by Nginx
resident-ui/src/main.ts - App shell · Top-level module and routing boundary
resident-ui/src/app/app.module.ts - Runtime config · App configuration and environment bootstrap
resident-ui/src/app/app-config.service.ts - Core flow · Authentication, routing, logout, and HTTP interception
resident-ui/src/app/core/services/httpinterceptor.ts - Shared UI · Reusable header, dialogs, captcha, progress, and PDF viewer
resident-ui/src/app/shared/shared.module.ts - Localization · Language bundles and runtime text resources
resident-ui/src/assets/i18n/default.json - Booking flow · Appointment and center selection workflow
resident-ui/src/app/feature/booking/booking.module.ts - UIN services · Main resident self-service entry and capability hub
resident-ui/src/app/feature/uinservices/uinservices-routing.module.ts - Verify flow · Verification workflow for resident data
resident-ui/src/app/feature/verify/verify.module.ts - Document flow · Document-related interactions
resident-ui/src/app/feature/document/document.module.ts - Download UIN · UIN download workflow
resident-ui/src/app/feature/downloaduin/downloaduin.module.ts - Get UIN · UIN retrieval workflow
resident-ui/src/app/feature/getuin/getuin.module.ts - Dashboard · Landing and summary view
resident-ui/src/app/feature/dashboard/dashboard.module.ts - Resident APIs · MOSIP resident and identity services consumed by the SPA
Test automation
Separate Java harness that exercises resident workflows end to end
- UI test rig · Separate Java project for resident UI end-to-end validation
residenttest/pom.xml - Test cases · Resident workflow scenarios such as booking, login, update, and history
residenttest/src/main/java/io/mosip/testrig/residentui/testcase/BookinganAppointment.java - Test utilities · REST, auth, reporting, screenshots, SMTP, and environment helpers
residenttest/src/main/java/io/mosip/testrig/residentui/utility/TestRunner.java
Delivery and deploy
Container, Helm, and operational deployment assets
- Nginx package · Static SPA hosting and reverse-proxy packaging
resident-ui/Dockerfile - Helm chart · Deployment, service, ingress, gateway, and virtual service templates
helm/resident-ui/Chart.yaml - Deploy scripts · Install, delete, restart, and certificate upload flows
deploy/resident-ui/install.sh - GitHub Actions · Chart linting, tagging, and release workflows
.github/workflows/chart-lint-publish.yml
Connections 28
- Browser user → Resident UI: uses · Residents interact with the SPA in the browser
- Resident UI → App shell: bootstraps · Angular entry point loads the application shell
- App shell → Runtime config: reads · Shell initializes runtime configuration
- App shell → Core flow: routes via · Routing, guards, auth, and HTTP interception shape every request
- App shell → Shared UI: renders · Shell and features reuse common UI building blocks
- App shell → Localization: localizes · UI text comes from language bundles
- App shell → Booking flow: loads · Booking is a lazy feature area
- App shell → UIN services: loads · Resident services hub is a central feature area
- App shell → Verify flow: loads · Verification is a feature boundary
- App shell → Document flow: loads · Document interactions are isolated as a feature
- App shell → Download UIN: loads · Download UIN is a dedicated flow
- App shell → Get UIN: loads · UIN retrieval is a dedicated flow
- App shell → Dashboard: loads · Dashboard provides an entry view
- Core flow → Resident APIs: calls · Services and interceptor exchange data with resident backend APIs
- Booking flow → Resident APIs: calls · Booking workflow fetches and submits appointments and center data
- UIN services → Resident APIs: calls · Resident self-service actions are API-driven
- Verify flow → Resident APIs: calls · Verification flow queries backend identity data
- Document flow → Resident APIs: calls · Document interactions rely on platform services
- Download UIN → Resident APIs: calls · Download flow retrieves identity artifacts from services
- Get UIN → Resident APIs: calls · Retrieval flow depends on backend lookup services
- Nginx package → Resident UI: packages · Compiled Angular app is served through Nginx
- Helm chart → Nginx package: deploys · Kubernetes chart deploys the containerized UI
- Deploy scripts → Helm chart: operates · Scripts install, restart, and manage release assets
- GitHub Actions → Helm chart: publishes · Automation validates and releases the chart
- UI test rig → Test cases: contains · Maven test project organizes resident scenarios
- UI test rig → Test utilities: uses · Shared utilities support execution, reporting, and environment setup
- Test cases → Resident UI: exercises · Scenarios drive the deployed Resident UI
- Test utilities → Resident APIs: integrates · Harness also reaches surrounding platform services and auth systems