The PRMS frontend is an Angular 19 single-page application built with PrimeNG 19 and served behind Nginx in production. This guide covers the page module convention, API service naming, the custom authentication header, build and lint commands, state management, and theming.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AllianceBioversityCIAT/onecgiar_pr/llms.txt
Use this file to discover all available pages before exploring further.
Technology stack
| Component | Technology |
|---|---|
| Framework | Angular 19.2 |
| UI library | PrimeNG 19 + @primeng/themes/aura via reportingTheme.ts |
| State management | Angular signals + BehaviorSubject (no NgRx) |
| Unit tests | Jest (jest-preset-angular) |
| E2E tests | Cypress |
| Real-time | pusher-js + ngx-socket-io |
| Charts / exports | chart.js, exceljs, pdfjs-dist, file-saver |
| Production server | Nginx (nginx.conf + Dockerfile) |
Page module layout
Feature pages live underonecgiar-pr-client/src/app/pages/<feature>/. Top-level surfaces include:
results/— Result Creator, Result Detail, Results Outletipsr/— Innovation Package pathway stepsquality-assurance/— QA queue and review draweradmin-section/— Admin shell (roles, users, phases, parameters)home/— Landing page aggregatestype-one-report/— PMU Type-One Reportresult-framework-reporting/— Cross-cutting reporting flowsoutcome-indicator/,pdf-reports/,whats-new/
src/app/shared/.
API service naming
All HTTP methods on API service classes follow the conventionHTTP_METHOD_descriptiveName. The HTTP verb is the prefix, and the rest is a descriptive camelCase name:
src/app/shared/services/api/results-api.service.ts. The aggregating ApiService at src/app/shared/services/api/api.service.ts exposes all feature services as fields.
Custom auth header
PRMS usesauth: <JWT> as the authentication header — not Authorization: Bearer. The Angular interceptor (src/app/shared/interceptors/general-interceptor.service.ts) attaches the token from local storage to every outgoing request automatically.
The interceptor also:
- Skips the
authheader for Elasticsearch requests (those use their own credentials) - Triggers a “green checks” refresh after successful
PATCH/POSTon a Result Detail route - Triggers IPSR completeness refresh for
/api/ipsr/*calls
notValidateList in general-interceptor.service.ts.
Build and lint commands
Run all commands from theonecgiar-pr-client/ directory.
Linting
E2E testing
State management
PRMS does not use NgRx. State is held in injectable services exposed through Angularsignals or BehaviorSubject streams:
DataControlService— global data control and form-state flagsFieldsManagerService— field-level read/write and validation stateGlobalVariablesService— environment-wide flags- Phase context lives at the shell level — do not introduce per-page phase pickers
Internationalization
All user-facing strings must go throughsrc/app/internationalization/. Hard-coded English in templates is not permitted.
Theming and design tokens
Design tokens are defined insrc/styles/colors.scss and src/styles/fonts.scss, all prefixed with --pr- for CSS custom properties and .pr- for utility classes. The PrimeNG theme (src/app/theme/reportingTheme.ts) mirrors the SCSS tokens using the @primeng/themes/aura preset.
Rule: when changing a color or typography value, update src/styles/colors.scss first, then reflect the change in reportingTheme.ts. Never the other way around.
Common token examples:
darkModeSelector: 'light' in app.module.ts) — dark mode is not supported.
Production Nginx serving
In production, the compiled Angular SPA is served by Nginx usingonecgiar-pr-client/nginx.conf. The Nginx configuration handles:
- Serving static files from the Angular output directory
- Falling back to
index.htmlfor all routes (required for client-side routing) - Cache headers for hashed asset files
Guards and routing
Top-level routes are assembled insrc/app/shared/routing/routing-data.ts. Feature modules lazy-load via their own routing modules.
check-login.guard.ts— gates all authenticated routes; redirects to login and preserves the original deep linkcheck-admin.guard.ts— gates admin routes; hiding nav items alone is never sufficient
?phase= query parameter.