Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 1.95 KB

README.md

File metadata and controls

38 lines (25 loc) · 1.95 KB

Moleculer Services Development Environment

Moleculer is a very powerful microservice development tool, but getting up to speed if you've never built microservices before can be a bit complex.

This repo is designed to short cut your ability to get up to speed by giving you a simple local development enviroment to get started using Moleculer with Docker.

What's in this repo:

  • Two simple Moleculer services.
  • The official Moeleculer API gateway to route calls to the appropriate service.
  • A full docker-compose example that spins up containers for each service along with containers for Redis, Postgres DB, and Traefic for rapid development.
  • Hot reloading of your Moleculer services for faster development.

To get started:

What is happening at a high level:

  • We've got an api gateway setup that calls our services.
  • By visiting http://localhost:3000/api/serviceOne/askServiceTwo, the api gateway is calling serviceOne's function "askServiceTwo."
  • serviceOne in turn calls a function from serviceTwo named "respondToServiceOne."
  • When serviceOne recieves the response from serviceTwo, the api gateway returns the response to the browser.

Moleculer's Magic:

If you've ever worked on a microservices project you'll know that "service discovery" and messaging between services are two of the most common challenges to getting started.

Moleculer solves both of these problems out of the box by using a transport mechanism for both service discovery and messaging between services.

In this repo we use Redis, but Moleculer supports several other transport layers out of the box.