Skip to main content

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.

Getting PRMS running locally requires the backend (NestJS + MySQL) and the frontend (Angular) to both be configured and started. This guide walks through every step, from cloning the monorepo to opening Swagger in your browser.

Prerequisites

Before you begin, ensure the following are available on your machine:
ToolVersionRequired for
Node.js20.xBoth backend and frontend
npmBundled with Node.jsPackage management
MySQL8.xBackend database
DockerAny recent versionOptional: containerised runs
AWS CLI + Serverless FrameworkLatestOptional: Lambda deploys only
Node.js 20.x is the version used in the Docker image and AWS Lambda runtime. Using a different major version may cause unexpected build or runtime differences.

Clone and install

1

Clone the repository

git clone https://github.com/AllianceBioversityCIAT/onecgiar_pr.git
cd onecgiar_pr
2

Install root dependencies and set up Git hooks

The root package.json installs Husky, which wires pre-commit lint checks for the entire monorepo.
npm ci && npm run prepare
3

Install backend dependencies

cd onecgiar-pr-server && npm ci && cd ..
4

Install frontend dependencies

cd onecgiar-pr-client && npm ci && cd ..

Configure environment variables

Both apps read configuration from environment variables. Neither ships a committed .env file.
Never commit .env files or paste tokens, passwords, webhook URLs, or any credentials into source code, logs, or documentation. Secrets belong in environment variables, AWS Secrets Manager, or GitHub Secrets. This is a hard, project-wide rule enforced by .cursorrules.

Backend: onecgiar-pr-server/.env

Create .env inside onecgiar-pr-server/ with at minimum the following keys (mirror values from your local MySQL instance and team-shared secrets):
VariablePurpose
PORTHTTP port (default: 3000)
DB_HOSTMySQL host (e.g., localhost)
DB_PORTMySQL port (default: 3306)
DB_NAMEDatabase name
DB_USER_NAMEDatabase user
DB_USER_PASSDatabase password
JWT_SKEYJWT signing secret
JWT_EXPIRESJWT expiry duration
Additional keys are required for optional integrations:
  • RabbitMQ: RABBITMQ_URL, REPORTING_METADATA_EXPORT_QUEUE
  • AWS: S3, DynamoDB, and Cognito credentials
  • Active Directory (LDAP): AD host and bind credentials
  • CLARISA: catalog service URL and credentials
  • MQAP: external knowledge-product attribute service

Frontend: onecgiar-pr-client/src/environments/environment.ts

The Angular environment file is not a .env file — it is a TypeScript module that sets:
  • apiBaseUrl — points to the running backend (e.g., http://localhost:3000/)
  • Cognito client configuration
  • Pusher application key and cluster
The Angular interceptor (src/app/shared/interceptors/general-interceptor.service.ts) automatically attaches the custom auth: <JWT> header to every API request. You do not set this header manually.

Run locally

1

Start the backend

cd onecgiar-pr-server
npm run start:dev
The server starts on the port defined by env.PORT (default 3000) with auto-reload on file changes. Swagger is available at http://localhost:3000/api.
2

Start the frontend

cd onecgiar-pr-client
npm start
Angular CLI serves the app at http://localhost:4200.

Docker alternatives

If you prefer not to install Node.js and MySQL directly, both apps have Docker support.
cd onecgiar-pr-server
docker build -t prms-server .
docker run --env-file .env -p 3000:3000 prms-server
The backend Dockerfile is a multi-stage Node 20 Alpine build (base → development | production). Use the production stage for image builds. The frontend container serves the compiled static SPA through Nginx on port 80.
The Docker --env-file flag reads your local .env at runtime. The .env file itself must never be committed to the repository or included in the Docker image.

Verify the setup

Once both services are running, confirm the setup:
  1. Open http://localhost:3000/api — Swagger UI should load and list all API routes.
  2. Open http://localhost:4200 — the PRMS login screen should appear.
  3. Sign in using your CGIAR credentials (Cognito or Active Directory, depending on your environment configuration).

Build docs developers (and LLMs) love