{"id":15292877,"url":"https://github.com/microservices-suite/node-microservices-suite","last_synced_at":"2025-10-19T18:04:51.780Z","repository":{"id":230883215,"uuid":"780357573","full_name":"microservices-suite/node-microservices-suite","owner":"microservices-suite","description":"This repository is a nodejs based microservices built with the monorepo strategy","archived":false,"fork":false,"pushed_at":"2024-12-28T14:24:16.000Z","size":1747,"stargazers_count":16,"open_issues_count":15,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-16T06:45:11.633Z","etag":null,"topics":["automation","chaos-engineering","containerization","docker-compose","dry","horizontal-scaling","kubernetes","microservices","monorepo","orchestration","saas"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microservices-suite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-01T09:57:04.000Z","updated_at":"2025-03-29T14:04:42.000Z","dependencies_parsed_at":"2024-04-28T04:02:26.104Z","dependency_job_id":"39a90ea4-597d-43cd-96de-b71af239fac2","html_url":"https://github.com/microservices-suite/node-microservices-suite","commit_stats":{"total_commits":697,"total_committers":5,"mean_commits":139.4,"dds":"0.35150645624103305","last_synced_commit":"285e037cefb75eb3d8ef4befd06548b1abbc62d4"},"previous_names":["microservices-suite/https-gnode-microservices-suite"],"tags_count":87,"template":false,"template_full_name":null,"purl":"pkg:github/microservices-suite/node-microservices-suite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microservices-suite%2Fnode-microservices-suite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microservices-suite%2Fnode-microservices-suite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microservices-suite%2Fnode-microservices-suite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microservices-suite%2Fnode-microservices-suite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microservices-suite","download_url":"https://codeload.github.com/microservices-suite/node-microservices-suite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microservices-suite%2Fnode-microservices-suite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278406691,"owners_count":25981658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","chaos-engineering","containerization","docker-compose","dry","horizontal-scaling","kubernetes","microservices","monorepo","orchestration","saas"],"created_at":"2024-09-30T16:29:43.523Z","updated_at":"2025-10-05T04:06:53.852Z","avatar_url":"https://github.com/microservices-suite.png","language":"JavaScript","readme":"# Microservices Suite 🦧\n\n## Overview\n\nWelcome to the 📦 [Microservices](https://drive.google.com/file/d/1Noc_6WVe0CmzynnuURexm7MCv75OUAuQ/view?usp=drive_link) Suite project! This suite is a collection of Node.js microservices built using the 🦧 [mono-repo]() strategy and leveraging the [yarn workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/) concept. Each microservice runs in its isolated Docker `container`, and `Kubernetes` orchestrates the deployment, providing scalability and efficiency.\nTo easily work with a `@microservices-suite monorepo` you need to install [Suite CLI](https://www.npmjs.com/package/@microservices-suite/cli). With `Suite` you can easily scaffold,manage and automate your monorepo in development, CI as well as production. Check the installation guidelines in the `README.md` section of the `.suite-cli` root.\n\n## Project file structure\n```sequence\n.\n├── CHANGELOG.md\n├── CODE_OF_CONDUCT.md\n├── CONTRIBUTING.md\n├── LICENSE\n├── README.md\n├── docker\n│   ├── README.md\n│   └── apps\n│       └── nyati\n│           ├── docker-compose.dev.yml\n│           ├── docker-compose.yml\n│           ├── krakend\n│           │   ├── README.md\n│           │   └── krakend.json\n│           └── nginx\n│               ├── Dockerfile\n│               ├── Dockerfile.dev\n│               └── default.conf\n├── graphql\n│   └── nyati-app\n│       └── appollo-server.yml\n├── k8s\n│   ├── README.md\n│   ├── broker\n│   │   ├── clusterIp.yaml\n│   │   ├── deployment.yaml\n│   │   ├── loadBalancer.yaml\n│   │   └── nodePort.yaml\n│   ├── ingress\n│   │   └── ingress.yaml\n│   └── ns\n│       └── default\n│           └── nyati\n│               ├── combo.yaml\n│               └── payment\n│                   ├── configMap.yaml\n│                   ├── db\n│                   │   ├── clusterIp.yaml\n│                   │   ├── deployment.yaml\n│                   │   ├── loadBalancer.yaml\n│                   │   └── nodePort.yaml\n│                   ├── secret.yaml\n│                   └── server\n│                       ├── clusterIp.yaml\n│                       ├── deployment.yaml\n│                       ├── loadBalancer.yaml\n│                       └── nodePort.yaml\n├── microservices\n│   └── payment\n│       ├── Dockerfile.dev\n│       ├── ecosystem.config.js\n│       ├── index.js\n│       ├── package.json\n│       └── src\n│           ├── controllers\n│           │   ├── controllers.js\n│           │   └── index.js\n│           ├── models\n│           │   ├── index.js\n│           │   └── models.js\n│           ├── routes\n│           │   ├── index.js\n│           │   └── routes.js\n│           ├── services\n│           │   ├── index.js\n│           │   └── services.js\n│           └── subscriber\n│               ├── index.js\n│               └── subscriber.js\n├── package.json\n├── production.yml\n├── shared\n│   ├── README.md\n│   ├── broker\n│   │   ├── README.md\n│   │   ├── package.json\n│   │   └── rabbitmq\n│   │       ├── exchange.js\n│   │       ├── index.js\n│   │       ├── publisher.js\n│   │       ├── subscriber.js\n│   │       └── worker.queue.js\n│   ├── config\n│   │   ├── README.md\n│   │   ├── config.js\n│   │   ├── index.js\n│   │   ├── logger.js\n│   │   ├── morgan.js\n│   │   └── package.json\n│   ├── constants\n│   │   ├── README.md\n│   │   └── package.json\n│   ├── errors\n│   │   ├── README.md\n│   │   ├── errors.handler.js\n│   │   ├── index.js\n│   │   └── package.json\n│   ├── middlewares\n│   │   ├── README.md\n│   │   └── package.json\n│   └── utilities\n│       ├── APIError.js\n│       ├── README.md\n│       ├── asyncErrorHandler.js\n│       ├── index.js\n│       ├── package.json\n│       ├── pick.js\n│       └── validate.js\n├── suite.config\n├── suite.docker\n├── suite.html\n├── suite.json\n├── suite.k8s\n├── suite.ms\n└── tests\n    ├── README.md\n    └── cli\n        └── scripts\n            └── retrieveWorkspaceName.test.js\n\n36 directories, 84 files\n```\n## Monorepo strategy benefits for microservices:\n\n- **Enforce [DRY](https://japhethobala.com/posts/technical/single-responsibility/) Principles:**\n  - [@Japheth Obala](https://github.com/jobala) the Prophet 😎 has done a sleek job demystifying [👉SOLID \u0026 best practice here](https://japhethobala.com/).\n  - Collocating code encourages code sharing.\n  - Reduce duplication 👉[read about SOLID here](https://japhethobala.com/)\n  - Save time by building on existing boilerplate or reusable functionality.\n\n- **Collaboration:** \n  - Working within the same repository facilitates learning from peers.\n  - Enables the adoption of good coding practices and the avoidance of bad ones.\n\n- **Centralized Development Chores:** \n  - Manage common files like `.gitignore` centrally from the root directory\n  - Reduce unnecessary repetitions in the codebase.\n\n- **Easily Integrate Development Automation:** \n  - Task runner configurations and docker-compose can be managed from the root directory.\n  - simplify the automation of repetitive workflows.\n\n- **Code Sharing Anywhere:** \n  - Publish and import organization-scoped libraries from the npm registry with \n```bash\n    yarn release \n    yarn add \u003c@microservices-suite/foo\u003e\n    yarn workspace @microservices-suite/\u003cworkspace-name\u003e add  @microservices-suite/\u003clibrary\u003e \n```\n  - Using `Suite CLI` you could achieve the results with the following commands\n```bash\n    suite release \n    suite add \u003c@microservices-suite/foo\u003e\n    suite -W \u003cworkspace-name\u003e add  @microservices-suite/\u003clibrary\u003e \n```\n\n- **Easily Containerize and Scale:** \n  - Decouple every microservice to scale individually. \n  - Leverage the [no-hoist yarn workspace](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) feature and custom scripts to enable efficient packaging of microservices into isolated containers.\n\n## Technologies Used\n\n- **Yarn Workspaces:** \n  - Simplifies managing multiple packages within a single repository.\n  - Encourage code sharing \u0026 reduce duplication\n  - Make it easier to handle dependencies and scripts.\n  \n- **Docker Containers:** \n  - Provides lightweight, portable, and self-sufficient containers for packaging and deploying microservices.\n\n### **Alpine** Images\n\n- Alpine images are very minimalistic Linux minidistros that cost you only `~5MB` of real estate. That is why they are used inside your favourite `smart watch ⌚️`. \n- One objective of this project is to `optimize image builds for Continuous Integration (CI)` and `production` environments through the utilization of the slimmest possible images so that you dont bloat ⚠️ your machine in dev and we have a lean server in prod.\n\n#### Key Strategies:\n\n- **Multi-Stage Builds:** \n  - We employ simple Docker constructs like `multi-stage builds` to optimize our image size.\n\n- **Hoisting and Symlinking:**\n  - While these practices promote the `DRY` (Don't Repeat Yourself) principle, they pose a threat to our objective of achieving minimized images. To mitigate this, we leverage `no-hoisting and symlinked libraries`\n  - selectively copying only the `node_modules` generated by `non-hoisted workspaces`. \n  - These are optimized to consume less disk space, ensuring that only the essential shared libraries required by a specific service are included, thereby maintaining the slim profile of our images.\n  - The service itself will build her core node modules normally inside the dockerfile from her `package.json` \n\n### Docker \u0026 Node Best Practices\n\n- For an in-depth guide and best practices on using Docker with Node.js, visit the [Docker \u0026 Node Best Practices](https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md) repository.\n\n### Kubernetes (k8s)\n\n- Kubernetes offers automated deployment, scaling, and management of containerized applications, ensuring reliability and scalability.\n\n# Getting Started\n\nWelcome to our project! To ensure a smooth setup and development experience, ensure you have the following tools installed on your machine:\n\n\n- **Docker:** \n  - For containerization and managing containerized applications.  \n  - 👉 [Install docker here](https://docs.docker.com/engine/install/).\n  - We love 💚 [alpine images](https://alpinelinux.org/) \u003csmall,simple,secure\u003e. \n  - You can read about the specific flavor [here](https://github.com/nodejs/docker-node/blob/main/README.md#how-to-use-this-image)\n- **Suite CLI:** \n  - For easy project scaffolding task automation and workflow management.\n  - Install `suite`: check the installation guidelines below.\n- **Node.js:** \n  - As the runtime environment for executing the application code.  \n  - 👉 [Download LTS version here](https://nodejs.org/en/download)\n- At the project \u003cservice_root\u003e create `.env`, `.env.dev` and `.env.staging` files and copy `environment variables` from the `.env.example` file\n\n## Running Components\n\n- A `component` in our `suite` jargon refers to a `service` or `application`. With `@microservices-suite` you can create 1 or more services as well as applications.\n- Suite is `component-scoped`, giour strategy that enhances modularity and at the same time makes using the monorepo intuitive. Its is inspired by `Single Responsibility` principle.\n- Apps are simply `cohessive` microservices `aggregated` under the `./gateway/apps/` directory to create decoupled services to serve your client. An example is an `Ecommerce app`. This app can have `customer, supplier,orders and products` microservices under the `./microservices/` directory. These microservices are then referenced in `docker-compose` file definitions placed under the `./gateway/apps/ecommerce-app/` directory. Other apps can be added to the `./gateway/apps` directory with their `docker-compose` definitions and `api-gateway configs(nginx/appache)`.\n- Suite scales applications with `kubernetes` and app-scoped `k8s` configs are located under the `./k8s/` directory. Therefore the kubernetes configurations for our Ecommerce app will be located at `./k8s/ecommerce-app`\n- [Suite CLI](https://github.com/microservices-suite/node-microservices-suite/tree/main/.suite-cli/cli) streamlines the process of starting a service(s) or app(s) in `development` \u0026 `production`. Follow these steps to get your environment up and running:\n- You can derive the `service_name` or `app-name` from the workspace name found in the `package.json \"name\": ` property e.g \n```json\n\"name\": \"@microservices-suite/\u003ccomponent-name\u003e\"\n```\n- To run an app in either modes [dev,staging,prod]:\n- If -k or --kubectl flag is specified `suite` spins your app with `kubectl` . You need to have [minikube](https://minikube.sigs.k8s.io/docs/start/) installed and [kubectl](https://kubernetes.io/docs/tasks/tools/). Otherwise defaults to docker compose\n- If -m or --mode is specified you need to have a `docker-compose.\u003cmode\u003e` specified but this is not necessary with kubectl since we only run the development version of kubectl.\n```bash\nsuite start [--kubectl,--mode]|[-km] \u003cmode\u003e \u003capp-name...\u003e \n```\n- This command uses docker-compose to start your app(s)\n- Suite will handle the setup, ensuring your app is ready.\n\n### Running Services with -v --vanilla\n- If you prefer not to use Docker, you can use the `-v,--vanilla`  command to start service(s) using node `PM2` engine in production or `nodemon` in any other mode:\n```bash\nsuite start [--vanilla,--mode]|[-vm] \u003cmode\u003e \u003cservice_name...\u003e\n```\n\n### Using Docker-Compose Directly\n- Should you need to use docker-compose directly for more control over the container orchestration, you can utilize the standard commands provided by Docker:\n- You can replace the yml files with your compose file path and production.yml has been used as an overide. There are many ways to kill the cat in dockers world 😎.\n```bash\n docker-compose  -f docker-compose.yml -f production.yml up --build -d\n docker-compose down\n```\n\n## Contributing\n\nContributions are welcome! If you'd like to contribute to the Microservices Suite project, please follow these guidelines:\n\n1. Fork the repository and clone it to your local machine.\n```bash\ngit clone https://github.com/microservices-suite/node-microservices-suite.git\n```\n2. Create a new branch for your feature or bug fix: \n```bash\ngit checkout -b feat/\u003cmy-feature\u003e\n```\n3. Make your changes and make sure that tests pass.\n\n4. Before committing your changes, make sure it follows the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification:\n\n   - We recommend you use the [Better Commits CLI](https://github.com/Everduin94/better-commits) tool. It is a CLI for writing better commits, following the conventional commits specification.\n\n5. Push to the branch: \n```bash\ngit push origin feat/\u003cmy-feature\u003e\n```\n6. Submit a pull request detailing your changes.\n\n7. Please ensure that your pull request adheres to the project's code style and conventions.\n\n## License\n\n- This project is licensed under the [MIT License](./LICENSE). Feel free to use, modify, and distribute this code for any purpose.\n\n## Acknowledgements\n\nWe would like to thank the developers and contributors to the following technologies used in this project:\n\n- Yarn\n  - [Yarn workspace](https://classic.yarnpkg.com/lang/en/docs/cli/workspace/). \n  - Also checkout [yarn workspaces](https://classic.yarnpkg.com/en/docs/cli/workspaces)\n  - [No-hoist](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)\n- ⚓️ Docker\n  - [⚓️vanilla docker (CLI)](https://docs.docker.com/reference/cli/docker/)\n  - [docker-compose (manage a multi-container application)](https://docs.docker.com/compose/)\n- 🎡 Kubernetes\n  - [minikube (local kubernetes for development only!)](https://minikube.sigs.k8s.io/docs/start/)\n  - [k8s](https://kubernetes.io/docs/home/)\n  - [k8s in the cloud,GKE,EKS and more...](https://kubernetes.io/docs/setup/production-environment/turnkey-solutions/)\n- Curated Resouces(by gilbertandanje@gmail.com)\n  - 👉 Read [Book by Sam Newman](https://samnewman.io/books/building_microservices/)\n  - 🛳️ [containerization, orchestration \u0026 CICD](https://drive.google.com/drive/folders/1_GswpJ5jEm27suzglI-wCDomLIuOSvea?usp=drive_link)\n  - 📦 [microservices](https://drive.google.com/drive/folders/1ObxIg5qyoIij-l9cUovRmTA3Ds_fSigE?usp=drive_link)\n- 🦧 Monorepos\n  - 👉 Monorepo is not [code collocation](https://nx.dev/concepts/more-concepts/why-monorepos)\n  - 👉 Read [Medium article here](https://medium.com/@avicsebooks/monorepo-2edb5a67517d)\n- For design patterns,best practice and DSA checkout this sheet on the [Resources sheet](https://docs.google.com/spreadsheets/d/1aeci3pqPLG2Uwa42SqSrwgJmqM3A_u7DgkmG7IjZ1Ys/edit#gid=643790244)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroservices-suite%2Fnode-microservices-suite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicroservices-suite%2Fnode-microservices-suite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicroservices-suite%2Fnode-microservices-suite/lists"}