Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shared-db #1717

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft

shared-db #1717

wants to merge 31 commits into from

Conversation

DanSchlachter
Copy link
Contributor

No description provided.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting Errors

  • guides/deployment/shared-db.md:86 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:186 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:255 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:415 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:423 Fenced code blocks should have a language specified

Spelling Mistakes

  • guides/deployment/shared-db.md:13:28 Unknown word "microserivces"
  • guides/deployment/shared-db.md:38:40 Unknown word "Clound"
  • guides/deployment/shared-db.md:56:30 Unknown word "esample"
  • guides/deployment/shared-db.md:247:3 Unknown word "Authentification"
  • guides/deployment/shared-db.md:287:43 Unknown word "asynchronious"
  • guides/deployment/shared-db.md:384:4 Unknown word "authentification"
  • guides/deployment/shared-db.md:398:29 Unknown word "earch"
  • guides/deployment/shared-db.md:439:23 Unknown word "authentification"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


- add dependency @cap-js/hana:

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
npm i @cap-js/hana --workspace bookstore
npm i @cap-js/hana --workspace orders
npm i @cap-js/hana --workspace reviews
```

Please add a language tag. For plain text add txt as language tag.

## static content
The approuter can serve also static content (html files). If you want to deploy your WebUIs located in workspaces as static content, you can use Linux sym-links to link the UI-directories in the app-router folder.

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
cd app-router
ln -s ../bookshop/app/vue bookshop
ln -s ../orders/app/orders orders
ln -s ../reviews/app/vue reviews
cd ..
```

Please add a language tag. For plain text add txt as language tag.


- CAP service package.json dependency: @sap/xssec

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
npm i @sap/xssec --workspace bookstore
npm i @sap/xssec --workspace orders
npm i @sap/xssec --workspace reviews
```

Please add a language tag. For plain text add txt as language tag.


- (fix) change from *npm-ci* to *npm* builder

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
builder: npm
```

Please add a language tag. For plain text add txt as language tag.


- reviews/db/data/sap.capire.reviews-Reviews.csv

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
ID;subject;...
1689144d-3b10-4849-bcbe-2408a13e161d;201....
...
```

Please add a language tag. For plain text add txt as language tag.

}
```

# Authentification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Authentification
# Authentication

Or maybe one of these: Authentications?


# Messaging

The messaging service is used to organize asynchronious communication between the CAP services.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The messaging service is used to organize asynchronious communication between the CAP services.
The messaging service is used to organize asynchronous communication between the CAP services.

Or maybe one of these: asynchronies, asynchronisms, synchronous, asynchronism?

```
# Misc

## authentification depends on messaging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## authentification depends on messaging
## authentication depends on messaging

Or maybe one of these: authentications?


File: mta.yaml

- Duplicate samples-srv for earch CAP service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Duplicate samples-srv for earch CAP service
- Duplicate samples-srv for each CAP service

Or maybe one of these: erch, earth, esrch, eparch?

cds_requires_OrdersService_credentials: {"destination": "orders-dest","path": "/odata/v4/orders"}
```

## approuter requires authentification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## approuter requires authentification
## approuter requires authentication

Or maybe one of these: authentications?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting Errors

  • guides/deployment/shared-db.md:90 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:190 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:259 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:419 Fenced code blocks should have a language specified
  • guides/deployment/shared-db.md:427 Fenced code blocks should have a language specified

Spelling Mistakes

  • guides/deployment/shared-db.md:42:40 Unknown word "Clound"
  • guides/deployment/shared-db.md:60:30 Unknown word "esample"
  • guides/deployment/shared-db.md:251:3 Unknown word "Authentification"
  • guides/deployment/shared-db.md:291:43 Unknown word "asynchronious"
  • guides/deployment/shared-db.md:388:4 Unknown word "authentification"
  • guides/deployment/shared-db.md:402:29 Unknown word "earch"
  • guides/deployment/shared-db.md:443:23 Unknown word "authentification"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


