Page Contents

LoopBack 4 comes with the following example projects.

Shopping example application showcasing LoopBack features

Examples for beginners

Examples implementing/using extensions

Examples with migration

  • lb3-application: An example demonstrating how to mount your existing LoopBack 3 application on a new LoopBack 4 project.

  • access-control-migration: An example demonstrating how to implement a Role Based Access Control (RBAC) system.

Other examples

  • context: Standalone examples showing how to use @loopback/context as an Inversion of Control (IoC) and Dependency Injection (DI) container.

  • file-transfer: An example showing how to expose APIs to upload and download files.

  • greeting-app: An example showing how to compose an application from component and controllers, interceptors, and observers.

  • multi-tenancy: An example application to demonstrate how to implement multi-tenancy with LoopBack 4.

  • rpc-server: An example showing how to implement a made-up RPC protocol.

  • rest-crud: An example showing how to use CrudRestComponent to define default repository and controller classes for a model without creating those classes.

  • validation-app: An example demonstrating how to add validations in a LoopBack application.

  • webpack: An example to bundle @loopback/core using webpack

How to download examples

You can download the example projects using our CLI tool lb4:

lb4 example <example-name>

For example, the following command downloads the hello-world example into loopback4-example-hello-world.

lb4 example hello-world

Please follow the instructions in Install LoopBack4 CLI if you don’t have lb4 installed yet.

The official examples are hosted at the following urls:

  • https://github.com/loopbackio/loopback4-example-shopping
  • https://github.com/loopbackio/loopback-next/tree/master/examples

Community examples

For examples created by the community, see the community examples page.