Skip to content

This project contains sample applications for SAP Cloud Application Programming Model with DB2 and Podman on AWS EC2.

License

Notifications You must be signed in to change notification settings

QuadriO/db2-cap-samples

 
 

Repository files navigation

Welcome to the DB2 CAP SFlight App

This is a sample app for the travel reference scenario, built with the SAP Cloud Application Programming Model (CAP) and SAP Fiori Elements.

The purpose of this sample app is to:

  • Demonstrate SAP Fiori annotations
  • Demonstrate and compare SAP Fiori features on various stacks (CAP Node.js, CAP Java SDK, ABAP)
  • Run UI test suites on various stacks

Process Travels Page

The app still contains some workarounds that are going to be addressed over time. In some cases, the model and the handlers can be improved or simplified once further planned CAP features become available. In other cases, the app itself could be improved. For example, calculation of the total price for a travel currently simply sums up the single prices ignoring the currencies.

REUSE status

SAP Fiori UI with Node.js Backend

Build and Run

  1. In a console, execute npm ci in the root folder of your project.
  2. In a console, execute cds watch in the root folder of your project.

Accessing the SAP Fiori App

Open this link in your browser: http://localhost:4004/travel_processor/webapp/index.html

Integration Tests

To start OPA tests, open this link in your browser: http://localhost:4004/travel_processor/webapp/test/integration/Opa.qunit.html

Test documentation is available at: https://ui5.sap.com/#/api/sap.fe.test

Deploy to AWS

  1. Login to AWS EC2 Console and create a security group called cap-samples Allow access to the following ports:

    • 22 (SSH)
    • 80 (HTTP)
    • 81 (nginx)
    • 389 (LDAP)
    • 443 (HTTPS)
    • 50000 (DB2)
  2. Create AWS Secrets in IAM

  3. Set your credentials as environment variables. You can also set them for your codespaces

  4. Create a key pair called cap-samples

  5. Set the private key of your key pair in Github as Codespace secret ID_RSA

  6. Open repository in codespace

  7. Set your values inside ansible/external_vars.yml

  8. Run in terminal npm run ansible:create to create and configure a new ec2 instance

  9. Create an Elastic IP and allocate it to the newly create EC instance

  10. Register a new domain with the hoster of your choice and create the following subdomains. Set for the main and the subdomains an A record with the IP of your server - cockpit.db2-cap-samples.de - login.db2-cap-samples.de - auth.db2-cap-samples.de - proxy.db2-cap-samples.de - webhook.db2-cap-samples.de

  11. Login to nginx proxy and add new proxy hosts - Initial user: admin@example.com - Initial password: changeme - login.db2-cap-samples.de Port: 4443 - auth.db2-cap-samples.de Port: 4444 - db2-cap-samples.de Port: 4004 - webhook.db2-cap-samples.de Port: 9000 - proxy.db2-cap-samples.de Port: 81 - cockpit.db2-cap-samples.de Port: 9090

  12. Set a new Github Action secret DEPLOY_WEBHOOK_URL: https://webhook.db2-cap-samples/hooks/redeployment?secret=fancySecret

  13. Create a new Github Action secret PAT with your Personal Access Token

  14. Create a new deploy key and set the private key as COMMIT_KEY

About

This project contains sample applications for SAP Cloud Application Programming Model with DB2 and Podman on AWS EC2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.9%
  • HTML 19.0%
  • Dockerfile 9.2%
  • Shell 1.9%