- add dependency @cap-js/hana:

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
npm i @cap-js/hana --workspace bookstore
npm i @cap-js/hana --workspace orders
npm i @cap-js/hana --workspace reviews
```

Please add a language tag. For plain text add txt as language tag.

## static content
The approuter can serve also static content (html files). If you want to deploy your WebUIs located in workspaces as static content, you can use Linux sym-links to link the UI-directories in the app-router folder.

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
cd app-router
ln -s ../bookshop/app/vue bookshop
ln -s ../orders/app/orders orders
ln -s ../reviews/app/vue reviews
cd ..
```

Please add a language tag. For plain text add txt as language tag.


- CAP service package.json dependency: @sap/xssec

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
npm i @sap/xssec --workspace bookstore
npm i @sap/xssec --workspace orders
npm i @sap/xssec --workspace reviews
```

Please add a language tag. For plain text add txt as language tag.


- (fix) change from *npm-ci* to *npm* builder

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
builder: npm
```

Please add a language tag. For plain text add txt as language tag.


- reviews/db/data/sap.capire.reviews-Reviews.csv

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
ID;subject;...
1689144d-3b10-4849-bcbe-2408a13e161d;201....
...
```

Please add a language tag. For plain text add txt as language tag.

}
```

# Authentification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Authentification
# Authentication

Or maybe one of these: Authentications?


# Messaging

The messaging service is used to organize asynchronious communication between the CAP services.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The messaging service is used to organize asynchronious communication between the CAP services.
The messaging service is used to organize asynchronous communication between the CAP services.

Or maybe one of these: asynchronies, asynchronisms, synchronous, asynchronism?

```
# Misc

## authentification depends on messaging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## authentification depends on messaging
## authentication depends on messaging

Or maybe one of these: authentications?


File: mta.yaml

- Duplicate samples-srv for earch CAP service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Duplicate samples-srv for earch CAP service
- Duplicate samples-srv for each CAP service

Or maybe one of these: erch, earth, esrch, eparch?

cds_requires_OrdersService_credentials: {"destination": "orders-dest","path": "/odata/v4/orders"}
```

## approuter requires authentification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## approuter requires authentification
## approuter requires authentication

Or maybe one of these: authentications?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting Errors

  • guides/deployment/shared-db.md:271 Fenced code blocks should have a language specified

Spelling Mistakes

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


- CAP service package.json dependency: @sap/xssec

