A sample Employee Management Portal based on SAP's CAP framework.
This project supports single-tenancy (on local via H2 Database or on cloud via SAP HANA) as well as multi-tenancy (only on Cloud in SAP HANA via CAP's multitenancy support) in SAP Cloud Platform.
Demo of Employee Management - CAP application. Sample data shown are fictitious
There are 2 types of users - manager
& employee
, with set permissions to do particular actions
Service | Allowed Roles | Description |
---|---|---|
manage-team-service |
manager |
Create, Update & Delete teams. Also create new positions (members) in a Team and assign Employees |
manage-employee-service |
manager |
Create, Update & Delete Employees. Also create, update, delete Skills which Employees may have |
manage-application-service |
manager & authenticated-user |
For Managers - Create, Update & Delete applications as well as Accept/Reject applications created by Employees For Employees - Create (Apply for a Job) applications for various Teams and add in a Resume as plain-text |
my-profile-service |
authenticated-user |
Personal Employee details, if the authenticated-user has one and optionally add/delete Skills and update DOB |
-
Run Maven to compile the project
mvn clean package
-
Run the Spring Boot application
a. Use 'Run' in VS-Code and select 'Debug (Launch)-Application' task to launch the application (Recommended)
or
b. Execute the command in a terminal. The
-P cdsdk-global
activates the profile to skip the installation of CDS SDK for every build.mvn spring-boot:run -P cdsdk-global
Note: If the compilation fails with
Executable npx not found
error, make sure to delete thenode_modules/
folder from the root of the project.
-
The oData API is available at https://localhost:8080
-
The UI is available at https://localhost:8080/fiori.html
-
Cloud MTA Builder Tool (Install)
-
Cloud Foundry CLI (Install)
-
Cloud Multiapps CF CLI Plugin (Install)
-
Cloud Foundry CLI logged into the SAP Cloud Foundry account (Step 1 of tutorial)
The Cloud MTA Builder Tool doesn't support custom
mta.yaml
filenames SAP/cloud-mta-build-tool#709. For multi-tenant deployments, renamemta-multitenant.yaml
tomta.yaml
&cds-security-multitenant.json
tocds-security.json
-
Build the MTAR package. Once built, you can find a package named
employee-management_x.y.z.mtar
under mta_archives/ foldermbt build
-
Push the MTAR package and deploy in the Cloud Foundry
cf deploy mta_archives/employee-management_x.y.z.mtar
After subscribing to the application in a separate Sub-account, assign yourself the Extension_Developer
& Extension_Admin
roles.
Execute the following to create an extension project in your local
cds extend https://<DEPLOYED_SUB_ACCOUNT>-<DEPLOYED_SPACE>-employee-management-sidecar.cfapps.sap.hana.ondemand.com/ -d <PROJECT_NAME> -s <SUBSCRIBED_SUB_ACCOUNT>
While logging in, a passcode may be asked (if your account is protected by MFA), for which a passcode can be created from https://<SUBSCRIBED_SUB_ACCOUNT>.authentication.sap.hana.ondemand.com/passcode
. Once authenticated, an extension project will be created locally.
Once created, you can push the changes to your subscribed tenant and activate it by executing the following command
cds activate --to https://<DEPLOYED_SUB_ACCOUNT>-<DEPLOYED_SPACE>-employee-management-sidecar.cfapps.sap.hana.ondemand.com/ -s <SUBSCRIBED_SUB_ACCOUNT>
More details on SaaS Extensions here.
MIT License
Copyright (c) 2020 Merbin J Anselm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.