# RDGraph Portal Documentation ## Introduction

The RDGraph portal is built with Angular, a popular open-source web application framework for building dynamic, single-page applications (SPAs). The current version of Angular in this application is version 16.

Angular Server-Side Rendering (SSR), also known as Angular Universal, is used in this application, which allows rendering on the server, sending pre-rendered HTML to the client's browser.

## System Architecture ![](./src/assets/architecture.png)

Users can access the RDGraph portal via the https://beta.rdgraph.openaire.eu domain and browse the contents of the EOSC Research Discovery Graph (RDGraph) or search by keywords and persistent identifiers.
The search results can be sorted by relevance, date or a variety of impact-based indicators, such as citation count, popularity, influence and impact.
Additionally, simple or advanced filters on multiple metadata fields can be applied to further narrow down the search results.
The searchable entities within the RDGraph portal are research products (publications, research data, research software, other research products), projects, services (including data sources) and organizations.

The RDGraph Portal portal also serves detailed pages for specific research products, providing an overview of all the metadata available in RDGraph and the relationships among the entities of the graph, such as related research, supplementary research, funding projects, related organizations and data sources. Users can navigate through the different entities of RDGraph by following the relationships.

Metrics, indicators and charts, calculated by OpenAIRE or external tools, are also available in the detailed pages of the RDGraph portal.

## Building Run **npm install** to build the application. A folder node-modules containing all the dependent libraries will be created. ### Build - CSR
Use the npm run build-dev for a development build.
Use the npm run build-beta for a beta build.
Use the npm run build-prod for a production build.
### Build - SSR
Use the npm run build:ssr-dev for a development build.
Use the npm run build:ssr-beta for a beta build.
Use the npm run build:ssr-prod for a production build.
## Deployment ### Development server Run **npm start** for a dev server. Navigate to http://localhost:5200/. The app will automatically reload if you change any of the source files. ### Run SSR **npm run serve:ssr** will run the last server build. ## Installation

The application can be deployed in a machine with installed Node.js and NPM (Node Package Manager) by simply running the commands of the Building and Deployment sections.
Current versions of the production deployment are version 16.20.2 for Node.js and version 8.19.4 for NPM.

The production deployment is managed with PM2 (Process Manager 2), version 5.3.0, which is a popular and widely used process manager for Node.js applications.
PM2 supports zero-downtime application reloads by gracefully switching to the new version without interrupting user requests and runs the application in the background. The start, stop, restart and managing processes of the application are simplified by the following commands:

The source code of the project can be found in this repository.

## Configuration An Angular application has several configuration files that help define and manage various aspects of the application. These files are important for project setup, development, and deployment.