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:
You can list the component templates available in your workspace:
Use templates to create new components of different types, this command for example create a new "Login" React UI component:
This will create the login component in your workspace in a directory with all of the template files.
You can use components in your apps, components and projects using the chosen module name:
import { InputText } from '@my-org/my-platform.login';
You can install and import external dependencies as well using bit install. You can find more information on installing dependencies here.
You can preview components and their documentation during development by starting the Bit Workspace UI:
Below you can find guides for creating specific component types for your architecture needs.
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 component serves a specific function or displays certain content using hooks and entities:
Hooks are generally used for state management and data fetching.
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 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 are a composition of apps, built and deployed to various runtimes, including your backend and frontend.
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.
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.