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


You can list the component templates available in your workspace:

$bit
Copiedcopy
See command synopsis

Use templates to create new components of different types, this command for example create a new "Login" React UI component:

$bit
Copiedcopy
See command synopsis

This will create the login component in your workspace in a directory with all of the template files.

Use components

You can use components in your apps, components and projects using the chosen module name:

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

You can install and import external dependencies as well using bit install. You can find more information on installing dependencies here.

Preview components

You can preview components and their documentation during development by starting the Bit Workspace UI:

$bit
Copiedcopy
See command synopsis

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?