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.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.
Prerequisites
Before you begin, ensure the following are available on your machine:| Tool | Version | Required for |
|---|---|---|
| Node.js | 20.x | Both backend and frontend |
| npm | Bundled with Node.js | Package management |
| MySQL | 8.x | Backend database |
| Docker | Any recent version | Optional: containerised runs |
| AWS CLI + Serverless Framework | Latest | Optional: 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
Install root dependencies and set up Git hooks
The root
package.json installs Husky, which wires pre-commit lint checks for the entire monorepo.Configure environment variables
Both apps read configuration from environment variables. Neither ships a committed.env file.
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):
| Variable | Purpose |
|---|---|
PORT | HTTP port (default: 3000) |
DB_HOST | MySQL host (e.g., localhost) |
DB_PORT | MySQL port (default: 3306) |
DB_NAME | Database name |
DB_USER_NAME | Database user |
DB_USER_PASS | Database password |
JWT_SKEY | JWT signing secret |
JWT_EXPIRES | JWT expiry duration |
- 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
Start the backend
env.PORT (default 3000) with auto-reload on file changes. Swagger is available at http://localhost:3000/api.Start the frontend
Docker alternatives
If you prefer not to install Node.js and MySQL directly, both apps have Docker support.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.
Verify the setup
Once both services are running, confirm the setup:- Open http://localhost:3000/api — Swagger UI should load and list all API routes.
- Open http://localhost:4200 — the PRMS login screen should appear.
- Sign in using your CGIAR credentials (Cognito or Active Directory, depending on your environment configuration).