{"id":18470388,"url":"https://github.com/aliencreations/node-dev-environment","last_synced_at":"2025-05-12T03:10:43.779Z","repository":{"id":99301694,"uuid":"311220734","full_name":"AlienCreations/node-dev-environment","owner":"AlienCreations","description":"Alien Creations Developer Microservice Emulator","archived":false,"fork":false,"pushed_at":"2021-10-30T18:31:35.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-11T00:58:29.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlienCreations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":"auditroutes.sh","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-09T04:11:31.000Z","updated_at":"2023-02-21T22:24:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd3e7b61-aff7-4a65-8134-3d5cd1e39928","html_url":"https://github.com/AlienCreations/node-dev-environment","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fnode-dev-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fnode-dev-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fnode-dev-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlienCreations%2Fnode-dev-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlienCreations","download_url":"https://codeload.github.com/AlienCreations/node-dev-environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253501849,"owners_count":21918326,"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":[],"created_at":"2024-11-06T10:13:48.944Z","updated_at":"2025-05-11T00:58:31.915Z","avatar_url":"https://github.com/AlienCreations.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Using this repo\nIf you have not already done so, scroll down to the **Dependencies** section below and make sure you have all the system dependencies installed.\n\nThis is meant to be run from within a folder containing the other `platform` microservices. For example:\n\n```\n- my-project\n  |\n  -- software\n     |\n      -- node-dev-environment\n         |\n          -- platforms\n             |\n              -- auth-platform\n              -- product-platform\n              -- ...\n          -- clients\n             |\n              -- my-project-web\n              -- ...\n```\n\nYou don't need to clone those repos first as the script below will do that.\n\n## Step 1\nLog into NPM if you haven't done so already and update your `.npmrc` file to include `@aliencreations:registry=https://npm.pkg.github.com/`\n\n\n## Step 2\n##### Install all the project apps\n\nSpecify your user for http auth, your github organization which contains the forks, and install clients and platforms separately\n\n```\n$ yarn install-clients -u \u003cgithub username\u003e -o \u003cgithub organization\u003e\n```\n\n```\n$ yarn install-platforms -u \u003cgithub username\u003e -o \u003cgithub organization\u003e\n```\n\nRun this command to \n - pull down the supported `platform` projects (*-platform) and install their dependencies in folders matching the github repo names.\n - pull down the supported `client` projects (*-web) and install their dependencies in folders matching the github repo names.\n \nThe list of supported platforms for this project can be found in `./exports/platforms`. \nThe list of supported clients for this project can be found in `./exports/clients`. \n\nAs we create new clients and clients, we will need to add them to these lists. \n\nWe also pre-define ports from 3000 onward for the clients in _this_ repo. \n\nPlatforms specify their own ports in their own repos. \n\nIf you are fine with the default ports, this should all work fine.\n\nTo manually specify a particular platform/client or group of platforms/clients to install, just add a list of one or more platform names. An example : \n_NOTE_: This is a change from previous versions which required `-s` before each platform name. This\nversion can accept `-s` but does not require it.\n\nPlatform aliases are `[alias]-platform` to match github repository naming conventions:\nHere are some examples; any stored procedures you have which may include the `-s` are still supported\n```\n$  yarn install-platforms -u \u003cgithub username\u003e -o \u003cgithub organization\u003e auth i18n # The preferred method\n$  yarn install-platforms -u \u003cgithub username\u003e -o \u003cgithub organization\u003e -s auth i18n\n$  yarn install-platforms -u \u003cgithub username\u003e -o \u003cgithub organization\u003e -s auth -s i18n\n```\n\nClient aliases are `[alias]-web` to match github repository naming conventions; similar changes as\nlisted above for install-platforms: `-s` not required but supported.\n```\n$ yarn install-clients -u \u003cgithub username\u003e -o \u003cgithub organization\u003e app1 app2\n```\n\n## Step 3\n###### Once you install everything, start the system. There are two parts: docker infrastructure, and the suite of apps: \n\n```\n$ yarn boot-up\n```\nRun this command to spin up the Docker infrastructure (mysql, s3, etc) which will support _all_ the platform platforms.  \n*The platforms themselves are not started with this command.*\n\nIf you'd like to use this to run unit tests on multiple platforms, you likely want to mount MySQL to memory (tmpfs). In this case, \nsimply add the `test` flag: \n\n```\n$ yarn boot-up test\n```\n\nTo bring down the platforms, execute:\n```\n$ yarn boot-down\n```\nThis is important because Docker will hold onto these containers and images and they take up memory on your computer.\n\n\n## Step 4 (IN A NEW TERMINAL WINDOW)\n##### Start the apps\n\nOption 1: This will start _all_ platform apis and _all_ web clients:\n```\n$ yarn start\n```\n\nOption 2: This will start _all_ platform apis only:\n```\n$ yarn start-platforms\n```\n\nOption 3: This will start _all_ clients only:\n```\n$ yarn start-clients\n```\n\nOptions 2 and 3 accept optional aliases. Example, only start up i18n and media platforms, and order tunnel:\n```\n$ yarn start-platforms auth i18n\n$ yarn start-clients app1\n```\n\n\n## Testing connectivity\nThis will try to hit a `ping` endpoint for all the platforms. Success will be if you receive a `pong` response.\n```\n$ yarn test\n```\n\n## Restarting\nPlatform apis often do a lot of database and binary asset seeding to Docker that can be time-consuming to stop and start \nagain while working and testing changes. If you are working on a platform and simply want to restart Express without \nrebuilding the database and asset seeds, you can use the restart command: \n```\n$ yarn restart-platforms\n``` \n\nor one/many specified: \n```\n$ yarn restart-platforms i18n media\n``` \n\n#### Restarting client apps\nYou can also restart the client apps but usually the workflow would be that you use the `node-dev-environment` to spin up \nall the _other_ client apps that run in parallel to the one you are working on. In a new terminal or in your IDE you could \nspin up that one client app (make sure ports don't conflict) and then use webpack's live-reload which may be much easier.\n```\n$ yarn restart-clients\n``` \n\nor one/many specified: \n```\n$ yarn restart-clients app1 app2\n``` \n\n## Kill command\nIn an emergency if things go haywire, stop all platforms and clients. In a new terminal:\n```\nkillall node\n```\nor\n```\npkill -9 node\n```\n\n## Dependencies\nThese are the system dependencies required to run all the node.js microplatforms.\n\n### DNS\nEITHER : Add the following to your `/etc/hosts` file:\n```\n127.0.0.1 platform.auth-platform.test\n127.0.0.1 platform.media-platform.test\n127.0.0.1 platform.product-platform.test\n127.0.0.1 platform.i18n-platform.test\n127.0.0.1 platform.customer-platform.test\n127.0.0.1 platform.message-platform.test\n... and so on for each domain\n```\n\nOR : Use dnsmasq https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/\n\n### NodeJS\nMake sure [Node is installed](https://nodejs.org/en/download/). These apps require at least node version 10.x.\n\nMake sure you are the owner of the folder in which NPM needs to install any global dependencies: ([article with more information](http://howtonode.org/introduction-to-npm)).\n\nOn OSX/Unix, this command should work:\n```\n$ sudo chown -R $USER /usr/local\n```  \n* note: Depending on how much is in that directory, that command may take a bit of time to run.\n\n### Install the Node dependencies\n### Yarn\nInstall [Yarn](https://yarnpkg.com/lang/en/docs/install/) and use it instead of npm to ensure consistent builds.   \nOn OSX, you can easily install Yarn with Homebrew:\n\n```bash\nbrew update\nbrew install yarn\n```\n\n### XCode\n1.  Install Xcode from the Mac Store\n1.  After running `yarn install` on one of the frontend apps like SNR Trak, if you get a node `gyp` error, try executing `xcode-select --install` and if that still doesn't work, run\n```\n$ xcode-select -print-path\n/Library/Developer/CommandLineTools\n$ sudo rm -rf /Library/Developer/CommandLineTools\nxcode-select --install\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Fnode-dev-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliencreations%2Fnode-dev-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliencreations%2Fnode-dev-environment/lists"}