Create Components

The conceptual building blocks for a composable architecture are usually: Apps, UI Components, Entities, Modules and Hooks. Architecture varies from one framework to others.

Here are common composable architecture patterns for specific tech stacks:

ReactReact
React
NodeJS
NodeJS
Vue
Vue
Angular
Angular
Harmony
Harmony


Explore the component templates available in your workspace:

$bit
Copiedcopy
See command synopsis
Unlock seamless dev experience with Cloud Workspaces

Use Cloud Workspaces for a ready-to-go, web-based and integrated development environment for creating your components.

Create a UI component

Create a reusable UI component to use in your apps:

$bit
Copiedcopy
See command synopsis

This will create the component in the corresponding directory, and will link this component in your workspace node_modules directory.

Use the component

You can use components in your workspace or in other linked projects using an import statement with the component module name:

import { Login } from '@my-org/my-platform.login';
CopiedCopy

Create an app

Create a React shell application and use your UI component:

$bit
Copiedcopy

Launch the app locally:

$bit
Copiedcopy

The application is now running on the host displayed in the output. You can learn more on creating apps on the create apps docs.

You can install external dependencies using bit install. You can find more information on installing dependencies here.

Official templates

Below you can find guides for creating specific component types for your architecture needs.

Apps

Apps are components, associated with a deploy task. Apps are used for building frontend applications, backend services or deployable frontends (e.g. micro frontends).

It is usually recommended to minimize the amount of frameworks used in a single application, to improve the performance and maintainability of your software. Altough it is possible to combine frameworks as specific needs arises.

To create apps, head here.

UI Components

UI component serves a specific function or displays certain content using hooks and entities:

Hooks

Hooks are generally used for state management and data fetching.

Entities

Entities are used to describe entities such as User, Product or Post. It eases serialization and deserialization and increases reuse and consistency between the backend and the frontend.

Modules

Modules are Node or ESModules modules containing certain logic and API. You can use modules to build utilities, SDKs, or other general purpose logic you would usually build in NodeJS.

Platforms

Platforms are a composition of apps, built and deployed to various runtimes, including your backend and frontend.

Plugins

If you are looking to introduce pluggability to your platform, you are welcome to use Harmony, a minimalistic framework for stitching composable architectures. Using Aspects you can compose components into domain-centric and pluggable user experiences.

You can use Aspects to extend Bit, but also to build your own Composable Harmony applications.

You can also create and use Aspects to extend Bit.

Contribute your composable pattern

We are happy to introduce more composable architectures to the Bit community. If you have or want more composable frameworks to show here, please let us know and contribute your ideas on the Bit Community.

What's next?