From 8429bdc9a3a28c5a86eb0cbd3ba3c236594c2589 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 2 Mar 2020 10:24:33 +0100 Subject: [PATCH] Added samples overview --- README.md | 6 ++- {events => reviewed}/package.json | 0 {events => reviewed}/services.cds | 0 {events => reviewed}/services.js | 0 {events => reviewed}/tests.http | 0 samples.md | 73 +++++++++++++++++++++++++++++++ 6 files changed, 77 insertions(+), 2 deletions(-) rename {events => reviewed}/package.json (100%) rename {events => reviewed}/services.cds (100%) rename {events => reviewed}/services.js (100%) rename {events => reviewed}/tests.http (100%) create mode 100644 samples.md diff --git a/README.md b/README.md index d6128544..035f62cd 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Welcome to cap/samples -Find here code samples for the [SAP Cloud Application Programming Model](https://cap.cloud.sap) oganised in a simplistic monorepo. +Find here a collection of samples for the [SAP Cloud Application Programming Model](https://cap.cloud.sap) oganised in a simplistic [monorepo setup](samples.md#all-in-one-monorepo). → See [**Overview** of contained samples](samples.md) + ## Preliminaries -- [Install @sap/cds-dk](https://cap.cloud.sap/docs/get-started/) as documented in [capire](https://cap.cloud.sap) +1. [Install @sap/cds-dk](https://cap.cloud.sap/docs/get-started/) as documented in [capire](https://cap.cloud.sap) +2. _Optional:_ [Use Visual Studio Code](https://cap.cloud.sap/docs/get-started/in-vscode) ## Download diff --git a/events/package.json b/reviewed/package.json similarity index 100% rename from events/package.json rename to reviewed/package.json diff --git a/events/services.cds b/reviewed/services.cds similarity index 100% rename from events/services.cds rename to reviewed/services.cds diff --git a/events/services.js b/reviewed/services.js similarity index 100% rename from events/services.js rename to reviewed/services.js diff --git a/events/tests.http b/reviewed/tests.http similarity index 100% rename from events/tests.http rename to reviewed/tests.http diff --git a/samples.md b/samples.md new file mode 100644 index 00000000..7bd1ee81 --- /dev/null +++ b/samples.md @@ -0,0 +1,73 @@ +# Overview of Samples + +The list below gives an overview of the samples provided in subdirectories. +Each sub directory essentially is a individual npm package arranged in an [all-in-one monorepo](all-in-one-monorepo) umbrella setup. + + +## [hello](hello) + +- A simplistic [Hello World](https://cap.cloud.sap/docs/get-started/hello-world) service using [CDS](https://cap.cloud.sap/docs/cds/) and [cds.services](https://cap.cloud.sap/docs/node.js/api#services-api). + + +## [bookshop](bookshop) + +- [Getting Started](https://cap.cloud.sap/docs/get-started/in-a-nutshell) with CAP, briefly introducing: +- [Project Setup](https://cap.cloud.sap/docs/get-started/) and [Layouts](https://cap.cloud.sap/docs/get-started/projects) +- [Domain Modelling](https://cap.cloud.sap/docs/guides/domain-models) +- [Defining Services](https://cap.cloud.sap/docs/guides/providing-services) +- [Generic Providers](https://cap.cloud.sap/docs/guides/generic-providers) +- [Adding Custom Logic](https://cap.cloud.sap/docs/guides/service-impl) +- [Using Databases](https://cap.cloud.sap/docs/guides/databases) + + +## [common](common) + +- Showcases how to extend [@sap/cds/common](https://cap.cloud.sap/docs/cds/common) thereby covering... +- Building [extension packages](https://cap.cloud.sap/docs/guides/domain-models#aspects-extensibility) +- Providing [reuse packages](https://cap.cloud.sap/docs/get-started/projects#sharing-and-reusing-content) +- [Verticalization](https://cap.cloud.sap/docs/cds/common#adapting-to-your-needs) +- Using [Aspects](https://cap.cloud.sap/docs/cds/cdl#aspects) +- Used in the [fiori app sample](#fiori) + + +## [orders](orders) + +- Adds orders to the [bookshop](#bookshop), thereby demonstrating... +- Using [Compositions](https://cap.cloud.sap/docs/cds/cdl#compositions) in [Domain Models](https://cap.cloud.sap/docs/guides/domain-models), along with +- [Serving deeply nested documents](https://cap.cloud.sap/docs/guides/generic-providers#serving-structured-data) + + +## [reviews](reviews) + +- Shows how to implement a modular service to manage product reviews, including... +- Serving requests synchronously +- Emitting events asynchronously +- As well as managed data, input validations and authorization + + +## [reviewed](reviewed) + +- Enhances [bookshop](#bookshop) with [reviews](#reviews), thereby showcasing... +- Consuming other services synchronously +- As well as asynchronously, subscribing to events +- Grow as you go, with... +- Mocking app services +- Running service meshes +- Late-cut Micro Services + + +## [fiori](fiori) + +- [Adds a Fiori elements application](https://cap.cloud.sap/docs/guides/fiori/), introducing to... +- [OData Annotations](https://cap.cloud.sap/docs/guides/fiori#adding-odata-annotations) in `.cds` files +- Support for [Fiori Draft](https://cap.cloud.sap/docs/guides/fiori#draft) +- Support for [Value Helps](https://cap.cloud.sap/docs/guides/fiori#value-help) +- Serving Fiori apps locally +- Combining most of the other samples through [package reuse](https://cap.cloud.sap/docs/get-started/projects#sharing-and-reusing-content) + + +
+ +# All-in-one Monorepo + +Each sample sub directory essentially is a standard npm package, some with standard npm dependencies to other samples. The root folder's [package.json](package.json) has local links to the sub folders, such that an `npm install` populates a local `node_modules` folder acts like a local npm registry to the individual sample packages.