You may have noticed the new Apps widget on the IBM Cloud dashboard—but is your widget sadly underpopulated?

Are you interested in knowing more about apps? Let’s explain more as we create a cloud-native Node.js app from scratch.

 Apps are a logical way to group all the cloud resources that make up a deployed instance. Apps can include source code (either downloaded or linked from a git repo), services (and corresponding credentials), deployments (Cloud Foundry, Kubernetes, or Virtual Server), and DevOps toolchains (including continuous delivery pipelines and service/tool integrations used to continuously deliver code).

Creating an app

To understand a bit more about apps, let’s create one now. Click Create an app from the App widget in the IBM Cloud dashboard.

On the Create App screen, fill in App name and Resource group. Tags are optional. Now we are presented with a big decision—Bring your own code (BYOC) or Create a new app. We will be going through the BYOC flow next time, so click Create new app, which will generate a simple application structure and all of the necessary support/deployment files.

 After selecting Create a new app, a few different options are enabled. For this example, select Node.js as the Platform. We’ll skip the OpenAPI document for now, but know that you can add your own swagger definition here and IBM will generate the API scaffolding in our starter code for you. Click Create and, in a few moments, we will be on the App details screen.

Add a service

With the app itself is created, go ahead and add a database before deploying. From the App details screen, click Create new under the Services section. In the pop-up modal, you can choose from a variety of services: Web and Application, Databases, Analytics, Developer Tools, Security, AI, and more.

For our case, select Databases, click Next, and choose Cloudant. Once you fill in all the details for Cloudant, go ahead and click Create. The database will be provisioned in the background, and you’ll be able to link directly to the database instance or view database credentials when complete.

Setting up continuous delivery

Now that the app has been created and the database has been bound, let’s set up automated deployment using continuous delivery. In the App details screen again, click Configure continuous delivery in the Deploy your app section.

Here, you are presented with several deployment targets. For simplicity’s sake, select the second option—Deploy to Cloud Foundry. Leave all the options as defaulted, but specify a Region, Org, and Space to deploy into.

With your deployment target set, click Next and configure the toolchain that will deploy this application. A toolchain is a set of tool integrations that support development, deployment, and operations tasks. This will make more sense once you see the toolchain we are about to create. Rename the toolchain as you see fit and specify a valid Region and Resource group for the toolchain. Normally, the toolchain is created in the same Region and Resource group as the app itself (see previous step), but feel free to put it somewhere else. The final step is to click Create to kick off the deployment.

As part of this initial toolchain creation, a pipeline was created and a build kicked off (more on this later). Click View toolchain and see the set of tools added—a Gitlab repo for code and issue tracking (pre-populated with a simple app in the language you chose earlier), the Orion web IDE for editing files online, and a delivery pipeline.

A pipeline is a sequence of stages that retrieve input and run jobs, such as builds, tests, and deployments. Click the Delivery Pipeline card to see the pipeline stages. As mentioned earlier, this pipeline run was kicked off with the initial create and can be triggered again either manually or by commits to the git repository.

Depending on how long you waited to get to view this page, the pipeline is either still running or already completed, ideally with all stages showing STAGE PASSED.

Looking at the code

While the deploy is (possibly) still running, take a look at the code that was just deployed. On the Delivery Pipeline page, click the browser’s back button so that you’re back on the Toolchain page, and then click on the Eclipse Orion Web IDE link. The Orion Web IDE we configured as part of the DevOps toolchain will be launched, showing the contents of your application’s git repository. You’ll find a basic application backbone that is easily extensible, plus deployment assets for both Cloud Foundry and Kubernetes environments. All of this code can be modified in any way you choose.  In just a few minutes, you have created a cloud-native application, deployed it, and have it running on IBM Cloud for the world to see.

Verify the deployment

As a final step, assuming the pipeline has completed, let’s verify that the app is running and publicly accessible. Find the Deploy Stage in the Delivery Pipeline page. Click the View logs and history link and scroll to the bottom. Near the very end of the log, you will see routes: and your app URL. Cut and paste this endpoint into a new browser window and you will be presented with a congratulations page.

Piece of cake, right? We’ve examined the flow to create a simple app, but there’s so much more you can do.  Starter kits on IBM Cloud can help you rapidly generate frontend or backend applications, mobile apps, apps that use specific services (e.g., Watson), frameworks or patterns, low-code apps, and much more. Check out all of the starter kits to rapidly onboard your solutions to IBM Cloud, and don’t miss our next post, where we’ll examine the flow to bring your existing apps onto IBM Cloud.

Additional resources:

Categories

More from Cloud

IBM Cloud inactive identities: Ideas for automated processing

4 min read - Regular cleanup is part of all account administration and security best practices, not just for cloud environments. In our blog post on identifying inactive identities, we looked at the APIs offered by IBM Cloud Identity and Access Management (IAM) and how to utilize them to obtain details on IAM identities and API keys. Some readers provided feedback and asked on how to proceed and act on identified inactive identities. In response, we are going lay out possible steps to take.…

IBM Cloud VMware as a Service introduces multitenant as a new, cost-efficient consumption model

4 min read - Businesses often struggle with ongoing operational needs like monitoring, patching and maintenance of their VMware infrastructure or the added concerns over capacity management. At the same time, cost efficiency and control are very important. Not all workloads have identical needs and different business applications have variable requirements. For example, production applications and regulated workloads may require strong isolation, but development/testing, training environments, disaster recovery sites or other applications may have lower availability requirements or they can be ephemeral in nature,…

IBM accelerates enterprise AI for clients with new capabilities on IBM Z

5 min read - Today, we are excited to unveil a new suite of AI offerings for IBM Z that are designed to help clients improve business outcomes by speeding the implementation of enterprise AI on IBM Z across a wide variety of use cases and industries. We are bringing artificial intelligence (AI) to emerging use cases that our clients (like Swiss insurance provider La Mobilière) have begun exploring, such as enhancing the accuracy of insurance policy recommendations, increasing the accuracy and timeliness of…

IBM NS1 Connect: How IBM is delivering network connectivity with premium DNS offerings

4 min read - For most enterprises, how their users access applications and data is an essential part of doing business, and how they service those application and data responses has a direct correlation to revenue generation.    According to We Are Social’s Digital 2023 Global Overview Report, there are 5.19 billion people around the world using the internet in 2023. There’s an imperative need for businesses to trust their networks to deliver meaningful content to address customer needs.  So how responsive is the…