{"id":15153005,"url":"https://github.com/rxdi/deploy","last_synced_at":"2025-09-30T01:32:09.344Z","repository":{"id":97953880,"uuid":"141765145","full_name":"rxdi/deploy","owner":"rxdi","description":"Bundler and deployer for reactive decentralized package system","archived":true,"fork":false,"pushed_at":"2020-04-29T11:50:33.000Z","size":10238,"stargazers_count":8,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-25T20:21:16.724Z","etag":null,"topics":["dapps","decentralized-applications","deployer-ipfs","deployment","docker","easy-ipfs-deploy","in-decentra-apps-we-trust","ipfs","ipfs-blockchain","ipfs-hash","ipfs-package","ipfs-package-deployer","ipfs-package-system","ipfs-protocol","node-modules-replacement","nodejs","nodejs-ipfs-package-system","reactive-dependency-injection","reactive-programming","rxdi-decentralized-package-system"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rxdi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2018-07-20T23:05:38.000Z","updated_at":"2024-05-30T12:03:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"5106ceb4-b78b-4628-8d44-5dffc8db5692","html_url":"https://github.com/rxdi/deploy","commit_stats":{"total_commits":553,"total_committers":1,"mean_commits":553.0,"dds":0.0,"last_synced_commit":"0698270225769f503c3d4236c8cb68a5b081968d"},"previous_names":[],"tags_count":332,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxdi%2Fdeploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxdi%2Fdeploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxdi%2Fdeploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxdi%2Fdeploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rxdi","download_url":"https://codeload.github.com/rxdi/deploy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219873868,"owners_count":16554521,"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":["dapps","decentralized-applications","deployer-ipfs","deployment","docker","easy-ipfs-deploy","in-decentra-apps-we-trust","ipfs","ipfs-blockchain","ipfs-hash","ipfs-package","ipfs-package-deployer","ipfs-package-system","ipfs-protocol","node-modules-replacement","nodejs","nodejs-ipfs-package-system","reactive-dependency-injection","reactive-programming","rxdi-decentralized-package-system"],"created_at":"2024-09-26T16:43:15.246Z","updated_at":"2025-09-30T01:32:08.379Z","avatar_url":"https://github.com/rxdi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bundler and Deployer for decentralized packages\n\n\u003e This repository is created to help people creating decentralized packages via IPFS easy\n\n\u003e Single command to deploy!\n\n\u003e Version control based on Hashes\n\n\u003e Typescript and Javascript compatible\n\n\u003e Message history\n\n\u003e Readme data (TODO)\n\n\u003e Parcel Lazy Module import for Browser (currently not supported) files will not be downloaded so the resolver will not find them (TODO)\n\n\u003e Web UI Included!\n\n#### Install globally\n```bash\nnpm i @rxdi/deploy -g\n```\n\n###### Starting WebUI\n\n```bash\nrxdi-deploy --webui --open-browser\n```\n\nOr using command line\n\n#### Bundle and deploy your file!\n\n```bash\nrxdi-deploy ./index.ts @yournamespace \"fix(ManyThings): inside core module\" -v --tsconfig\n```\n\n#### Two liner test deploy\n\n###### Create typescript file:\n```bash\necho \"export const rxdi_deploy = 'rxdi-deploy-test';\" \u003e index.ts\n```\n\n###### Deploy created file:\n```bash\nrxdi-deploy ./index.ts @nonamespace \"init(): init commit\" -v --tsconfig\n```\n\n\n#### After deploy screen:\n\n![rxdi-package-system](https://cloudflare-ipfs.com/ipfs/QmQaUMabwM49XtzMzCBF8EPiS3QqFsXcUjtMBKXz4HSrgo)\n\n\n#### After deploy screen with warnings:\n![rxdi-package-system](https://cloudflare-ipfs.com/ipfs/QmSnfFEQdtUV3HdbxByRTMRr9y8QLHJF7mwqmaiamoLLJf)\n\n#### Installing deployed module\n###### Install global `@rxdi/core` this is our connection with the uploaded package\n\n```bash\nnpm install -g @rxdi/core\n```\n\n##### Install module\n\n```bash\nrxdi install `ipfs-hash`\n```\n\n```bash\nrxdi i QmWxi1tiVRJfVCTkFD9upaeQoPgG4NzbagxyA1RQCt3X3P\n```\n\n\n#### Explanation\n\n```bash\nrxdi-deploy `main-file` `namespace` `message` `...arguments`\n```\n\n`main-file`: This is the main bundle file\n\n`namespace`: How this module will be `imported` example: `@yournamespace` `import {} from '@yournamespace';`\n\n`message`: Short message representing what is changed in this version\n\n`...aruments`: \n\n\u003e `(--message)`: Simple commit message when deploying module\n\n\u003e `(--out-dir)`: Parcel build out dir\n\n\u003e `(--file)`: Pass file path after this argument\n\n\u003e `(--namespace)`: How this module will be named ? Later when you install it you can use it as follow import { MyModule } from @mynamespace\n\n\u003e `(--beat)`: How many seconds the application should stay after deploy recomended 20 seconds so file will be distributed accross the network\n\n\u003e `(--html)`: Pass your html file this will override --message or 3-th argument message and you can put whole html\n\n\u003e `(--webui)`: Will spawn web ui with many settings, history, last deployed module etc. can be passed with --open-browser argument\n\n\u003e `(--open-browser)`: Will open browser for web user interface\n\n\u003e `(--graphiql-playground)`: Development purposes open graphiql-playground dev tools\n\n\u003e `(--node-only)`: Will just spawn node so you can use it for persistent data\n\n\u003e `(--silent)`: Will silent every program output log\n\n\u003e `(--unminify)`: Tell ParcelJS to not minify or uglify current deployed module\n\n\u003e `(--browser)`: Will tell ParcelJS to build current module for browser\n\n\u003e `(--tsconfig)`: Create tsconfig file if not exist\n\n\u003e `(--verbose)`: Better logging or you can use -v argument for simplicity\n\n\u003e `(--default-ipfs-node)`: ` ipfs node is GO but if you want you can use JS '--default-ipfs-node js'\n\n\u003e `(--ipfs-api-gateway)`: This is the address of the IPFS Gatway default: 8081\n\n\u003e `(--ipfs-api-port)`: This is the port of the IPFS Api default: 5002\n\n\u003e `(--ipfs-swarms)`: These are the swarms for the Ipfs daemon passing them with comma separated example: --ipfs-swarms /ip4/0.0.0.0/tcp/4001,/ip6/::/tcp/4001, etc...\n\n\u003e `(--deployer-config-name)`: This is default reactive.json filename you can change with other but in this moment is not tested very well\n\n\u003e `(--graphiql)`: Open GraphiQL dev screen\n\n\u003e `(--open-browser-graphiql)`: Open browser for development purposes with Graphiql Dev tools\n\n\u003e `(--webui-server-watcher)`: If this argument passed we can spawn our server watcher so we can manage syncronization with UI and passing data from the rxdi-deploy server\n\n\u003e `(--webui-server-watcher-port)`: Watcher port is the main status port for webui if changed webui will not work defaults: 8957\n\n\u003e `(--graphiql-subscription-endpoint)`: Graphiql Dev tool subscription endpoint\n\n\u003e `(--graphiql-auth-token)`: Authentication token for graphiql dev tools\n\n\u003e `(--graphql-endpoint)`: Endpoint for the Graphql webserver\n\n\u003e `(--write-effects)`: Development effects are for graphql webserver can be checked here for more info https://github.com/Stradivario/gapi\n\n\u003e `(--graphql-server-only)` : This argument will start also graphql web server so you can start making queries and interact with deployer only via API\n\n\u003e `(--graphiql-endpoint)`: Endpoint for Graphiql development tools\n\n\u003e `(--graphql-api-port)`: Development server api port is random, if set --random-port false will default to: 9300 if --graphql-api-port 8*** is not set\n\n\u003e `(--random-port)`: This parameter will set random port to Graphql Server if for example you dont have the port avalable\n\n\u003e `(--disable-package-collection)`: Disable collecting dependencies from package.json\n\n\u003e `(--collect-packages)`: Collect dependencies from package.json and transfer it to reactive.json\n\n\u003e `(--server-push-interval)`: Interval for server push service this is how fast the data will update by default is 7 seconds\n\n\u003e `(--help)`: This help suite :)\n\n`unminify` - Reason that we don't have `minify` option and by `default` rxdi-deploy `minify` every bundle is that we care about Nature and for every deployed IPFS file even for testing will cost in the future many environmental changes for maintaining much larger space than we actualy can use.\n\n`beat` argument is created for better control over process termination.\nReason this exist is internal mechanism since we ADD file to IPFS and then stop the Daemon no one can serve the file for us.\nSo to fix this we need to PING biggest IPFS nodes available at the moment with our new generated HASH.\nSince some of them may be down or the connection may be slow the flow of Pinging content onto IPFS is separated from the main Deploy chain.\nThis solution will provide us with stable independent build with correct end result.\n\n#### Adding other file than `.ts` or `.js`\n\n```bash\nrxdi-deploy P1010094.jpg\n```\n###### If the file is bigger put `--beat 30` number is equivalent to seconds\n###### This will ensure sucessfuly distributed file across main nodes\n\n```bash\nrxdi-deploy P1010094.jpg --beat 30\n```\n\n\n#### Docker\n\nAvailable on `docker hub` https://hub.docker.com/r/rxdi/deploy\n\nSingle command to run\n```bash\ndocker run -p 8957:8957 -p 5001:5001 -p 8080:8080 -p 9300:9300 -v $(pwd)/files:/usr/src/app/files -v $(pwd)/packages:/usr/src/app/packages -v $(pwd)/.rxdi:/root/.rxdi -v $(pwd)/.jsipfs:/root/.jsipfs -i -t rxdi/deploy:latest --graphiql-playground --webui\n```\n\n```bash\ndocker pull rxdi/deploy\n```\n\nManual build from source\n\n```bash\ndocker build -t rxdi/deploy .\n```\n\n```bash\ndocker-compose up -d\n```\n\nOpen browser to http://localhost:9300/webui\nTo change the port open `docker-compose.yml`\n\n```yml\nversion: '2'\nservices:\n\n  rxdi-ipfs-deployer:\n    image: rxdi/deploy:latest\n    restart: always\n    mem_limit: 1000000000\n    cpu_shares: 73\n    container_name: rxdi-ipfs-deployer\n    environment:\n      - API_PORT=9300\n      - RANDOM_PORT=false\n      - IPFS_API_GATEWAY=/ip4/127.0.0.1/tcp/8080\n      - IPFS_API_PORT=/ip4/127.0.0.1/tcp/5001\n    ports:\n      - \"9300:9300\"\n      - \"5001:5001\"\n      - \"8080:8080\"\n      - \"8957:8957\"\n    volumes:\n      - ./packages:/usr/src/app/packages\n      - ./.rxdi:/root/.rxdi\n      - ./.jsipfs:/root/.jsipfs\n```\n\n\n\n#### Modify Authentication logic\n\nAdd inside the working directory file with name `interceptor.ts` and add following content;\nif using `docker` place `interceptor.ts` inside `my-project` or mount it at with custom folder `-v $(pwd)/files:/usr/src/app/files`\nas long as `interceptor.ts` present inside `/usr/src/app/files` it will be loaded.\n\nWorking with this approach you need to set `--interceptor ./interceptor.ts` argument\n\nTo be sure that packages will be installed inside container you can pass following option:\n\n```bash\n--globals 'firebase-admin, @rxdi/firestore, express, @angular/cli'\n```\n\n```typescript\nimport { Request } from 'hapi';\nimport { errorUnauthorized, GenericGapiResolversType } from '@gapi/core';\n\ninterface Context {\n  user: { type: string };\n}\n\ninterface Resolver extends GenericGapiResolversType {\n  scope?: string[];\n  public?: boolean;\n}\n\nfunction canAccess(resolverScope: string[], context: Context) {\n  return context \u0026\u0026 context.user \u0026\u0026 resolverScope.filter(scope =\u003e scope === context.user.type).length\n    ? true\n    : errorUnauthorized();\n}\nfunction AuthenticationHooks(resolver: Resolver, context: Context) {\n  canAccess(resolver.scope, context);\n}\nfunction ResolverHooks(resolver: Resolver, root, args, context: Context, info) {\n  if (resolver \u0026\u0026 !resolver.public) {\n    AuthenticationHooks(resolver, context);\n  }\n}\n\n\nexport async function OnRequestHook(request: Request) {\n  return { user: { type: 'ADMIN' } };\n}\n\nexport async function ResolverHook(resolver: Resolver, root, args, context: Context, info) {\n    return ResolverHooks(resolver, root, args, context, info);\n}\n\n\n```\n\nImportant part is that we export 2 methods `OnRequestHook` and `ResolverHook`\nThese are named for convenience the script internally will take UP to 2 methods\n\n1. Request handler function - will populate `context` variable for resolver\n2. Resolver hook function - on every request apply some authentication logic\n3. By default every resolver scope is predefined with `ADMIN` to change it set Environment variable `APP_DEFAULT_SCOPE`\n\n```typescript\nexport async function MyMethodWhichWillPopulateContext(request: Request) {\n  return { user: { type: 'ADMIN' } };\n}\n\nexport async function MyMethodThatWillBeRunnedOnEveryRequest(resolver: Resolver, root, args, context: Context, info) {\n    console.log(context);\n    return ResolverHooks(resolver, root, args, context, info);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxdi%2Fdeploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxdi%2Fdeploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxdi%2Fdeploy/lists"}