The Aibar SRL App frontend is an Angular 22 single-page application bootstrapped with the Angular CLI. This guide walks you through every step needed to get a fully working local development environment — from cloning the repository to opening the app in your browser — and covers the npm scripts, code-generation commands, testing setup, and code-style tooling used across the project.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lucavallini/aibar-frontend/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure the following tools are available on your machine:- Node.js 18 or later — nodejs.org
- npm 11 or later — bundled with Node.js; verify with
npm --version - Angular CLI 22 — install globally with:
Setup Steps
Install dependencies
Install all Node.js dependencies declared in This will populate
package.json. The project pins its package manager to npm@11.12.1, so npm is the only supported installer:node_modules/ with Angular 22, Vitest, Prettier, and all other project dependencies.Configure the environment
Before starting the dev server, confirm that
src/environments/environment.ts points at the backend API you want to use. By default it targets http://127.0.0.1:8000, which is the local FastAPI backend.See the Environment Configuration page for full details on how to switch between local, staging, and production backends.Start the development server
Launch the Angular dev server using the Angular CLI:The CLI compiles the application, starts the dev server on port 4200, and watches all source files for changes. Any time you save a
.ts, .html, or .css file, the browser reloads automatically — no manual refresh needed.npm Scripts
Thepackage.json defines the following scripts. You can run any of them with npm run <script> or invoke the underlying ng command directly if you have the Angular CLI installed globally.
| Script | Command | Description |
|---|---|---|
ng | ng | Exposes the Angular CLI binary for direct invocation via npm run ng -- <command> |
start | ng serve | Starts the development server on http://localhost:4200 with live reload |
build | ng build | Compiles the app for production and writes output to dist/ |
watch | ng build --watch --configuration development | Continuously rebuilds the app in development mode on every file save |
test | ng test | Executes the full unit-test suite with Vitest |
Angular CLI Code Generation
The Angular CLI ships with a powerful schematic system for scaffolding new building blocks. Useng generate (or its alias ng g) to create components, services, guards, pipes, and more — the CLI writes the files and wires up the correct imports automatically.
src/app/. Component schematics produce a .ts class file, an inline or external template, a stylesheet, and a .spec.ts test file.
Testing
Aibar SRL App uses Vitest as its unit-test runner — not the legacy Karma/Jasmine setup that older Angular projects used. The@angular/build:unit-test builder (configured in angular.json) integrates Vitest directly into the Angular CLI toolchain.
Run the full test suite:
*.spec.ts naming convention. The tsconfig.spec.json includes "vitest/globals" in its types array, which makes Vitest’s describe, it, expect, and related globals available in every spec file without explicit imports:
Code Style
The project enforces a consistent code style through two configuration files at the repository root:Prettier (.prettierrc)
Prettier handles automatic code formatting. The project configuration sets:
printWidth: 100— lines wrap at 100 characterssingleQuote: true— TypeScript files use single quotesparser: "angular"— HTML templates are formatted with the Angular-aware parser
EditorConfig (.editorconfig)
EditorConfig keeps editor settings consistent across IDEs (VS Code, IntelliJ, etc.):
- Indentation: 2 spaces for all files
- Charset: UTF-8
- Trailing whitespace: trimmed on save (except in Markdown)
- Final newline: always inserted
- TypeScript: single quotes enforced at the editor level
.editorconfig automatically. For VS Code, install the EditorConfig for VS Code extension if it is not already active.