Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AllianceBioversityCIAT/alliance-research-indicators-client/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through getting the Alliance Research Indicators client running on your machine from a fresh clone to a live dev server. All commands are run from inside the research-indicators/ subdirectory, which is where the Angular workspace lives.
1

Clone the repository

git clone https://github.com/AllianceBioversityCIAT/alliance-research-indicators-client.git
cd alliance-research-indicators-client
2

Move into the Angular workspace

The repository root contains documentation and configuration files. The Angular application itself lives one level deeper.
cd research-indicators
All subsequent commands in this guide assume research-indicators/ as the working directory.
3

Install dependencies

npm install
This installs everything declared in package.json — Angular 19, PrimeNG 19, RxJS, Chart.js, and all dev tools (Jest, ESLint, Stylelint, Prettier). The first install on a fresh clone typically takes 1–2 minutes.
4

Configure the environment files

The app reads three service URLs from src/environments/. The src/environments/ directory is git-ignored (only a .gitkeep is committed). Copy or create the files you need:
src/environments/
├── environment.ts        ← default (production) environment
└── environment.dev.ts    ← development environment (used by ng serve)
A minimal environment file looks like this:
export const environment = {
  production: false,
  mainApiUrl: 'https://your-api.example.com/',
  textMiningUrl: 'https://your-text-mining.example.com/',
  fileManagerUrl: 'https://your-file-manager.example.com/',
  saveErrorsUrl: '',
  fastResponseUrl: '',
  feedbackUrl: '',
  frontVersionUrl: ''
};
Ask your team lead for the development values. See the environment variable reference below for what each field means.
5

Start the development server

npm start
Angular CLI starts a Webpack dev server at http://localhost:4200 with hot-module replacement enabled. Changes to TypeScript, HTML, and SCSS are reflected immediately in the browser without a full page reload.

npm script reference

All scripts are invoked from the research-indicators/ directory.
ScriptCommandDescription
startnpm startDev server at http://localhost:4200 with hot reload
buildnpm run buildProduction build → dist/research-indicators/browser/
build-devnpm run build-devDevelopment build with sourcemaps
watchnpm run watchIncremental dev build in watch mode
testnpm run testRun Jest unit tests once
test:watchnpm run test:watchJest in watch mode (interactive)
test:coveragenpm run test:coverageCoverage report (floors: stmts 40% / branches 20% / lines 45% / functions 30%)
lintnpm run lintAngular ESLint — TypeScript and HTML templates
s-lintnpm run s-lintStylelint — all **/*.scss files
compose:up:devnpm run compose:up:devStart Docker Compose dev profile
compose:up:prodnpm run compose:up:prodStart Docker Compose prod profile

Environment variable reference

VariableRequiredDescription
mainApiUrlYesBase URL of the primary NestJS REST API. All calls through ApiService are prefixed with this URL. Include the trailing slash.
textMiningUrlYesBase URL of the AI/NLP text-mining microservice. Used for auto-fill and content extraction on result forms.
fileManagerUrlYesBase URL of the evidence file upload service. Multipart uploads go here; the service returns a persistent URL that is attached to the result record.
saveErrorsUrlNoExternal error-tracking endpoint. Set to an empty string in development.
fastResponseUrlNoURL for the fast-response AI endpoint.
feedbackUrlNoURL for the user-interaction feedback endpoint.
frontVersionUrlNoURL of the deployed version.json asset used by VersionWatcherService to detect stale builds.

Path alias reference

TypeScript path aliases are declared in tsconfig.json and mirrored in jest.config.ts. Use these instead of deep relative imports in all new code.
{
  "@public/*":       "public/*",
  "@envs/*":         "src/environments/*",
  "@pages/*":        "src/app/pages/*",
  "@platform/*":     "src/app/pages/platform/*",
  "@auth/*":         "src/app/pages/auth/*",
  "@landing/*":      "src/app/pages/landing/*",
  "@shared/*":       "src/app/shared/*",
  "@components/*":   "src/app/shared/components/*",
  "@services/*":     "src/app/shared/services/*",
  "@interfaces/*":   "src/app/shared/interfaces/*",
  "@interceptors/*": "src/app/shared/interceptors/*",
  "@guards/*":       "src/app/shared/guards/*",
  "@sockets/*":      "src/app/shared/sockets/*",
  "@utils/*":        "src/app/shared/utils/*",
  "@ts-types/*":     "src/app/shared/types/*"
}
If you add a new alias to tsconfig.json, you must add the same entry to jest.config.ts so unit tests continue to resolve imports correctly.

Build docs developers (and LLMs) love