Cumulocity Web Development Tutorial - Part 1: Start your journey
Tags: iot, tutorial, webdeveloper, programming
Published: 2022-11-24 11:03:28

---
title: Cumulocity Web Development Tutorial - Part 1: Start your journey
published: true
date: 2022-11-11 13:42:29 UTC
tags: iot, tutorial, webdeveloper, programming
canonical_url: https://tech.forums.softwareag.com/t/cumulocity-web-development-tutorial-part-1-start-your-journey/259613
---

 

Starting your journey as a web developer in Cumulocity can be quite overwhelming in the beginning. There are a lot of concepts to discover and sometimes you simply get crushed by the amount of information available in the documentation.

![overwhelming](https://aws1.discourse-cdn.com/techcommunity/original/3X/f/2/f28a7bb057d24d6a7f9a005354aa6e5bddb7e678.gif)

To make your journey easier I have created this tutorial series. This tutorial series targets web developers, who want learn how they can implement custom applications, widgets and plugins for Cumulocity. The various articles of this series will teach fundamental concepts about web development in the context of Cumulocity and point out best practices. As a prerequisite it is assumed that you already have an understanding about [Angular](https://angular.io/docs) and [Typescript](https://www.typescriptlang.org/docs/). Furthermore, you need to have a Cumulocity tenant and also basic knowledge about [Cumulocity and its data model](https://cumulocity.com/guides/concepts/domain-model/).

## What topics can you expect?

The tutorial series is divided into multiple articles. Each article focuses on a specific topic accompanied by code samples. These code samples are shared in [this public github repository](https://github.com/SoftwareAG/cumulocity-web-development-tutorial), which allows you to review the code for an individual article. There are a couple of articles planned. This first article discusses general concept about web development in Cumulocity. In addition, you will set up your development environment and create your first custom web application. In the next article you will learn more about how you can extend the custom web application and create your first component. The third article demonstrates how you can use Cumulocity’s API to query data and display it in your web component. This web component will be converted into a Cumulocity widget in the fourth article. You will learn more about extending one of Cumulocity’s default applications as well. In the following articles you will extend this widget and get insight into the upcoming Microfrontend Framework.

Sounds interesting? Then let’s get started!

![overwhelming](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/a/cabee51d1a50cbee168a51e7dd79a19e949d4579.gif)

## Let’s get started

You first need to install [Node.js](https://nodejs.org/en/) to not only have a proper javascript runtime, but also the necessary package manager (npm) to install additional required tools and dependencies. Make sure to install Node.js `14.x.x`. Installing any later version might cause issues when trying to run or build a Cumulocity web application.

Once you have finished the setup of Node.js you can install the [@c8y/cli](https://www.npmjs.com/package/@c8y/cli) (command line interface) tool, which is provided by Cumulocity. The `@c8y/cli` supports you in creating, building and deploying your Cumulocity plugins and web applications. You can install the command line tools globally by running

```
npm install -g @c8y/cli

```

in your command prompt/terminal. This will install the latest official version, which is `1014.0.204` at the time of writing this article. As new versions of Cumulocity are released frequently you also need to update the cli tools regularly to have the latest version. Instead of installing the cli tools globally, I rather recommend to install these on demand using the `npx` command. `npx` is part of `npm` and allows you to run commands without having the package installed globally first. Furthermore, you can specify which version you want to have installed.

Let’s create an empty custom web application which is based on version `@c8y/cli@next` (1016.6.0 at the time of writing):

```
npx @c8y/cli@next new

```

Running this command will install the `@c8y/cli` locally in a cache and execute the `new` command. You will be guided by a wizard to set up your application. The wizard asks you for the name of the application, from which version to scaffold the project from and which template should be used:

[![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/e/2e5ff6f0e333c650953a618a5756c6a193349bf7.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/2/e/2e5ff6f0e333c650953a618a5756c6a193349bf7.png "image")

You can choose any name, e.g. `my-c8y-application`. Select version `latest`, in this case `1014.0.x`. Use the template `application` from which the project should be scaffolded from. The different templates are described in later articles. More information on creating new applications can be found in the [official documentation](https://cumulocity.com/guides/web/development-tools/#the-new-command).

Once the Cumulocity project has been generated by the `@c8y/cli`, you must install the dependencies. Change directory in the command prompt to your new project and install all necessary dependencies:

```
cd my-c8y-application
npm install

```

Once the installation is finished, you can start the Cumulocity web application:

```
npx c8ycli server -u <<C8Y-URL>>

```

Make sure to replace `<<C8Y-URL>>` with the URL of your Cumulocity instance. The `server` command will spin up a local web server and deploy the Cumulocity web application. The `-u` parameter specifies the Cumulocity instance to which all API requests should be proxied to. This means data is actually pulled from the configured Cumulocity instance. The same applies for the authentication. The application can be accessed in the browser via the URL: `http://localhost:9000/apps/my-c8y-application/`. In case you choose a different application name, you will see your application name instead of `my-c8y-application` in the URL.

You will be greeted by the login screen.

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/c/6/c6aeae564583b47747b394d90e32e8245ba2edac_2_541x500.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/6/c6aeae564583b47747b394d90e32e8245ba2edac.png "image")

Provide the tenant id and user credentials of you configured Cumulocity instance. The tenant id can be found in your configured Cumulocity tenant by clicking on your user at the top right of the header:

![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/8/a/8aecf81f00eea695b257437529dba1e18bc644d8.png)

When you successfully signed in to your local Cumulocity instance, you will see a blank application:

[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/a/b/abf93cd3740263d3a5a2f446f2af00e346ba71a1_2_690x346.png)](https://aws1.discourse-cdn.com/techcommunity/original/3X/a/b/abf93cd3740263d3a5a2f446f2af00e346ba71a1.png "image")

Great, you have set up your development environment and created your first Cumulocity web application. In the next articles, you will create plugins and widgets to bring some life to your web application. To stop your application, you can simply enter `[CTRL] + [C]` inside the terminal.

![alive](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/7/b750f2737167b86c4949ea4479696a3f2edc65e7.gif)

## Conclusion & Next steps

That’s it for part 1 of this tutorial series. You can find the sample application in the [github repository](https://github.com/SoftwareAG/cumulocity-web-development-tutorial/tree/main/part-01). In part 2 you will extend the empty application with a custom component. Furthermore, you will get to know some tips and best practices about c8y web development. If you like you can leave a comment if you want to see a specific topic to be covered in this tutorial series.

[Read full topic](https://tech.forums.softwareag.com/t/cumulocity-web-development-tutorial-part-1-start-your-journey/259613)