Article

Category: Expert stories

Nx for Angular: A reliable tool simplifying the work with IT projects

In this article, emagineer & front-end developer Kamil Naja explores how Nx can benefit Angular projects, as well as its compatibility with other technologies like React and Node. Let's take a closer look at why Nx is a valuable tool to consider.

Kamil Naja, Warsaw

Nx is a tool that simplifies the process of building monorepo projects. In this article, I will focus on its main applications in projects using Angular. This tool also allows for collaboration with various other technologies such as React or Node. Here's why you should pay attention to Nx!

 

Task: Application Configuration

The default configuration of Angular, which we get when generating a project using Angular CLI, is often customized to suit our needs. For example, changing from Karma to Jest or switching the linter to ESLint.

When dealing with just one project, this is a straightforward process. However, when managing several projects, it becomes time-consuming. Any changes to settings in one project must be reflected in all the others.

Artboard 8

By organizing the code in a monorepo (using Nx), you can create a single configuration and share it among multiple projects. New projects added to the workspace will automatically use the existing configuration.

When creating components, you can also choose the option to generate end-to-end tests using Cypress. Jest is used as the default test runner in Angular applications.

In my opinion, it's easier to start an Angular project with Nx than with Angular CLI because it helps avoid these tedious and often challenging configuration changes. The default settings include configured Prettier, ESLint, and Jest, which seems sufficient. The tool also simplifies integration with Storybook.

Once you already have an existing Nx workspace, you can easily add additional applications and libraries to it. Nx also makes it straightforward to migrate projects that were previously managed separately into a monorepo.

 

Task: Application Breakdown

The primary tool for working with Angular is Angular CLI. It is mainly used for generating various components of an application.

Nx (with the @nx/angular plugin) makes it even easier to generate components, services, and various types of libraries. Nx allows you to build libraries, including those you want to publish through npm, which I'll describe in the next paragraph. You could say that the tools provided by Nx elevate the creation of elements to a higher level.


 

  Angular CLI is essential, but Nx (@nx/angular) takes it further. Effortlessly generate components, services, and libraries, elevating your development process.

 


The Nx console is quite extensive, and for complex commands, it's worthwhile to use the Nx Console IDE plugin for support.

Nx works in collaboration with ESLint, allowing you to introduce restrictions on importing various types of elements among themselves (dependency boundaries), making it easier to maintain a consistent project architecture. For instance, in an application utilizing NgRx, you can enforce that components never directly connect with services.

Additionally, Nx saves you from the need to write repetitive boilerplate code. It's an adaptable tool with several online plugins available, enhancing its functionality.

 

Task: Code Sharing

Nx makes it easy to share code among multiple applications. It enables the generation of various types of libraries, such as:

  • Feature library - a library containing UI elements that can access data to solve specific business problems.
  • UI library - a library with presentational components.
  • Data-access library - a library providing data access, often fetched from the backend.
  • Utility library - a library containing methods used in various parts of the application.

The naming of these library types is important, as it allows you to organize code into clearly defined layers, and you know which types of libraries can interact with each other.

laptop

From my perspective, working in this way seems simpler than the standard approach, which involves creating a library as a separate project, making changes to it, changing its version, and then installing it in an Angular application using npm. Code sharing reduces the amount of work and helps avoid duplication.

 

Task: Shortening Production Time

One of the challenges when working with Angular is the lengthy build times and execution of unit tests. The application is rebuilt from scratch every time, even when nothing has changed.

Nx helps reduce these calculations because the codebase is divided into independent modules. If you build code that has been rebuilt previously and hasn't changed, you'll get near-instant results from the cache. The commands that can be cached include build, lint, test, and e2e.

Nx allows for parallel computation and cloud-based cache sharing. In my opinion, this is Nx's most significant advantage because daily work involves executing commands repeatedly. Faster build times greatly improve the developer experience.


 

  Nx allows for parallel computation and cloud-based cache sharing, which is its most significant advantage.

 


Task: Application Structure Visualization

The nx:graph command shows how individual elements of the application are connected, making it easier to visualize the architecture. You can also use the nx affected:graph command to see how the application changes after adding your modifications.

Summary

Nx is useful for anyone interested in building complex applications, especially when it comes to code sharing. It can speed up certain tasks, help start new projects without tedious configuration, and simplify the creation of individual application elements. The only potentially confusing aspect for a beginner is the fact that there are numerous options available when working with Nx.

Nevertheless, Nx comes highly recommended by many experts. Its implementation is straightforward, and with extensions, you can tailor it even better to your specific needs.

Ready to grow?

Get help with your CV and profile and be found for rewarding projects.

Blog

Read more

left-arrow
right-arrow

Expertise strategy

The rise of sustainability-linked loans

In this article, Jesper Diget, CPO at emagine, explores how linking sustainability initiatives to the bottom line is reshaping business strategies.

Expertise strategy

How to keep teams productive in the hybrid working era

Martin Hartley, CCO of emagine, shares insights on successful hybrid working through balancing in-person collaboration, creating team synergy through the use of virtual tools, and supporting individual productivity patterns.

Expertise strategy
Trends

Business trend in 2025: Urgency for CEOs to take back IT ownership to drive growth

Dive into the evolving role of technology in business growth and explore the strategies leaders are using to balance outsourcing and insourcing, all while navigating the challenges of a dynamic, tech-driven landscape.

Expertise strategy

Possibilities and risks for Germany as a modern tech nation

This article explores Germany’s digital challenges, where gaps in skills and tech adoption risk its global competitiveness despite a strong industrial base and top technical universities.

Expertise strategy
Strategy, change & transformation

Using AI to streamline resource allocation

As global digital transformation spending heads toward $3.9 trillion by 2027, this article explores an AI resource allocation case from emagine HQ, other AI optimizations, and common challenges.

Data & Analytics
Expertise strategy

AI and the Ethics Tango

Discover the evolving relationship between humans and advanced technologies. Our article delves into the ethical considerations and risks associated with modern machines, highlighting how the complexity of today’s tech goes beyond simple utility.

Expertise strategy
Risk & Compliance

How to enhance cybersecurity measures

Enhance cybersecurity measures with updated systems, training, and secure remote work practices to protect your business. Explore here.

Expertise strategy
Training

The future of workplace upskilling and training

This article examines the importance of workplace upskilling, current trends, and how technological advancements will shape the future of workplace learning.

The agile transformation of a large enterprise is a complex process that requires profound changes in leadership, structure, and corporate culture.
Expertise strategy
Projects & Implementation
Tech & Development

Developments of AI in Project Management

This article discusses how the integration of artificial intelligence (AI) and machine learning (ML) into project management is driving a cultural shift towards innovation and agility within organizations.

Consultants assessing regulatory documents
Expertise strategy
Risk & Compliance

What is NIS 2 and how should businesses prepare?

With increasing cyberattacks, organizations must prioritize compliance, improve cyber hygiene, and implement standards like ISO/IEC 27001 to build resilience and reduce risks. Learn what NIS 2 is and how businesses should prepare for this comprehensive European cybersecurity directive.

Expertise strategy
Risk & Compliance

The future of preventing Financial Economic Crime and the importance of KYC

Understanding KYC protocols, AML regulations, and broader financial crime trends is vital for maintaining financial integrity. This article discusses key developments in compliance, KYC, and AML.

Data & Analytics
Expertise strategy
Tech & Development

New EU Act on Artificial Intelligence

Learn the ins and outs of the world’s first comprehensive legal framework on AI, the new EU AI Act and its anticipated impact on businesses.

Illustration of a solid chain with code written in the metal
Expertise strategy
Risk & Compliance

Digital Operational Resilience Act (DORA)

Here’s everything you need to know about the Digital Operational Resilience Act (DORA) which will apply from 17th January 2025.

Expertise strategy
Risk & Compliance

Proposed Code of Practice on cybersecurity governance

Explore the UK Government’s latest draft on cybersecurity governance Code of Practice together with emagine’s expert, Trine Øksnebjerg.

A business consultant ready to give a presentation at work.
Expertise strategy
Strategy, change & transformation

Embracing change as an opportunity for growth

In this article, we outline the best practices when it comes to navigating organizational change, including how to tackle challenges and maintain a clear vision when unprecedented issues arise.

Modern business environment with a man and woman in front of window facing a city
Expertise strategy

People-centric leadership: Tips for fostering digital wellbeing at work

This article equips team leaders with strategies for fostering digital wellbeing in the workplace, empowering them to guide their teams through the challenges that come with prolonged screen-time, hybrid work, and other factors of digitalisation in a modern workplace.

Expertise strategy
Strategy, change & transformation

Empower your teams through strategic thinking

This article considers why strategic thinking is crucial to effective leadership and explores some practical ways for leaders at all levels to develop this skill.

Consultants and advisors i an office space seen from above
Expertise strategy
Trends

Insights into 2024 business trends

With 2023 behind us and eyes fixed firmly on what opportunities 2024 will bring, Gillian Whelan, Country Manager of emagine Ireland, outlines five trends that will affect businesses this year.

Female consultant standing and writing on a desk
Expertise strategy
Risk & Compliance

Steering AML challenges: Embracing technology for a seamless future

Discover how to navigate AML challenges with automated processes and fortify your organization’s integrity and operations.

Bestshoring
Data & Analytics
Expertise strategy

Poland: An AI Centre of Excellence

AI is reshaping industries globally, and Poland’s thriving ecosystem positions it as a leader in AI development. emagine’s Cloud Administrator explores why Poland is a powerhouse in AI.

Business consultants conducting a meeting
Expertise strategy
Managed Teams & Managed Service
Staff augmentation

Managed Resourcing Services vs. Traditional Staff Augmentation

In the ever-evolving landscape of business operations, companies are constantly looking for ways to optimise their workforce strategies. Explore the two popular approaches that have gained prominence: Managed Resourcing Services (MRS) and traditional staff augmentation.

Expertise strategy
Risk & Compliance

Programme Governance: Top tips for success

In this article, we share some tips to navigate the intricate landscape of orchestrating interconnected projects and activities within a strategic framework.

Project manager at a meeting with his team.
Expertise strategy
Projects & Implementation

What has changed in PMBOK 7?

PMBOK is regularly updated to accommodate new trends, best practices, and developments in the field. How much has it changed between editions?

A team leader in front of her team
Expertise strategy
Projects & Implementation

The importance of leadership skills in a Project Manager

Behind every successful project lies a competent and visionary leader. In this article, we delve into the undeniable importance of leadership within project management and explore how effective leadership can be the driving force behind achieving project objectives.

Advisory & Solutions
Expertise strategy
Strategy, change & transformation

Building your PMO – Influence and Position

There are a number of things to consider when introducing a PMO. The Project Management Office fails far too often because of the wrong approach, and it can only be successful in the long term if fundamental questions are considered at an early stage.

Doug Collyer is Country Manager in UK
Expertise strategy
Strategy, change & transformation

The Nordic way of working: how does it help emagine consultants optimise their clients’ operations and boost profits?

emagine’s Nordic way of working embraces different perspectives and approaches to solve challenges and power progress among our consultants. Learn how our experts and Nordic work style can optimise our client’s operations and profitability.

thre people in a amicable meeting
Expertise strategy
Staff augmentation

Good onboarding: Setting your external workforce up for success

Enabling new consultants seamlessly integrate into your organisation is critical to their success. To ensure a smooth onboarding process, it is essential to help them get started immediately. This article will guide you through the most critical aspects of getting a consultant to start delivering from day one.

External consultants at a meeting in the office.
Expertise strategy
Staff augmentation

4 signs you need an IT consultant

Are you wondering if your company could benefit from hiring an IT consultant? This article outlines four common signs that indicate you may need external expertise to manage change, mitigate risk, or meet tight deadlines.

Bestshoring
Expertise strategy
Nearshoring
Publications

The Ultimate Guide to Nearshoring

Get our ultimate guide on how your IT organization can tap into Polish IT talent. Download the e-book and read condensed knowledge, facts and cases about Nearshoring based on our 12 years experience. Download now and get it free.

Expertise strategy
Tech & Development

The Complete Guide to Migrating Monolithic Applications to Microservices on the Cloud

As organizations strive to deliver high-quality software and services at scale, many are turning to a microservices architecture as a way to break down monolithic applications into smaller, more manageable components.

Modern business environment with a man and woman in front of window facing a city
Expertise strategy
Staff augmentation

The Science behind hiring the top 10%

As a business and technology consulting firm, we live of our ability to recruit the very top talent for our business. In this piece, I would like to share our thoughts behind the approach we on emagine UK. We call it: The science behind hiring the top 10%.

Expertise strategy
Strategy, change & transformation

People hate change, so how do you best implement it?

Bringing in new technology, individuals, or new teams to work on a key project can feel like a threat to existing staff – but it doesn’t have to be that way if you manage change positively.

Expertise strategy
Strategy, change & transformation

Key Success And Failure Factors Of The PMO

In this article, we will delve into Project Management Office (PMO) overview, and we will help you decide if it may be convenient for your team to have a PMO.

IT professionals outside engaging in conversation
Bestshoring
Expertise strategy
Nearshoring

Poland, the IT hub of Europe?

Poland has become a European talent hub in technology and engineering, and European companies leverage polish talent coding skills for nearshoring projects. Learn why.

Business woman talking to two colleagues
Expertise strategy
Staff augmentation

Team extension: How to hire external consultants successfully

Hiring external consultants isn’t something you should treat lightly. Learn the most satisfactory way to leverage experts in your organisation. In this article, Senior Account Manager Jytte Raahede shares her tips on onboarding consultants successfully.

Four professionals sitting together in a positive meeting smiling
Bestshoring
Expertise strategy
Nearshoring

A short guide to succeeding with Nearshoring

For many companies, the decision to go nearshore is not an easy one. It’s a decision that requires a great deal of consideration – we know that because several of our current clients were also reluctant to go nearshore at first. Learn our tips on how to get it right.