Bit and Harmony platforms

Harmony is a minimalistic framework for stitching composable architectures. It allows for full-stack composable architectures to be composed into pluggable business features (Aspects), that you can compose into unified platforms.

It inverts control over integration to your platform, enabling devs to compose and test themselves in the context of a platform while working independently without compromising performance or dev experience.

Harmony have official runtimes for NodeJS and the Browser and based on Bit Apps for supporting further runtimes.

It is designed for incremental adoption, and can be quickly used to stich existing composable architectures into plugable features.

An Harmony platforms composing existing services and new Bit components
An Harmony platforms composing existing services and new Bit components

Get started

Create a new Bit workspace:

$bit
Copiedcopy

Set the Harmony, NodeJS and React component generator templates in your workspace:

// workspace.jsonc
{
    "teambit.generator/generator": {
    "envs": [
      "bitdev.node/node-env",
      "bitdev.react/react-env",
      "bitdev.symphony/envs/symphony-env"
    ]
  },
}
CopiedCopy
Explore Harmony in the cloud

Get hands-on with Harmony using a web-based starter project. Sign up for a free Bit Cloud account to access Cloud Workspaces and dive right in!

Make sure to use bit install after configuring the templates in workspace.jsonc.

Create the platform composition:

bit create harmony-platform my-platform
CopiedCopy

Run the platform:

bit run my-platform
CopiedCopy

Starting creating Aspects and compose them into your platform:

bit create aspect people --scope myorg.people
CopiedCopy

Use the Aspect in your platform:

import { HarmonyPlatform } from '@bitdev/harmony.harmony-platform';
import { NodeJSRuntime } from '@bitdev/harmony.runtimes.nodejs-runtime';
import { BrowserRuntime } from '@bitdev/harmony.runtimes.browser-runtime';
import { SymphonyPlatformAspect } from '@bitdev/symphony.symphony-platform';
import { HeaderAspect } from '@bitdev/symphony.aspects.header';
import { PeopleAspect } from '@pied/people.people';
import { PiedPlatformAspect } from '@pied/pied-piper.pied-platform';

/**
  * compose the pied-piper platform.
  */    
export const PiedPiperPlatform = HarmonyPlatform.from({
  name: 'pied-piper',
  platform: [SymphonyPlatformAspect, {
    name: 'Pied Piper',
    logo: 'https://static.bit.dev/extensions-icons/pied-piper.svg',
  }],

  runtimes: [
    new BrowserRuntime(), 
    new NodeJSRuntime()
  ],

  aspects: [
    // you can use the symphony header aspect or fork to build your own.
    HeaderAspect,
    // example business capability, replace with your own.
    PeopleAspect,
    // the pied piper platform aspect.
    PiedPlatformAspect,
  ],
});

export default PiedPiperPlatform;
CopiedCopy

View the full example on the Piped Piper component example or visit the Pied Piper organization example on Bit Cloud.

Create Aspect

Aspects are the glue of composable architectures, combining components into cohesive platform features. They define how these pieces interact, leveraging UI, backend, and other runtimes to stitch together the necessary functionality.

Run the following command to create an Aspect:

bit create aspect people --scope myorg.people
CopiedCopy

You can now head to the created aspect and edit it to use the components you need and plug them into your platform. You can learn more on how to create aspects in the aspect docs section.

Platform aspects

Symphony is the default platform aspect for Harmony. It an opinianated platform using React and GraphQL you can use to build your platform.

Refereneces

What's next

► Create an Harmony platform

► Create the Platform Aspect

► Create an Aspect

► Set up your own Harmony Development Environment ('env')

► Create an Harmony runtime