```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```txt
npm i @sap/xssec --workspace bookstore
npm i @sap/xssec --workspace orders
npm i @sap/xssec --workspace reviews
```

Please add a language tag. For plain text add txt as language tag.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • guides/deployment/shared-db.md:42:257 Unknown word "Addinital"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


## MTA

In order to deploy CAP services in the Cloud Foundry environment as a Multitarget application a mta.yaml file is required. It represents a deployment discriptor which defines all CAP services and resources required by the application to function properly. Addinital information can be found in the [Deploy to Cloud* guide](../deployment/). An initial *mta.yaml* file can be generated using the following command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In order to deploy CAP services in the Cloud Foundry environment as a Multitarget application a mta.yaml file is required. It represents a deployment discriptor which defines all CAP services and resources required by the application to function properly. Addinital information can be found in the [Deploy to Cloud* guide](../deployment/). An initial *mta.yaml* file can be generated using the following command:
In order to deploy CAP services in the Cloud Foundry environment as a Multitarget application a mta.yaml file is required. It represents a deployment discriptor which defines all CAP services and resources required by the application to function properly. Digital information can be found in the [Deploy to Cloud* guide](../deployment/). An initial *mta.yaml* file can be generated using the following command:

Or maybe one of these: Addingham, addington, Addington, Additional?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • guides/deployment/late-cut-microservices.md:55:5 Unknown word "Modulith"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


![](./assets/microservices/modules.excalidraw.svg)

### Modulith
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Modulith
### Moduli

Or maybe one of these: Modality, Modulate, Moduli's, Monolith?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • guides/deployment/shared-db.md:17:28 Unknown word "microserivces"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.

Disadvantages:
- Accessing data directly (without an API) means any changes in the data model affect all applications directly
- every change in one of the services either requires
- a redeployment of all microserivces involved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a redeployment of all microserivces involved
- a redeployment of all microservices involved

Or maybe one of these: microservice, microdrives?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • guides/deployment/late-cut-microservices.md:7:29 Unknown word "moduliths"
  • guides/deployment/late-cut-microservices.md:64:5 Unknown word "Modulith"
  • guides/deployment/shared-db.md:27:28 Unknown word "microserivces"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.

- Deployment
- Late Cut Microservices
synopsis: >
An overview on monoliths, moduliths and microservices - breaking down their aspects, benefits and drawbacks.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An overview on monoliths, moduliths and microservices - breaking down their aspects, benefits and drawbacks.
An overview on monoliths, moduli's and microservices - breaking down their aspects, benefits and drawbacks.

Or maybe one of these: modulates, monoliths, moduli, moults?


![](./assets/microservices/modules.excalidraw.svg)

### Modulith
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Modulith
### Moduli

Or maybe one of these: Modality, Modulate, Moduli's, Monolith?

Disadvantages:
- Accessing data directly (without an API) means any changes in the data model affect all applications directly
- every change in one of the services either requires
- a redeployment of all microserivces involved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- a redeployment of all microserivces involved
- a redeployment of all microservices involved

Or maybe one of these: microservice, microdrives?

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling Mistakes

  • guides/deployment/shared-db.md:165:29 Unknown word "shoud"
  • guides/deployment/shared-db.md:671:36 Unknown word "funtionality"

Generally, for each spelling mistake there are 2 ways to fix it:

  1. Fix the spelling mistake and commit it.
  2. The word is incorrectly reported as misspelled → put the word on the project-words.txt list, located in the root project directory.


#### prepare shared-db CDS model

Add list of CDS models that shoud be considered for deployment:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add list of CDS models that shoud be considered for deployment:
Add list of CDS models that shod be considered for deployment:

Or maybe one of these: shoed, shout, should, shroud?


There should be a possibility to directly create entity instances (Orders) via API.

Add projection bypassing the draft funtionality enabled only for the system-user:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Add projection bypassing the draft funtionality enabled only for the system-user:
Add projection bypassing the draft functionality enabled only for the system-user:

Or maybe one of these: functionally, functionalism, functionalist, functionalists?

Comment on lines +60 to +62
1. install dependencies, for example: `npm ci`
2. assemble CDS model containing all artifacts for all CAP services, for example: `npx cds build (directory with db artifacts) --for hana --production`.
3. prepare CAP services, for example: `npx cds build (SAP service directory) --for nodejs --production --ws-pack` where the *--ws-pack* option is important for node modules referencing other repository-local node modules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unclear if instructions or just explanations

#### add a npm start script for each CAP service

::: code-group
```json [(service)/package.json]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarify (service) and add short explanation

Add initial database configuration using the command:

```shell
cds add hana --production ???
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??? ?


#### add dependency @cap-js/hana

```shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add line above that this should be executed

Prepare the *shared-db* folder - a node module referencing all relevant CDS models from all relevant workspaces required to generate the HDI artifacts for all CAP services:

```shell
mkdir -p shared-db/db && cd shared-db && npm init -y && cd ..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm init -y creates a bunch of fields which should not be there, particularly the license field. The license is defined in the root folder of the monorepo

```javascript [bookstore/srv/mashup.js]
CatalogService.on ('OrderedBook', async (msg) => {
......
return OrdersService.create ('OrdersNoDraft').entries({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unclear -> add what to remove, what to add

- npx cds build ./orders --for nodejs --production --ws-pack # [!code ++]
- npx cds build ./reviews --for nodejs --production # [!code ++]
- npx cds build ./bookstore --for nodejs --production --ws-pack # [!code ++]
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- npx cds build --production is still leftover after these changes.....

Comment on lines +649 to +650
requires: # [!code ++]
- name: samples-auth # [!code ++]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already exists...

```
:::

#### static content route
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after all app-router changes, there is still something missing, seems to be the ^/appconfig/

- npx cds build ./orders --for nodejs --production --ws-pack # [!code ++]
- npx cds build ./reviews --for nodejs --production # [!code ++]
- npx cds build ./bookstore --for nodejs --production --ws-pack # [!code ++]
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> steps on how to deploy and view the deployed app...

npm run build
npm run deploy

cf apps -> go to url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants