LoopBack 4 comes with the following example projects.
Shopping example application showcasing LoopBack features
- loopback4-example-shopping: An online e-commerce demo to validate/test the LoopBack 4 framework readiness.
Examples for beginners
-
hello-world: An example showing how to set up a simple application using LoopBack 4.
-
todo: Tutorial example on how to build an application with LoopBack 4. See tutorial instructions.
-
todo-list: Continuation of the todo example using relations in LoopBack 4. See tutorial instructions.
-
soap-calculator: An example on how to integrate SOAP web services. See tutorial instructions.
Examples implementing/using extensions
-
greeter-extension: An example showing how to implement the extension point/extension pattern.
-
log-extension: An example showing how to write a complex log extension for LoopBack 4.
-
metrics-prometheus: illustrate metrics provided by @loopback/metrics extension and Prometheus.
-
graphql: An example that demonstrates GraphQL integration using @loopback/graphql.
-
socketio: A basic implementation of Socket.IO using @loopback/socketio.
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.
Authentication and authorization related examples
-
passport-login: An example implementing authentication in a LoopBack application using Passport modules.
-
todo-jwt: A modified Todo example with JWT authentication.
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.