docs/site/tutorials/core/1-introduction.md
At the core of LoopBack 4, we provide a powerful Inversion of Control and Dependency Injection container in TypeScript that serves as the foundation to manage many types of collaborating artifacts as building blocks for complex applications. In addition to great API and Microservice capabilities offered by the LoopBack framework, these core modules can be used independently as a platform to develop large scale Node.js projects that require flexibility, extensibility, and composability.
To help our users leverage the core packages, we created a series of tutorials to explain why such features matter and how to use them for your development.
Let's first introduce the business scenario for our series of tutorials.
We're going to build an fancy version of hello world with the following
requirements:
The service is capable of speaking different languages to greet people. For example:
It should be easy to add support for a new language, such as French.
A REST API is provided to access the service via
http://<server>:<port>/greet/<name>. It will receive a response based on
the Accept-Language http request header.
Caching is supported using the request url (/greet/<name>) and language as
the key. Expiration is controlled by a configurable ttl.
The application can be run standalone to try the greeting service or as a server to expose REST APIs.
Instead of creating a monolithic application, we would like to have good separation of concerns by dividing responsibilities into a few artifacts. The key building blocks are illustrated below based on features offered by LoopBack 4. The code is being developed in the Greeter Extension Example.
We are going to decompose the application into two packages:
There are dependencies between such artifacts, such as:
Some of the artifacts can be configurable, either statically at startup time or dynamically when the application is running.
Previous: Index