Microservices in Nest.js – JavaScript Tutorial
By freeCodeCamp.org
Published: Mar 25, 2025“
Welcome to this course on building microservices with Next.js! You’ll create a delivery service application that tracks rider activity by saving their coordinates every three hours. You’ll learn to build two microservices—a Login Service and a Rider Service—and enable communication between them. By the end, you’ll have the skills to design and deploy scalable microservices.
?? Course from @haidermalik3402
Code: https://github.com/HaiderMalik12/nestjs-microservice-beta
Learn more about microservices in Next.js: https://www.haidermalik.dev/nestjs-microservices-early-access
?? Try interactive JavaScript courses we love, right in your browser: https://scrimba.com/freeCodeCamp-JavaScript (Made possible by a grant from our friends at Scrimba)
?? Contents ??
0:00:00 Intro
0:00:32 Sample-Application
0:02:20 Setup Nest.js Microservices Project
0:11:22 Install MongoDB Update
0:14:18 Why Docker
0:18:34 Run MongoDB in Docker Container
0:24:34 Run MongoDB using Docker Compose
0:29:05 Install Nestjs Mongoose Package
0:34:35 MongoDB Port Forwarding
0:39:20 Setup Module
0:49:41 Define Schema
0:56:16 Validating Request Body
1:07:31 Save Coordinates
1:18:31 Get Data from DB
1:24:22 TCP Based Microservices Communication
1:26:10 Mock Rider By ID method
1:29:04 Define Event to communicate between microservices
1:36:59 Define ID Param
1:42:23 Testing-and-Fixing Bug???? Thanks to our Champion and Sponsor supporters:
???? Drake Milly
???? Ulises Moralez
???? Goddard Tan
???? David MG
???? Matthew Springman
???? Claudio
???? Oscar R.
???? jedi-or-sith
???? Nattira Maneerat
???? Justin Hual—
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://freecodecamp.org/news
”