{"id":21428035,"url":"https://github.com/redhat-developer-demos/instrument-resellers","last_synced_at":"2026-02-02T00:01:54.980Z","repository":{"id":37260561,"uuid":"499555309","full_name":"redhat-developer-demos/instrument-resellers","owner":"redhat-developer-demos","description":"A project that demonstrates multitenancy architectures using Kubernetes namespaces","archived":false,"fork":false,"pushed_at":"2022-07-22T18:29:55.000Z","size":3379,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-16T01:41:11.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/redhat-developer-demos.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":"2022-06-03T15:09:42.000Z","updated_at":"2022-09-01T04:29:47.000Z","dependencies_parsed_at":"2022-07-10T02:16:51.919Z","dependency_job_id":null,"html_url":"https://github.com/redhat-developer-demos/instrument-resellers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redhat-developer-demos/instrument-resellers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Finstrument-resellers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Finstrument-resellers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Finstrument-resellers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Finstrument-resellers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhat-developer-demos","download_url":"https://codeload.github.com/redhat-developer-demos/instrument-resellers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhat-developer-demos%2Finstrument-resellers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28996568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T23:10:54.274Z","status":"ssl_error","status_checked_at":"2026-02-01T23:10:47.298Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-22T22:09:49.827Z","updated_at":"2026-02-02T00:01:54.956Z","avatar_url":"https://github.com/redhat-developer-demos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# instrument-resellers\nA project that demonstrates multi-tenancy architectures using Kubernetes namespaces.\n\n# Warning!\n\n**DO NOT USE THIS PROJECT'S CODE IN PRODUCTION!**\n\nThere are high severity security issues with the some of the `npm` libraries.\n\nThis code is provided for demonstration purposes only.\n\n# Project Dependencies\n\nThe project requires a working Kubernetes cluster. Running the cluster under OpenShift provides the added benefit of making access to the application a bit easier. OpenShift provides a special Kubernetes resource named `Route`. The `Route` resource published a public URL that enables access the application. Using route is a bit easier than having to go through the effort of setting up public access  the application by configuring a Kubernetes ingress. \n\nThe application also require a MongoDB database for each intended reseller running within the cluster or accessible from the cluster.\n\n# Understanding the structure of the project.\n\nThis project is divided into to parts. The first part is the data seeder which populates random data into the particular reseller's database according to the reseller type. For example a clarinet reseller will be clarinet data, a brass reseller will get brass data and a saxophone reseller will get saxophone data.\n\nThe reason for populating data particular to the reseller type is to make is to that the API published by the Reseller application presents data that easy to conceptualize as belonging to a particular reseller, thus avoiding confusion.\n\nThe second part of the project is the actual reseller application that publishes the API that particular to the reseller.\n\nThe setup process for the project is to first install and run the Data Seeder for each reseller and then deploy the API application for each reseller.\n\n![basic image](./images/basic-process.png)\n\n\n# Installing and running the Instrument Reseller Data Seeder\n\n## Environment variables\n\nThe data seeder requires that the following environment variables are present in the process in which the application is running.\n\n**Format:**\n\n```text\nRESELLER_INSTRUMENT=\"\u003cinstrument_type\u003e\" #choose from clarinet, brass or saxophone\nSEEDER_COUNT=\u003cnumber_acquisitions_refurbishments_and_purchases_to_create\u003e\nRESELLER_DB_NAME=\"\u003creseller_database_name\u003e\"\nMONGODB_URL=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003chost_name\u003e:\u003cport_where_applicable\u003e\n```\n\n**Example:**\n\n```text\nRESELLER_INSTRUMENT=\"clarinet\"\nSEEDER_COUNT=10\nRESELLER_DB_NAME=\"clarinets\"\nMONGODB_URL=mongodb+srv://my-user:mypassword@my-user:mypassword@remotehost:8001?authMechanism=SCRAM-SHA-256\u0026authSource=admin\u003e\n```\n\n## Running the data seeder application from source\n\n`npm install`\n\n`npm run seed`\n\n## Creating the Container Image for Instrument Reseller Data Seeding\n\nThe following will build and push the data seeder container image to a private container registry running at host `192.168.86.34:5000` using `docker`\n\n```bash\ndocker build -t instrumentresellerseeder ./Seederfile\n\ndocker tag instrumentresellerseeder 192.168.86.34:5000/instrumentresellerseeder:v.09\n\ndocker push 192.168.86.34:5000/instrumentresellerseeder\n```\n\nThe following will build and push to the container image repository using `buildah`.\n\n```bash\nbuildah bud -t instrumentresellerseeder ./Seederfile\n\nbuildah tag instrumentresellerseeder 192.168.86.34:5000/instrumentresellerseeder:v.09\n\nbuildah push 192.168.86.34:5000/instrumentresellerseeder\n```\n\n## Running the Linux container for data seeding\n\n```bash\ndocker run -d -e RESELLER_INSTRUMENT=\"clarinet\" \\\n-e SEEDER_COUNT=10 \\\n-e RESELLER_DB_NAME=\"clarinets\" \\\n-e RESELLER_INSTRUMENT=\"clarinet\" \\\n-e MONGODB_URL=\"mongodb://my-user:mypassword@remotehost:8001\" \\\n--name clarinet_seeder \\\nquay.io/reselbob/instrumentresellerseeder:v.09\n```\n\n# Installing and running the Instrument Reseller Web Application\n\n## Environment variables with sample data\n\nThe application requires that the following environment variables are present in the process in which the application is running.\n\n**Format:**\n\n```text\nSERVER_PORT=8088\nSERVER_HOST=http://\u003cDNS_NAME\u003e\nRESELLER_INSTRUMENT=\"\u003cinstrument_type\u003e\" #choose from clarinet, brass or saxophone\nRESELLER_NAME=\"\u003cBUSINESS_NAME_OF_VENDOR\u003e\"\nRESELLER_DB_NAME=\"\u003creseller_database_name\u003e\"\nMONGODB_URL=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003e@\u003chost_name\u003e:\u003cport_where_applicable\u003e\n```\n\n\n**Example:**\n```text\nSERVER_PORT=8088\nSERVER_HOST=\"http://localhost\"\nRESELLER_INSTRUMENT=\"saxophone\"\nRESELLER_NAME=\"Sidney's Saxophones\"\nRESELLER_DB_NAME=\"saxophones\"\nMONGODB_URL=\"mongodb+srv://my-user:mypassword@example-mongodb-svc.mongodb.svc.cluster.local\"\n\n```\n\n## Running a Reseller's application from source\n\n`npm install`\n\n`npm start`\n\n\n## Creating the Container Image for the Instrument Reseller application\n\nThe following will build and push the Instrument Reseller container image to a private container registry running at host `192.168.86.34:5000` using `docker`.\n\n```bash\ndocker build -t instrumentreseller ./Resellerfile\n\ndocker tag instrumentreseller 192.168.86.34:5000/instrumentreseller:v.09\n\ndocker push 192.168.86.34:5000/instrumentreseller\n```\n\nThe following will build and push the Instrument Reseller container image using `buildah`:\n\n```bash\nbuildah bud -t instrumentreseller ./Resellerfile\n\nbuildah tag instrumentreseller 192.168.86.34:5000/instrumentreseller:v.09\n\nbuildah push 192.168.86.34:5000/instrumentreseller\n```\n\n\n## Running a Reseller's application as a container\n\n```bash\ndocker run -d -e SERVER_PORT=\"8088\" \\\n-e SERVER_HOST=\"http://localhost\" \\\n-e RESELLER_INSTRUMENT=\"CLARINET\" \\\n-e RESELLER_NAME=\"Clyde's Clarinets\" \\\n-e RESELLER_DB_NAME=\"clarinets\" \\\n-e MONGODB_URL=\"mongodb+srv://my-user:mypassword@example-mongodb-svc.mongodb.svc.cluster.local\" \\\n-p 8088:8088 \\\n--name clarinet_reseller \\\nquay.io/reselbob/instrumentreseller:v.09\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Finstrument-resellers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhat-developer-demos%2Finstrument-resellers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhat-developer-demos%2Finstrument-resellers/lists"}