{"id":20485025,"url":"https://github.com/SAP-archive/cloud-cap-multitenancy","last_synced_at":"2025-05-09T03:31:05.072Z","repository":{"id":41173427,"uuid":"288797936","full_name":"SAP-samples/cloud-cap-multitenancy","owner":"SAP-samples","description":"SAP Cloud Application Programming Model (CAP) sample code project with multitenancy using service manager-created SAP HANA containers for tenant data isolation.","archived":false,"fork":false,"pushed_at":"2022-06-30T07:38:54.000Z","size":4547,"stargazers_count":35,"open_issues_count":10,"forks_count":21,"subscribers_count":9,"default_branch":"main","last_synced_at":"2023-08-04T22:51:14.014Z","etag":null,"topics":["cloud","cloud-foundry","multitenancy","sample","sample-code","sap-cap","sap-hana","service-manager"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SAP-samples.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":"2020-08-19T17:43:34.000Z","updated_at":"2023-07-21T21:00:43.000Z","dependencies_parsed_at":"2022-08-25T15:10:54.725Z","dependency_job_id":null,"html_url":"https://github.com/SAP-samples/cloud-cap-multitenancy","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fcloud-cap-multitenancy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fcloud-cap-multitenancy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fcloud-cap-multitenancy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SAP-samples%2Fcloud-cap-multitenancy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SAP-samples","download_url":"https://codeload.github.com/SAP-samples/cloud-cap-multitenancy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224810154,"owners_count":17373765,"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":["cloud","cloud-foundry","multitenancy","sample","sample-code","sap-cap","sap-hana","service-manager"],"created_at":"2024-11-15T16:27:06.490Z","updated_at":"2025-05-09T03:31:05.064Z","avatar_url":"https://github.com/SAP-samples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Deprecation Notice\n\nThis public repository is read-only and no longer maintained.\n\n![](https://img.shields.io/badge/STATUS-NOT%20CURRENTLY%20MAINTAINED-red.svg?longCache=true\u0026style=flat)\n\n---\n\u003c!--\nSPDX-FileCopyrightText: 2020 Andrew Lunde \u003candrew.lunde@sap.com\u003e\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/cloud-cap-multitenancy)](https://api.reuse.software/info/github.com/SAP-samples/cloud-cap-multitenancy)\n\n\n# Cloud CAP Multitenancy\n\nSAP Cloud Application Programming (CAP) Node.JS sample code project with multitenancy using service manager created HANA containers for tenant data isolation.  \n\n## Description\n\nThis repository contains a complete Multi-Target Application (MTA) sample project that is an example of using the SAP Cloud Application Programming (CAP) approach and it's multitenancy support library to provide true enterprise multitenant application.\n\nThere are many disparate pieces of information found throughout the SAP documentation as well as the CAP centric documentation, but it is difficult to bring them together as a cohesive whole.  This sample code project provides a good starting point for those wanting to build a best-practice multitenant enterprise application on SAP Business Technology Platform.\n\nThis project is implemented completely in the Node.JS programming language. A Java programing language multitenant sample code project can be found in the repository [cloud-cap-samples-java](https://github.com/SAP-samples/cloud-cap-samples-java). See the [Demonstrated Features](https://github.com/SAP-samples/cloud-cap-samples-java#demonstrated-features) section of the README.\n \n## Branches\n\nThere are several branches in this repo and a little context is warranted.  \n\nThis sample utilizes the CAP multitenancy library (cds-mtx) to handle customer subscriptions which result in the ServiceManager creating run-time HANA hdi-shared containers.  In the original master branch this was tested where each subscribing customer would have their own distinct container with no need of joining the customer container with any shared data.  If this is your use case, then you'll find this version was saved in the single-container branch which will work with versions of the cds-mtx library \u003c 1.0.27.  For use cases where joining per subscriber containers with a singluar common container, a bug was discovered in the library that prevented run-time container deployments upon subscriptions.  A work-around is provided in the xcontainer branch that will work with cds-mtx library \u003c 1.0.27.  This work-around effectively performs a secondary deploy with the proper environment that accomplishes the desired result.  Once a fix was provided in cds-mtx \u003e= 1.0.27, the work-around was no longer needed and the code removed and the fix-things branch was created in order to facilitate testing of the fix.  Once the fix was confirmed effective the code was merged back into the master branch.\n\nThe master branch going forward implements the use-case where each run-time container will be joined with a \"common container\"(as defined in the db_comm folder).  The cds-mtx \u003e= 1.0.27 will accomodate this use-case.\n \n## Requirements\n\n - An [SAP Business Technology Platform account](https://account.hana.ondemand.com/) or [SAP Business Technology Platform Trial account](https://account.hanatrial.ondemand.com/cockpit)\n\n - Quota for HaaS, Application Runtime, SaaS, and Service Manager\n \n ## Download and Installation\n\n - Clone this repo [https://github.com/SAP-samples/cloud-cap-multitenancy.git](https://github.com/SAP-samples/cloud-cap.multitenancy.git) into your local system or IDE of choice.\n\n - Modify the mta.yaml to specify your specific CloudFoundry Credentials configuration (optional).\n\n ```\nmodules:\n - name: capmt-srv\n   type: nodejs\n   path: srv\n...\n   properties:\n      CF_API_USER: user@domain.com\n      CF_API_PW: xxxxxx\n...\n```\n - OR - after deployment, \n 1. Create a file called .env with the following.\n```\nCF_API_USER=\u003cYour User\u003e\nCF_API_PW=\u003cYour Password\u003e\n```\n 2. Run this command to set the ENVIRONMENT with your specifics.\n```\nset -o allexport; source .env; set +o allexport\n```\n \n 3. Update the environment for the capmt-srv module in the CF_CDEDS.sh script.\n```\ncf set-env capmt-srv CF_API_USER $CF_API_USER\ncf set-env capmt-srv CF_API_PW $CF_API_PW\ncf restage capmt-srv\n```\n\n## Project Structure\n\nFile / Folder | Purpose\n---------|----------\n`README.md` | this getting started guide\n`COMMANDS.md` | commands for building/deploying \n`app/` | content for UI frontends go here\n`db/` | database definitions go here\n`documentation/` | supplemental documentation\n`srv/` | your service module code goes here\n`mta.yaml` | project structure and relationships\n`package.json` | project metadata and configuration\n\n## Instructions\n\nReplace **\u003clandscape\u003e.hana.demand.com** with the landscape region variant for your account. \n\nSee the [COMMANDS](COMMANDS.md) file for commands for building and deploying the project.\n\n\n\n## Known Issues\n\nThis example project contains no known issues.\n\n## Limitations\n\nThe creation and assignment of Roles to Roll Collections and the assignment of Roll Collections is limited to global accounts with \"Feature Set B\".\n\n\n## How to obtain support\n\n[Create an issue](https://github.com/SAP-samples/cloud-cap-multitenancy/issues) in this repository if you find a bug or have questions about the content.\n \nFor additional support, [ask a question in SAP Community](https://answers.sap.com/questions/ask.html?additionalTagId=723714486627645412834578565527550).\n \n## Documentation\n\nSee the Multitenancy section under Cookbook in the CAP documentation.  [Multitanancy](https://cap.cloud.sap/docs/guides/multitenancy)\n\nAlso the broader public [CAP Documentation](https://cap.cloud.sap/docs/).\n\n\n\n## Reporting Problems and Contributing Enhancements\n\nAn SAP Code Sample such as this is open software but is not quite a typical full-blown open source project. If you come across a problem, we’d encourage you to check the project’s [issue tracker](https://github.com/SAP-samples/cloud-cap-multitenancy/issues) and to [file a new issue](https://github.com/SAP-samples/cloud-cap-multitenancy/issues/new) if needed. If you are especially passionate about something you’d like to improve, you are welcome to fork the repository and submit improvements or changes as a pull request.\n\n\n## To-Do (upcoming changes)\n\nTools used throughout the development of this project are evolving and my change over time. This may result in discrepancies in the exact procedures or screen-clips in the accompanying blog posts. All efforts will be made to update the content in order to keep pace with the tooling, but cannot be guaranteed.\n\n\n## Learn more...\n\nLearn more in the CAP documentation at [CAPIRE](https://cap.cloud.sap/docs/).\n\nA blog post discussing this code sample can be found on SAP Community. See: [Getting your head into Cloud Application Programming model multitenancy](https://blogs.sap.com/2020/08/20/getting-your-head-into-cloud-application-programming-model-multitenancy/) for a detailed discussion.\n\n\n## License\nCopyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSES/Apache-2.0.txt) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSAP-archive%2Fcloud-cap-multitenancy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSAP-archive%2Fcloud-cap-multitenancy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSAP-archive%2Fcloud-cap-multitenancy/lists"}