GithubHelp home page GithubHelp logo

grknylmz / btp-full-stack-typescript-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap-archive/btp-full-stack-typescript-app

0.0 0.0 0.0 496 KB

A sample project to demonstrate how to implement a full-stack app with SAP Cloud Application Programming Model, plus SAPUI5 and TypeScript.

Home Page: https://blogs.sap.com/2021/12/09/full-stack-typescript-app-for-cloud-foundry-sample-repository/

License: Apache License 2.0

TypeScript 90.18% CSS 0.10% HTML 3.42% CAP CDS 6.31%

btp-full-stack-typescript-app's Introduction

Open in Visual Studio Code License Status REUSE status

Full Stack TypeScript App

This sample project is a full stack application for the SAP BTP, Cloud Foundry environment that utilizes the SAP Cloud Application Programming Model (CAP) for Node.js and SAPUI5 with TypeScript.

TypeScript is a superset of JavaScript, which can essentially be described as JavaScript with syntax for types. The additionally added syntax allows a better editor integration and aims to catch errors early in development.

This project shows a full stack app entirely build with TypeScript. It is based on a basic lecture schedule scenario. The backend service features a simple data model (Rooms, Professors, Courses, Lectures) and provides data to populate a lecture schedule, which is displayed as a planning calendar on the frontend. Users can either view or manage the lecture schedule depending on the roles that are assigned to them.

diagram

UI5 TypeScript Frontend: A freestyle SAPUI5 app serves as the frontend for the project. Component, Controller, and Formatter are implemented using the perks of TypeScript. If you want to learn more about TypeScript with UI5, have a look at the following resources:

CAP TypeScript Backend: The backend service is implemented with CAP Node.js. TypeScript is used to write the service handler for the lecture service. A tsconfig.json file is used to define TypeScript compiler options and configuration. You can find more on using TypeScript with CAP here:

For a more detailed description of the sample app and takeaways when using TypeScript, please take a look at the accompanying blog post: Full Stack TypeScript App for Cloud Foundry - Sample Repository

Requirements

Download and Installation

  1. Clone the project:
git clone https://github.com/SAP-samples/btp-full-stack-typescript-app.git
cd btp-full-stack-typescript-app

(or download from https://github.com/SAP-samples/btp-full-stack-typescript-app/archive/main.zip)

  1. In the btp-full-stack-typescript-app folder, use npm (or yarn) to install the dependencies:
npm install
  1. In the app/lectures sub-folder, use npm (or yarn) to install the dependencies:
cd app/lectures
npm install

Run, Build and Deploy the App

npm run start is for production purposes and not intended to be used on your local machine. Since TypeScript code itself cannot be executed, a transpile step to JavaScript is needed before running the project. Choose one of the following options instead to run the app.

Run the App locally

npm run start-service:ts

The service is now available at http://localhost:4004.

npm run start-ui:ts

The UI5 app is now running on http://localhost:8080/index.html (a browser window with this URL opens automatically).

For local development with mock authentication use one of the following users to test the app:

ID password
admin initial
viewer initial

Run the App locally in watch mode

npm run watch

This starts a local development server in watch mode. Changes to files (including the uncompiled TypeScript resources) are automatically detected and applied. The CAP service is now available at http://localhost:4004 (a browser window with this URL opens automatically to show the generic index.html page), and the UI5 app can be accessed at http://localhost:4004/webapp/index.html.

For local development with mock authentication use one of the following users to test the app:

ID password
admin initial
viewer initial

Build the MTA and Deploy to Cloud Foundry

Additional preparation steps and tools are required to deploy the application to SAP BTP, Cloud Foundry environment. For more information and guidance on the initial setup, please have a look at these tutorials and resources:

mbt build -t ./
cf login
cf deploy lecture-schedule_1.0.0.mtar

Limitations

  • The local database uses in-memory mode. Data will be re-initialized after each restart.
  • The provided sample data only covers a specific timeframe (CW47/2021 to CW05/2022)
  • The user role check for UI adjustments is based on the standalone approuter and BTP roles. Therefore it is not available when running the app locally.

Known Issues

None at the moment.

How to obtain Support

This content is provided "as-is" with no other support.

License

Copyright (c) 2021 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 file.

btp-full-stack-typescript-app's People

Contributors

btbernard avatar gregorwolf avatar iobert avatar ohitslena avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.