diff --git a/docs/site/Best-practices.md b/docs/site/Best-practices.md index 9e8692a2e32f..a62e3f67b77f 100644 --- a/docs/site/Best-practices.md +++ b/docs/site/Best-practices.md @@ -10,38 +10,25 @@ redirect_from: summary: --- -{% include important.html content=" The API-first approach for building LoopBack -applications is not yet fully supported. Therefore, some of the sections in this -page are outdated and may not work out of the box. They will be revisited after -our MVP release. -" %} - LoopBack 4 is more than just a framework: It’s an ecosystem that encourages -developers to follow best practices through predefined standards. This section -will walk through some important guidelines by building an example API for a -catalog of products. +developers to follow best practices through predefined standards. + +In this section, we provide guidelines on building LoopBack application and +extensions the test-driven way, to make such projects robust and easy to +maintain. + +- [**Defining the API using code-first approach**](./Defining-the-API-using-code-first-approach.md): + This section guides you through setting up a skeleton of your application so + that its full OpenAPI specification can be automatically generated. + +- [**Defining your testing strategy**](./Defining-your-testing-strategy.md): + This section discusses the advantages and the process of building a strong + testing suite. -Our best practice follows an "API first" and test-driven development approach: +- [**Testing your application**](./Testing-your-application.md): A collection of + practical tips and code snippets useful to developers writing LoopBack + applications. -1. **Defining the API**: There are two possible approaches to take in this - section - - [**Defining the API using code-first approach**](./Defining-the-API-using-code-first-approach.md): - This section guides you through setting up a skeleton of your application - so that its full OpenAPI specification can be automatically generated. - - [**Defining the API using design-first approach**](./Defining-the-API-using-design-first-approach.md): - This section guides you through constructing your API first before any - internal logic is added. **_Not fully supported_** - - [**Testing the API**](./Testing-the-API.md): This section describes the - process of writing smoke test for your API and its spec. **_Not fully - supported_** -2. [**Defining your testing strategy**](./Defining-your-testing-strategy.md): - This section discusses the advantages and the process of building a strong - testing suite. -3. [**Implementing features**](./Implementing-features.md): This section - demonstrates how the tests for each feature of your application should be - written, and how to write the logic to make these tests pass. In the - example, the tests for the controller, model, repository, data source, and - sequence are written and then implemented. -4. [**Preparing the API for consumption**](./Preparing-the-API-for-consumption.md): - This section shows how the endpoints can be physically tested using the - Swagger UI. +- [**Testing your extension**](./Testing-Your-Extensions.md): A collection of + practical tips and code snippets useful to developers building LoopBack + extensions. diff --git a/docs/site/Decorators.md b/docs/site/Decorators.md index 62bcc6bb795a..2d96efecb76b 100644 --- a/docs/site/Decorators.md +++ b/docs/site/Decorators.md @@ -602,9 +602,6 @@ The injection example can be found in To create a repository in a controller, you can define your model and datasource first, then import them in your controller file: -_To learn more about creating models and datasources, please see the example in -[Best Practices with LoopBack](Implementing-features.md#define-product-model-repository-and-data-source)_ - ```ts // src/controllers/todo.controller.ts import {Todo} from '../models'; diff --git a/docs/site/Defining-the-API-using-code-first-approach.md b/docs/site/Defining-the-API-using-code-first-approach.md index 5a320bbd4ffb..22fa1770a755 100644 --- a/docs/site/Defining-the-API-using-code-first-approach.md +++ b/docs/site/Defining-the-API-using-code-first-approach.md @@ -174,12 +174,6 @@ approach, see our [Todo application](https://github.com/strongloop/loopback-next/blob/master/examples/todo/README.md) tutorial. -{% include note.html content=" If you would like to create your API manually or -already have one designed, refer to -[Defining the API using design-first approach](Defining-the-API-using-design-first-approach.md) -page for best practices. -" %} - {% include next.html content= " [Defining your testing strategy](./Defining-your-testing-strategy.md) " %} diff --git a/docs/site/Defining-the-API-using-design-first-approach.md b/docs/site/Defining-the-API-using-design-first-approach.shelved.md similarity index 100% rename from docs/site/Defining-the-API-using-design-first-approach.md rename to docs/site/Defining-the-API-using-design-first-approach.shelved.md diff --git a/docs/site/Defining-your-testing-strategy.md b/docs/site/Defining-your-testing-strategy.md index bbea1be6fe7f..29f754bbf3e5 100644 --- a/docs/site/Defining-your-testing-strategy.md +++ b/docs/site/Defining-your-testing-strategy.md @@ -8,8 +8,7 @@ permalink: /doc/en/lb4/Defining-your-testing-strategy.html summary: --- -{% include previous.html content=" This article continues -from [Testing the API](./Testing-the-API.md) and +{% include previous.html content=" This article continues from [Defining the API using code-first approach](./Defining-the-API-using-code-first-approach.md). " %} @@ -130,7 +129,3 @@ To summarize: See [Testing Your Application](Testing-Your-application.md) for a reference manual on automated tests. - -{% include next.html content= " -[Implementing features](./Implementing-features.md) -" %} diff --git a/docs/site/Implementing-features.md b/docs/site/Implementing-features.shelved.md similarity index 100% rename from docs/site/Implementing-features.md rename to docs/site/Implementing-features.shelved.md diff --git a/docs/site/Preparing-the-API-for-consumption.md b/docs/site/Preparing-the-API-for-consumption.shelved.md similarity index 100% rename from docs/site/Preparing-the-API-for-consumption.md rename to docs/site/Preparing-the-API-for-consumption.shelved.md diff --git a/docs/site/Testing-the-API.md b/docs/site/Testing-the-API.shelved.md similarity index 100% rename from docs/site/Testing-the-API.md rename to docs/site/Testing-the-API.shelved.md diff --git a/docs/site/Testing-your-application.md b/docs/site/Testing-your-application.md index 9444cd9dc2a0..2721dde5ae24 100644 --- a/docs/site/Testing-your-application.md +++ b/docs/site/Testing-your-application.md @@ -31,9 +31,7 @@ styles work well, so pick one that you're comfortable with and start writing tests! For an introduction to automated testing, see -[Define your testing strategy](Defining-your-testing-strategy.md). For a -step-by-step tutorial, see -[Incrementally implement features](Implementing-features.md). +[Define your testing strategy](Defining-your-testing-strategy.md). {% include important.html content=" A great test suite requires you to think smaller and favor fast and focused unit tests over slow end-to-end tests. diff --git a/docs/site/sidebars/lb4_sidebar.yml b/docs/site/sidebars/lb4_sidebar.yml index 2d77634d8b20..590a74a9fff6 100644 --- a/docs/site/sidebars/lb4_sidebar.yml +++ b/docs/site/sidebars/lb4_sidebar.yml @@ -152,27 +152,10 @@ children: url: Defining-the-API-using-code-first-approach.html output: 'web, pdf' - - title: 'Defining the API using design-first approach' - url: Defining-the-API-using-design-first-approach.html - output: 'web, pdf' - children: - - - title: 'Testing the API' - url: Testing-the-API.html - output: 'web, pdf' - - title: 'Defining your testing strategy' url: Defining-your-testing-strategy.html output: 'web, pdf' - - title: 'Implementing features' - url: Implementing-features.html - output: 'web, pdf' - - - title: 'Preparing the API for consumption' - url: Preparing-the-API-for-consumption.html - output: 'web, pdf' - - title: 'Testing your application' url: Testing-your-application.html output: 'web, pdf'