{"id":13299632,"url":"https://github.com/JungleMinds/JM_API-Boilerplate","last_synced_at":"2025-03-10T11:32:15.268Z","repository":{"id":41807378,"uuid":"151381720","full_name":"JungleMinds/JM_API-Boilerplate","owner":"JungleMinds","description":"A boilerplate for web APIs using Nodejs - based on Domain Driven Design and Clean Architecture principles","archived":false,"fork":false,"pushed_at":"2023-01-04T15:50:21.000Z","size":2492,"stargazers_count":4,"open_issues_count":25,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-08T19:26:11.958Z","etag":null,"topics":["api","boilerplate","dependency-injection","ecmascript","es6","eslint","javascript","nodejs","prettier","server","wbso"],"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/JungleMinds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-03T08:20:22.000Z","updated_at":"2022-03-23T19:57:04.000Z","dependencies_parsed_at":"2023-02-02T17:45:23.605Z","dependency_job_id":null,"html_url":"https://github.com/JungleMinds/JM_API-Boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JungleMinds%2FJM_API-Boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JungleMinds%2FJM_API-Boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JungleMinds%2FJM_API-Boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JungleMinds%2FJM_API-Boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JungleMinds","download_url":"https://codeload.github.com/JungleMinds/JM_API-Boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242843101,"owners_count":20194326,"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","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":["api","boilerplate","dependency-injection","ecmascript","es6","eslint","javascript","nodejs","prettier","server","wbso"],"created_at":"2024-07-29T17:37:45.611Z","updated_at":"2025-03-10T11:32:15.261Z","avatar_url":"https://github.com/JungleMinds.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JM API Node\n\n[![CircleCI](https://circleci.com/gh/JungleMinds/JM_API-Boilerplate/tree/master.svg?style=shield\u0026circle-token=296fc8427df847c138b554a24e0d06e8ece2d793)](https://circleci.com/gh/JungleMinds/JM_API-Boilerplate/tree/master)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-f3df49.svg)](http://standardjs.com)\n![Nodejs: version](https://img.shields.io/badge/node-%3E%3D8-brightgreen.svg)\n[![Blazing Fast](https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg)](https://twitter.com/acdlite/status/974390255393505280)\n[![dependencies Status](https://david-dm.org/JungleMinds/JM_API-Boilerplate/status.svg)](https://david-dm.org/JungleMinds/JM_API-Boilerplate)\n[![devDependencies Status](https://david-dm.org/JungleMinds/JM_API-Boilerplate/dev-status.svg)](https://david-dm.org/JungleMinds/JM_API-Boilerplate?type=dev)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6650af2ec672c4005480/maintainability)](https://codeclimate.com/github/JungleMinds/JM_API-Boilerplate/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/6650af2ec672c4005480/test_coverage)](https://codeclimate.com/github/JungleMinds/JM_API-Boilerplate/test_coverage)\n\nA boilerplate for web APIs using NodeJS\n\nthe boilerplate follows an architecture inspired by Domain Driven Design and Clean Architecture. It implies in some patterns and methodologies having to be followed to ensure separation of concerns and make the codebase more maintainable.\n\n## Features\n\n---\n\n## Folder structure\n\nThis boilerplate uses a folder structure and logical architecture focused on separation of concerns based in Domain-driven design and Clean architecture. Instead of the classical controllers/models/services folders, we now have layers inside the src folder. Each of the folder layers is scoped by a namespace regarding the concern it is about (like user, errors, logging and so on):\n\n### Application layer (app folder)\n\nThe application layer defines the actual behaviour of our application, thus being responsible for performing interactions among units of the domain layer.\n\n### Domain layer (domain folder)\n\nIn this layer, we may define units which play the role of entities and business rules and have a direct relationship to our domain\nThis is the most isolated and important layer of our software, and it may be used by the application layer to define use cases.\n\n### Infrastructure layer (infrastructure folder)\n\nThis is the lowest layer of all, and it’s the boundary to whatever is external to our application: the database, email services, etc.\n\n### Input interfaces layer (interfaces folder)\n\nThis layer holds all the entry points of our application, such as controllers, websockets, etc.\nIt should not have any knowledge about business rules, use cases, persistence technologies, and not even about other kinds of logic!\nIt should only receive user input (like URL parameters), pass it on to the use case and finally return a response to the user.\n\n    ├── app\n    ├── config\n    │   └── environments\n    ├── domain\n    ├── infrastructure\n    │   └── logging\n    └── interfaces\n        └── http\n            ├── controllers\n            ├── errors\n            ├── logging\n            └── utils\n\n## Prerequisites\n\n#### Docker\n\nInstall [Docker](https://www.docker.com/) on your system.\n\n- [Install instructions](https://docs.docker.com/installation/mac/) for Mac OS X\n- [Install instructions](https://docs.docker.com/installation/ubuntulinux/) for Ubuntu Linux\n- [Install instructions](https://docs.docker.com/installation/) for other platforms\n\n#### Environment Variables\n\nThe initial (default) environment variables have been set for you in the `.env` file. If you need to have custom variables in your dev process you can use a `.env.local` file to override those. The application will use the following files in the following order to create a final set of variables:\n\n1. `.env`\n2. `.env.local`\n3. `.env.\u003cenvironment\u003e`\n4. `.env.\u003cenvironment\u003e.local`\n\nA server (via docker container) will **ONLY** read the `.env` file, so server specific variables should either be passed along in the build command (`ENV_VAR=value \u003cbuild command\u003e`) or in the server configuration.\n\n## Setup\n\n1. Run `npm i`. It will install all dependencies.\n\n2. Run `docker-compose build`. It will pull a base images from the Docker registry.\n\n3. Run `docker-compose up`. This will bootstrap a new app in your container optionaly add optionaly `-d` Detached mode: Run containers in the background.\n\n4. Run `docker-compose down` It will Stops containers and removes containers, networks, volumes, and images created by `up`.\n\nThe app should then be running on your docker daemon on the port you specified in your `.env` file (default: `4050`) or override (see Prerequisites \u003e Environment Variables)\n\n## Scripts\n\nThis boilerplate comes with a collection of npm scripts to make your life easier, you'll run them with `npm run \u003cscript name\u003e`\n\n`npm run start` run the application\n\n`npm run start:watch` run the application in watch mood on every file change\n\n`npm run test` run all unit tests for the appliction\n\n`npm run test:watch` run all unit tests for the appliction in watch mood on every file change\n\n`npm run test:coverage` Create a coverage report for your code and determine whether your coverage is high enough\n\n`npm run lint` Run linting on the application codebase\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJungleMinds%2FJM_API-Boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJungleMinds%2FJM_API-Boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJungleMinds%2FJM_API-Boilerplate/lists"}