diff --git a/docs/site/Behind-the-scene.md b/docs/site/Behind-the-scene.md new file mode 100644 index 000000000000..a002c75a67ac --- /dev/null +++ b/docs/site/Behind-the-scene.md @@ -0,0 +1,22 @@ +--- +lang: en +title: 'Components' +keywords: LoopBack 4.0, LoopBack 4 +sidebar: lb4_sidebar +permalink: /doc/en/lb4/Behind-the-scene.html +--- + +Here are the infrastructures that get all the artifacts working together: + +- [Context](Context.md): An abstraction of states and dependencies in your + application that LoopBack uses to manage everything. It’s a global registry + for everything in your app (configurations, state, dependencies, classes and + so on). +- [Binding](Binding.md): An abstraction of items managed by a context. Each + binding has a unique key within the context and a value provider to resolve + the key to a value. +- [Dependency Injection](Dependency-injection.md): The technique used to + separate the construction of dependencies of a class or function from its + behavior to keep the code loosely coupled. +- [Component](Components.md): A package that bundles one or more LoopBack + extensions. diff --git a/docs/site/Concepts.md b/docs/site/Concepts.md index f3893955682a..95f5f3825fdf 100644 --- a/docs/site/Concepts.md +++ b/docs/site/Concepts.md @@ -6,7 +6,10 @@ sidebar: lb4_sidebar permalink: /doc/en/lb4/Concepts.html --- -LoopBack 4 introduces some new concepts that are important to understand: +LoopBack 4 defines some key building blocks to represent different +responsibilities for typical API and/or Microservice applications. + +![Key concepts overview diagram](imgs/key-concepts-overview-diagram.png) - [**Application**](Application.md): The central class for setting up all of your module’s components, controllers, servers and bindings. The Application @@ -18,19 +21,6 @@ LoopBack 4 introduces some new concepts that are important to understand: typically listens on a specific endpoint (protocol/host/port), handles incoming requests, and then returns appropriate responses. -- [**Context**](Context.md): An abstraction of states and dependencies in your - application that LoopBack uses to manage everything. It's a global registry - for everything in your app (configurations, state, dependencies, classes and - so on). - -- [**Binding**](Binding.md): An abstraction of items managed by a context. Each - binding has a unique key within the context and a value provider to resolve - the key to a value. - -- [**Dependency Injection**](Dependency-injection.md): The technique used to - separate the construction of dependencies of a class or function from its - behavior to keep the code loosely coupled. - - [**Controller**](Controllers.md): A class that implements operations defined by the application’s REST API. It implements an application’s business logic and acts as a bridge between the HTTP/REST API and domain/database models. A @@ -65,6 +55,3 @@ LoopBack 4 introduces some new concepts that are important to understand: - [**Decorator**](Decorators.md): The pattern used to annotate or modify your class declarations and their members with metadata. - -- [**Component**](Components.md): A package that bundles one or more LoopBack - extensions. diff --git a/docs/site/DataSources.md b/docs/site/DataSources.md index a9c2f008f647..a57875509c78 100644 --- a/docs/site/DataSources.md +++ b/docs/site/DataSources.md @@ -12,6 +12,8 @@ A `DataSource` in LoopBack 4 is a named configuration for a Connector instance that represents data in an external system. The Connector is used by `legacy-juggler-bridge` to power LoopBack 4 Repositories for Data operations. +![Datasource diagram](imgs/datasource.png) + ### Creating a DataSource It is recommended to use the [`lb4 datasource` command](DataSource-generator.md) diff --git a/docs/site/Repositories.md b/docs/site/Repositories.md index ef0584d29779..f296cab91411 100644 --- a/docs/site/Repositories.md +++ b/docs/site/Repositories.md @@ -10,6 +10,8 @@ A `Repository` represents a specialized `Service` interface that provides strong-typed data access (for example, CRUD) operations of a domain model against the underlying database or service. +![Repository diagram](imgs/repository.png) + {% include note.html content="Repositories are adding behavior to Models. Models describe the shape of data, Repositories provide behavior like CRUD operations. This is different from LoopBack 3.x where models implement behavior too." %} {% include tip.html content="A single model can be used with multiple different Repositories." %} diff --git a/docs/site/imgs/datasource.png b/docs/site/imgs/datasource.png new file mode 100644 index 000000000000..5bccd853e569 Binary files /dev/null and b/docs/site/imgs/datasource.png differ diff --git a/docs/site/imgs/key-concepts-overview-diagram.png b/docs/site/imgs/key-concepts-overview-diagram.png new file mode 100644 index 000000000000..93a9e2837b7b Binary files /dev/null and b/docs/site/imgs/key-concepts-overview-diagram.png differ diff --git a/docs/site/imgs/repository.png b/docs/site/imgs/repository.png new file mode 100644 index 000000000000..45237a523480 Binary files /dev/null and b/docs/site/imgs/repository.png differ diff --git a/docs/site/sidebars/lb4_sidebar.yml b/docs/site/sidebars/lb4_sidebar.yml index 43c9559dbfdf..17cad7b1c203 100644 --- a/docs/site/sidebars/lb4_sidebar.yml +++ b/docs/site/sidebars/lb4_sidebar.yml @@ -32,39 +32,48 @@ children: url: Server.html output: 'web, pdf' - - title: 'Context' - url: Context.html + - title: 'Controllers' + url: Controllers.html output: 'web, pdf' - - title: 'Binding' - url: Binding.html + - title: 'Models' + url: Model.html output: 'web, pdf' - - title: 'Dependency injection' - url: Dependency-injection.html + - title: 'Relations' + url: Relations.html output: 'web, pdf' children: - - title: 'Reserved binding keys' - url: Reserved-binding-keys.html + - title: 'HasMany Relation' + url: HasMany-relation.html output: 'web, pdf' - - title: 'Controllers' - url: Controllers.html + - title: 'BelongsTo Relation' + url: BelongsTo-relation.html + output: 'web, pdf' + + - title: 'HasOne Relation' + url: hasOne-relation.html + output: 'web, pdf' + + - title: 'DataSources' + url: DataSources.html output: 'web, pdf' - - title: 'Components' - url: Components.html + - title: 'Repositories' + url: Repositories.html output: 'web, pdf' + children: + + - title: 'Database Transactions' + url: Using-database-transactions.html + output: 'web, pdf' - title: 'Interceptors' url: Interceptors.html output: 'web, pdf' - - title: 'DataSources' - url: DataSources.html - output: 'web, pdf' - - title: 'Life cycle events and observers' url: Life-cycle.html output: 'web, pdf' @@ -86,36 +95,6 @@ children: url: Parsing-requests.html output: 'web, pdf' - - title: 'Model' - url: Model.html - output: 'web, pdf' - - - title: 'Repositories' - url: Repositories.html - output: 'web, pdf' - children: - - - title: 'Database Transactions' - url: Using-database-transactions.html - output: 'web, pdf' - - - title: 'Relations' - url: Relations.html - output: 'web, pdf' - children: - - - title: 'HasMany Relation' - url: HasMany-relation.html - output: 'web, pdf' - - - title: 'BelongsTo Relation' - url: BelongsTo-relation.html - output: 'web, pdf' - - - title: 'HasOne Relation' - url: hasOne-relation.html - output: 'web, pdf' - - title: 'Decorators' url: Decorators.html output: 'web, pdf' @@ -200,6 +179,32 @@ children: url: Serving-static-files.html output: 'web, pdf' +- title: 'Behind the Scene' + url: Behind-the-scene.html + output: 'web, pdf' + children: + + - title: 'Context' + url: Context.html + output: 'web, pdf' + + - title: 'Binding' + url: Binding.html + output: 'web, pdf' + + - title: 'Dependency Injection' + url: Dependency-injection.html + output: 'web, pdf' + children: + + - title: 'Reserved binding keys' + url: Reserved-binding-keys.html + output: 'web, pdf' + + - title: 'Components' + url: Components.html + output: 'web, pdf' + - title: 'Booting an Application' url: Booting-an-Application.html output: 'web, pdf'