Working with Client Projects
Client projects are created and managed using the yuuvis client CLI, a command-line tool that streamlines development, building, and deployment of yuuvis shell applications. Using the CLI ensures consistency and compatibility with the yuuvis shell platform.
Creating a New Client Project
Section titled “Creating a New Client Project”Create a new client project by running:
yuv new myclientThis generates a directory named myclient with the complete project structure and configuration files required for development.
During initialization, the CLI prompts you to select a shell version. You can specify:
- An exact version number (e.g.,
2.0.5) for precise version control - A release channel (
latestorstable) for automatic version resolution
Release channels are resolved to a concrete version at the time of execution, allowing you to leverage tested releases without manually tracking version numbers.
Updating the Shell
Section titled “Updating the Shell”Keeping your shell libraries up to date ensures you have access to the latest features, bug fixes, and security patches. There are two approaches to updating shell dependencies in your project.
Using the Update Script (Recommended)
The simplest method is to use the provided npm script, which updates all shell libraries to a specified version in one command:
npm run update:shell -- 2.6.0This script automatically updates @yuuvis/client-core, @yuuvis/client-shell-core, @yuuvis/client-framework, @yuuvis/client-shell, and @yuuvis/material to the specified version, ensuring consistency across all shell libraries.
Manual Update
Alternatively, you can manually update each library using npm. When updating manually, execute the commands in the following order to respect the dependency graph:
npm install @yuuvis/client-core@2.6.0npm install @yuuvis/client-shell-core@2.6.0npm install @yuuvis/material@2.6.0npm install @yuuvis/client-framework@2.6.0npm install @yuuvis/client-shell@2.6.0This sequence ensures that foundation libraries are updated first, followed by libraries that depend on them, preventing version conflicts.
Creating a New App
Section titled “Creating a New App”Create a new app by running:
yuv generate app myappThe CLI will prompt you for additional configuration parameters to set up your app, such as the app title, identifier, and routing options.
Importing an Existing App
Section titled “Importing an Existing App”To integrate a published app that was developed outside your project, use the add command:
yuv add app @yuuvis/app-driveThis command installs the app package as a dependency and integrates it into your client application.
Project Structure
Section titled “Project Structure”A generated client project follows a structured Angular workspace layout, combining standard Angular conventions with yuuvis-specific configurations.
myclient/├── src/ # Host application│ ├── app/ # Application root│ ├── assets/_yuuvis/ # yuuvis configuration and theming│ │ ├── config/ # Shell configuration files│ │ └── theme/ # Theme assets (icons, logos, CSS)│ ├── environments/ # Environment configurations│ └── styles/ # Global stylesheets├── projects/ # App libraries workspace│ └── myapp/ # Your application library│ ├── src/ # Application source code│ │ ├── lib/ # Components, services, routing│ │ └── assets/ # App-specific assets│ ├── extensions/ # Optional shell extensions│ ├── shared/ # Shared library code│ └── yuv-manifest.json # App manifest configuration├── scripts/ # Build and maintenance scripts├── angular.json # Angular workspace configuration├── package.json # Package configuration└── tsconfig.json # TypeScript configurationHost Application (src/)
The host application bootstraps the yuuvis shell and provides the runtime environment. It contains:
- Global configuration in
assets/_yuuvis/config/ - Theming assets including logos, icons, and custom CSS
- Environment-specific settings for development and production
App Library (projects/myapp/)
Your app code resides in an Angular library within the workspace. This structure enables:
- Modular, reusable components and services
- Independent versioning and packaging with
ng-packagr - Clear separation between application logic and shell infrastructure
App Manifest (yuv-manifest.json)
The manifest file defines how your application integrates with the shell:
{ "id": "com.example.myapp", "title": "Myapp Title", "ui": { "path": "myapp", "iconName": "logo_dev", "requires": ["osdrive"] "routes": "MyappRoutes", "options": { "appHeader": false, "hideFromNav": false } }, "extension": "MyappExtension"}For a comprehensive reference of all manifest properties and configuration options, see the App Manifest documentation.
Package Configuration (package.json)
The root-level package.json defines the project’s dependencies and npm scripts:
- Dependencies: All yuuvis shell libraries (
@yuuvis/client-core,@yuuvis/client-shell-core, etc.) and Angular packages - Scripts: Development commands for building, serving, testing, and maintaining the project
- Shell updates: The
update:shellscript allows updating all yuuvis libraries to a specific version
TypeScript Configuration (tsconfig.json)
The root tsconfig.json contains path mappings that define import aliases for your app library:
{ "compilerOptions": { "paths": { "myapp": [ "./projects/myapp/src/public-api.ts" ], "myapp/shared": [ "./projects/myapp/shared/src/index.ts" ], "myapp/extensions": [ "./projects/myapp/extensions/src/index.ts" ] } }}These path mappings map library names to their entry points, enabling clean imports throughout your project, e. g.:
import { MyappComponent } from 'myapp';import { SharedService } from 'myapp/shared';import { MyappExtension } from 'myapp/extensions';The CLI automatically updates these path mappings when you generate a new app in the project, ensuring that TypeScript can resolve the imports correctly.
Build Scripts
The scripts/ directory contains automation tools:
update-shell.js- Updates shell dependencies to a specified versioni18n-extract.js/i18n-collect.js- Internationalization workflowextract-client-version.js/extract-component-data.js- Collects the client’s version number as well as dependency and library metadata for About/License information
Building a Docker Image
Section titled “Building a Docker Image”When deploying the yuuvis client application to the yuuvis MOMENTUM ecosystem, it needs to be packaged as a Docker container. Since version 19.8, the yuuvis client CLI automatically generates the necessary files to build a Docker image for your client application.
Generated Docker Configuration
Section titled “Generated Docker Configuration”The CLI creates the following files when generating a new project:
- Dockerfile - Located in the project root directory
- nginx configuration - Located in
misc/nginx/default.conf
The Dockerfile uses the official nginxinc/nginx-unprivileged base image and copies the built Angular application into the directory served by nginx.
Patching Older Projects
Section titled “Patching Older Projects”If your project was created with yuuvis client CLI version earlier than 19.8.0, it may be missing the Docker configuration files. Starting with shell version 19.8.0, you can add these resources to your existing project using the patch command:
yuv patch apply p0003This patch automatically generates the missing Docker-related resources in your project, including:
- The Dockerfile in the project root
- The nginx configuration in
misc/nginx/default.conf - The
build:dockernpm script inpackage.json
The patch is idempotent—it only adds resources that are missing from your project, leaving existing customized files untouched.
Docker Build Script
Section titled “Docker Build Script”The CLI automatically generates an npm script to build the Docker image:
{ ... "scripts": { ... "build:docker": "npm run build && docker build -t client:latest ." ... } ...}This script creates a Docker image named client with the tag latest. This command first executes the standard Angular build process to compile the client application, then runs the Docker build process to create the Docker image. You can customize the image name and tag to identify different versions or environments.
Building the Docker Image
Section titled “Building the Docker Image”To build the Docker image, run:
npm run build:dockerDeploying the Docker Image
Section titled “Deploying the Docker Image”Once built, the Docker image can be deployed using:
- A Docker registry (e.g., Docker Hub, private registry)
- Container orchestration tools like Kubernetes or Docker Swarm