Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packages/build/* @bajtos @raymondfeng
packages/cli/* @raymondfeng @shimks
packages/context/* @bajtos @raymondfeng
packages/core/* @bajtos @raymondfeng
packages/example-getting-started/* @bajtos
packages/example-todo/* @bajtos @virkt25
packages/example-hello-world/* @b-admike
packages/example-log-extension/* @virkt25
packages/example-rpc-server/* @virkt25
Expand Down
2 changes: 1 addition & 1 deletion docs/site/Crafting-LoopBack-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ LoopBack 4.

### Intermediate example

[@loopback/example-log-getting-started](https://github.com/strongloop/loopback-next/tree/master/packages/example-getting-started)
[@loopback/example-todo](https://github.com/strongloop/loopback-next/tree/master/packages/example-todo)

## Example for extension developers

Expand Down
6 changes: 3 additions & 3 deletions docs/site/Defining-the-API-using-code-first-approach.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ manipulation of models and their properties, they will be the first to be
defined.

{% include note.html content=" `Todo` model from
[tutorial](https://github.com/strongloop/loopback-next/blob/master/packages/example-getting-started/docs/model.md#srcmodelstodomodelts)
[tutorial](https://github.com/strongloop/loopback-next/blob/master/packages/example-todo/docs/model.md#srcmodelstodomodelts)
is used for demonstration here. " %}

First, write a simple TypeScript class describing your model and its properties:
Expand Down Expand Up @@ -97,7 +97,7 @@ export class Todo {
### Define your routes

{% include note.html content=" `TodoController` from
[tutorial](https://github.com/strongloop/loopback-next/blob/master/packages/example-getting-started/docs/controller.md#srccontrollerstodocontrollerts-2)
[tutorial](https://github.com/strongloop/loopback-next/blob/master/packages/example-todo/docs/controller.md#srccontrollerstodocontrollerts-2)
is used for demonstration here. " %}

Once your models are defined, create a controller to host your routes for each
Expand Down Expand Up @@ -169,7 +169,7 @@ the `getApiSpec()` function from your `RestServer` instance.

For a complete walkthrough of developing an application with the bottom-up
approach, see our
[Todo application](https://github.com/strongloop/loopback-next/blob/master/packages/example-getting-started/README.md#loopbackexample-getting-started)
[Todo application](https://github.com/strongloop/loopback-next/blob/master/packages/example-todo/README.md)
tutorial.

{% include note.html content=" If you would like to create your API manually or
Expand Down
4 changes: 2 additions & 2 deletions docs/site/Download-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ The tool will prompt you for:
### Output

The example project is downloaded to a new directory. For example, when
downloading `getting-started` example, the tool stores the files under the newly
created `loopback4-example-getting-started` directory.
downloading `todo` example, the tool stores the files under the newly
created `loopback4-example-todo` directory.
4 changes: 2 additions & 2 deletions docs/site/Examples-and-tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LoopBack 4 comes with the following example projects:
- **[hello-world](https://github.com/strongloop/loopback-next/tree/master/packages/example-hello-world)**:
Tutorial on setting up a simple hello-world application using LoopBack 4.

- **[getting-started](https://github.com/strongloop/loopback-next/tree/master/packages/example-getting-started)**:
- **[todo](https://loopback.io/doc/en/lb4/todo-tutorial.html)**:
Tutorial on building a simple application with LoopBack 4 key concepts using
bottom-up approach.

Expand All @@ -28,7 +28,7 @@ You can download any of the example projects usig our CLI tool `lb4`:
```sh
lb4 example
? What example would you like to clone? (Use arrow keys)
getting-started: An application and tutorial on how to build with LoopBack 4.
todo: Tutorial example on how to build an application with LoopBack 4.
hello-world: A simple hello-world Application using LoopBack 4
log-extension: An example extension project for LoopBack 4
rpc-server: A basic RPC server using a made-up protocol.
Expand Down
2 changes: 1 addition & 1 deletion docs/site/MONOREPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The [loopback-next](https://github.com/strongloop/loopback-next) repository uses
| [cli](packages/cli) | @loopback/cli | CLI for LoopBack 4 |
| [context](packages/context) | @loopback/context | Facilities to manage artifacts and their dependencies in your Node.js applications. The module exposes TypeScript/JavaScript APIs and decorators to register artifacts, declare dependencies, and resolve artifacts by keys. It also serves as an IoC container to support dependency injection. |
| [core](packages/core) | @loopback/core | Define and implement core constructs such as Application and Component |
| [example-getting-started](packages/example-getting-started) | _(private)_ | A basic tutorial for getting started with Loopback 4 |
| [example-todo](packages/example-todo) | _(private)_ | A basic tutorial for getting started with Loopback 4 |
| [example-hello-world](packages/example-hello-world) | _(private)_ | A simple hello-world application using LoopBack 4 |
| [example-log-extension](packages/example-log-extension) | _(private)_ | An example showing how to write a complex log extension for LoopBack 4 |
| [example-rpc-server](packages/example-rpc-server) | _(private)_ | An example RPC server and application to demonstrate the creation of your own custom server |
Expand Down
6 changes: 3 additions & 3 deletions docs/site/Preparing-the-API-for-consumption.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ from [Implementing features](./Implementing-features.md). " %}
### Interacting with your API

We'll use the repo
[loopback4-example-getting-started](https://github.com/strongloop/loopback4-example-getting-started)
[loopback4-example-todo](https://github.com/strongloop/loopback-next/blob/master/packages/example-todo)
to demonstrate how Swagger UI can be used to test your endpoints.

First, git clone the repository, install its dependencies, and run the
application:

```sh
git clone https://github.com/strongloop/loopback4-example-getting-started
cd loopback4-example-getting-started
lb4 example todo
cd loopback4-example-todo
npm i
npm start
```
Expand Down
36 changes: 34 additions & 2 deletions docs/site/sidebars/lb4_sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,42 @@ children:
output: 'web, pdf'
children:

- title: 'Examples and tutorials'
url: Examples-and-tutorials.html
- title: 'Examples and tutorials'
url: Examples-and-tutorials.html
output: 'web, pdf'

- title: 'Todo Tutorial'
url: todo-tutorial.html
output: 'web, pdf'

- title: 'Create your app scaffolding'
url: 'todo-tutorial/create-app-scaffolding.html'
output: 'web, pdf'

- title: 'Adding legacy juggler'
url: 'todo-tutorial/adding-legacy-juggler.html'
output: 'web, pdf'

- title: 'Add your Todo model'
url: 'todo-tutorial/add-todo-model.html'
output: 'web, pdf'

- title: 'Add a Datasource'
url: 'todo-tutorial/add-datasource.html'
output: 'web, pdf'

- title: 'Add a Repository'
url: 'todo-tutorial/add-repository.html'
output: 'web, pdf'

- title: 'Add a Controller'
url: 'todo-tutorial/add-controller.html'
output: 'web, pdf'

- title: 'Putting it all together'
url: 'todo-tutorial/putting-it-all-together.html'
output: 'web, pdf'

- title: 'Key concepts'
url: Concepts.html
output: 'web, pdf'
Expand Down
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/add-controller.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Add a Controller'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/add-controller.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/add-controller.html
summary: LoopBack 4 Todo Application Tutorial - Add a Controller
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/add-datasource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Add a Datasource'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/add-datasource.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/add-datasource.html
summary: LoopBack 4 Todo Application Tutorial - Add a Datasource
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/add-repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Add a Repository'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/add-repository.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/add-repository.html
summary: LoopBack 4 Todo Application Tutorial - Add a Repository
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/add-todo-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Add Todo Model'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/add-todo-model.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/add-todo-model.html
summary: LoopBack 4 Todo Application Tutorial - Add Todo Model
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/adding-legacy-juggler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Add legacy juggler'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/adding-legacy-juggler.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/adding-legacy-juggler.html
summary: LoopBack 4 Todo Application Tutorial - Adding legacy juggler
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/create-app-scaffolding.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Create app scaffolding'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/create-app-scaffolding.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/create-app-scaffolding.html
summary: LoopBack 4 Todo Application Tutorial - Create app scaffolding
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/putting-it-all-together.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Putting it all together'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/docs/putting-it-all-together.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial/putting-it-all-together.html
summary: LoopBack 4 Todo Application Tutorial - Putting it all together
---
12 changes: 12 additions & 0 deletions docs/site/todo-tutorial/todo-tutorial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
lang: en
title: 'Todo tutorial'
keywords: LoopBack 4.0, LoopBack 4
layout: readme
source: loopback-next
file: packages/example-todo/README.md
tags:
sidebar: lb4_sidebar
permalink: /doc/en/lb4/todo-tutorial.html
summary: LoopBack 4 Todo Application Tutorial
---
3 changes: 1 addition & 2 deletions packages/cli/generators/example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const path = require('path');
const utils = require('../../lib/utils');

const EXAMPLES = {
'getting-started':
'An application and tutorial on how to build with LoopBack 4.',
todo: 'Tutorial example on how to build an application with LoopBack 4.',
'hello-world': 'A simple hello-world Application using LoopBack 4',
'log-extension': 'An example extension project for LoopBack 4',
'rpc-server': 'A basic RPC server using a made-up protocol.',
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/clone-example.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const path = require('path');

const readFile = promisify(fs.readFile);

const VALID_EXAMPLE = 'getting-started';
const VALID_EXAMPLE = 'todo';
const SANDBOX_PATH = path.resolve(__dirname, '..', '.sandbox');
const sandbox = new TestSandbox(SANDBOX_PATH);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/example.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const baseTests = require('./base-generator')(generator);
const testUtils = require('./test-utils');

const ALL_EXAMPLES = require('../generators/example').getAllExamples();
const VALID_EXAMPLE = 'getting-started';
const VALID_EXAMPLE = 'todo';

describe('lb4 example', function() {
this.timeout(10000);
Expand Down
2 changes: 1 addition & 1 deletion packages/example-log-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ You can obtain a local clone of this project (without the rest of our monorepo)
using the following command:

```sh
lb4 example getting-started
lb4 example todo
```

## Tutorial
Expand Down
2 changes: 1 addition & 1 deletion packages/example-rpc-server/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: @loopback/example-getting-started
// Node module: @loopback/example-rpc-server
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand Down
2 changes: 1 addition & 1 deletion packages/example-rpc-server/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: @loopback/example-getting-started
// Node module: @loopback/example-rpc-server
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) IBM Corp. 2017,2018. All Rights Reserved.
Node module: @loopback/example-getting-started
Node module: @loopback/example-todo
This project is licensed under the MIT License, full text below.

--------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @loopback/example-getting-started
# @loopback/example-todo

This is the basic tutorial for getting started with Loopback 4!

Expand Down Expand Up @@ -33,7 +33,7 @@ To follow this tutorial, begin with the
### Steps

1. [Create your app scaffolding](docs/scaffolding.md)
2. [Adding the legacy juggler](docs/juggler.md)
2. [Adding legacy juggler](docs/juggler.md)
3. [Add your Todo model](docs/model.md)
4. [Add a datasource](docs/datasource.md)
5. [Add a repository](docs/repository.md)
Expand All @@ -45,13 +45,12 @@ To follow this tutorial, begin with the
If you'd like to see the final results of this tutorial as an example
application, follow these steps:

1. Run the `lb4 example` command to select and clone the getting-started
repository:
1. Run the `lb4 example` command to select and clone the todo repository:

```sh
$ lb4 example
? What example would you like to clone? (Use arrow keys)
getting-started: An application and tutorial on how to build with LoopBack 4.
todo: Tutorial example on how to build an application with LoopBack 4..
hello-world: A simple hello-world Application using LoopBack 4
log-extension: An example extension project for LoopBack 4
rpc-server: A basic RPC server using a made-up protocol.
Expand All @@ -60,7 +59,7 @@ $ lb4 example
2. Jump into the directory and then install the required dependencies:

```sh
cd loopback4-example-getting-started && npm i
cd loopback4-example-todo && npm i
```

3. Finally, start the application!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Adding the Legacy Juggler
### Adding Legacy Juggler

The Legacy Juggler is a "bridge" between the existing
[loopback-datasource-juggler](https://github.com/strongloop/loopback-datasource-juggler)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: @loopback/example-getting-started
// Node module: @loopback/example-todo
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: @loopback/example-getting-started
// Node module: @loopback/example-todo
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
// Node module: @loopback/example-getting-started
// Node module: @loopback/example-todo
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@loopback/example-getting-started",
"name": "@loopback/example-todo",
"version": "0.4.1",
"description": "An application and tutorial on how to build with LoopBack 4.",
"description": "Tutorial example on how to build an application with LoopBack 4.",
"private": true,
"main": "index.js",
"engines": {
Expand All @@ -11,12 +11,12 @@
"acceptance": "lb-mocha \"DIST/test/acceptance/**/*.js\"",
"build": "lb-tsc es2017",
"build:apidocs": "lb-apidocs",
"clean": "lb-clean *example-getting-started*.tgz dist package api-docs",
"clean": "lb-clean *example-todo*.tgz dist package api-docs",
"prepublishOnly": "npm run build && npm run build:apidocs",
"pretest": "npm run build",
"test": "lb-mocha \"DIST/test/unit/**/*.js\" \"DIST/test/acceptance/**/*.js\"",
"unit": "lb-mocha \"DIST/test/unit/**/*.js\"",
"verify": "npm pack && tar xf loopback-getting-started*.tgz && tree package && npm run clean",
"verify": "npm pack && tar xf loopback-todo*.tgz && tree package && npm run clean",
"start": "npm run build && node ."
},
"repository": {
Expand Down
Loading