Skip to content

Commit

Permalink
add: finishing polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo6Leo committed Jun 7, 2024
1 parent 19e48a9 commit 89482b8
Show file tree
Hide file tree
Showing 19 changed files with 643 additions and 225 deletions.
47 changes: 47 additions & 0 deletions docs/bookstore/create-slack-workspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# **Creating a Slack Workspace**

![Image](images/image5.png)

To create a Slack workspace, follow these steps:

1. Visit [https://slack.com/get-started#/createnew](https://slack.com/get-started#/createnew).
2. Enter your email address and click Continue, or continue with Apple or Google.
3. Check your email for a confirmation code.
4. Enter the code on the Slack website.
5. Click "Create a Workspace" and follow the prompts.
6. For detailed instructions for androids and , refer to [Create a workspace](https://slack.com/help/articles/206845317-Create-a-Slack-workspace).

## **Adding Channels to Your Workspace**

After creating your Slack workspace, you can add channels by following these steps:

1. Click the '+' icon next to 'Channels' on the sidebar of your Slack workspace.
2. Choose "Create a channel" and specify the channel name and purpose.
3. For enterprise grid organizations, refer to [Slack's help article](https://slack.com/help/articles/115001399587-Add-a-channel-to-multiple-workspaces-in-your-Enterprise-Grid-organization) for instructions.

## **Setting Up a Webhook for Notifications**

To set up a webhook for sending notifications to your Slack workspace:

- 1: Create a [Slack app](https://api.slack.com/apps/new), following the instructions by signing in, adding name and workspace to put the app in.

- 2: After this, you'll be redirected to the setting pages of your new app. Choose Incoming Webhook and toggle Activate Webhook.

- 3: Scroll down to click the option Add New Webhook to Workspace.

![Image](images/image3.png)

- 4: The page will give you a link associated with the app you created. This link will be where API requests are sent to send messages to your Slack workspace.

![Image](images/image2.png)

- 5: To test if the webhook works as needed, you can try sending an API request to this link to see if the message goes through. I used Postman to test this. Remember that this is an application/json file.

![Image](images/image4.png)

- 6: Afterwards, the text channel should have a new message

![Image](images/image1.png)

- 7: Go to [Slack's webhook documentation](https://api.slack.com/messaging/webhooks) to learn more about setting up webhooks.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/bookstore/disclaimer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Hello dear Knative Learners,

Before you begin this tutorial, please take note of the following disclaimer. In the spirit of open source, we strive for transparency. This tutorial incorporates many other open source projects, and we are grateful to all the incredible contributors. Your amazing work has made this tutorial possible.
Before you begin this tutorial, **please take note of the following disclaimer**. In the spirit of open source, we strive for transparency. This tutorial incorporates many other open source projects, and we are grateful to all the incredible contributors. Your amazing work has made this tutorial possible.

If you’re interested in getting started with open source, check out our guide: Get Started with Open Source at Knative.

Expand Down Expand Up @@ -55,4 +55,4 @@ By using this tutorial, you acknowledge that:

![image](images/image1.png)

If you have any questions or concerns regarding this disclaimer or the tutorial, please feel free to reach out to the Knative community via the Cloud Native Computing Foundation (CNCF) Slack, particularly the #knative channel.
If you have any questions or concerns regarding this disclaimer or the tutorial, please feel free to reach out to the Knative community via the Cloud Native Computing Foundation (CNCF) Slack, particularly the [#knative](https://cloud-native.slack.com/archives/C04LGHDR9K7){:target="_blank"} channel.
51 changes: 25 additions & 26 deletions docs/bookstore/extra-challenge/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# **Extra Challenges**

![image](images/image5.png)
Expand All @@ -7,125 +6,125 @@ Congratulations on completing the bookstore tutorial! Kubernetes and Knative hav

Now it's time to test your mastery of the skills you've learned with Kuack. We've prepared a few extra challenges for you to explore. Take a look and have fun!

### **Challenge 1: Implement Comment Deletion**
## **Challenge 1: Implement Comment Deletion**

![image](images/image1.png)

#### **Description**
**Description**

Add functionality to delete comments from the database using an event-driven approach.

#### **Objective**
**Objective**

Allow users to delete the selected comment.

#### **Steps**
**Steps**

1. Create a new event type for comment deletion.
2. Set up a trigger to listen for deletion events.
3. Implement a function in the node-server to handle the deletion and update the database.

#### **What You Will Learn:**
**What You Will Learn:**

- Creating and handling new event types.
- Setting up triggers for specific events.
- Performing database operations based on events.

#### **Estimated Time**
**Estimated Time**

1-2 hours

### **Challenge 2: Submit Comments via Telegram**
## **Challenge 2: Submit Comments via Telegram**

![image](images/image3.png)

#### **Description**
**Description**

Enable users to submit new comments through a Telegram bot using Apache Camel.

#### **Objective**
**Objective**

Allow users to send comments via Telegram.

#### **Steps**
**Steps**

1. Create a Telegram bot and obtain the bot token.
2. Set up an [Apache Camel Telegram source](https://camel.apache.org/camel-kamelets/4.4.x/telegram-source.html) to listen for messages from the Telegram bot.
3. Create a new event type for comments received via Telegram.
4. Set up a trigger to process these events and route them to the comment handling service.
5. Implement a function in the node-server to handle the new comments and update the database.

#### **What You Will Learn**
**What You Will Learn**

- Creating and configuring a Telegram bot.
- Using Apache Camel to integrate Telegram as an event source with your application.
- Handling new event types and processing user input from external sources.

#### **Estimated Time**
**Estimated Time**

2-3 hours

### **Challenge 3: Format the Output for the Sink**
## **Challenge 3: Format the Output for the Sink**

![image](images/image4.png)

#### **Description**
**Description**

Learn how to create an event consumer app that formats event data before sending it to a sink.

#### **Objective**
**Objective**

Transform event data and send it to the appropriate sink.

#### **Steps**
**Steps**

1. Create a new function in node-server to consume and transform events.
2. Set up a trigger to route events (Event X - unformatted) to this transformation service.
3. Implement the transformation logic to convert Event X into Event Y - formatted.
4. Configure the service to send the transformed event (Event Y) to the Slack sink.
5. Ensure the function replies with the transformed event.

#### **What You Will Learn**
**What You Will Learn**

- Creating an event consumer app.
- Adding a new step in a sequence to process events.
- Transforming events within a service and routing the transformed events to a sink.
- Using triggers and functions with replies in an event-driven architecture.

#### **Estimated Time**
**Estimated Time**

1-2 hours

### **Challenge 4: Integrate with Another Notification Service as Sink (Telegram)**
## **Challenge 4: Integrate with Another Notification Service as Sink (Telegram)**

![image](images/image6.png)

#### **Description**
**Description**

Add Telegram notifications for new comments using Apache Camel.

#### **Objective**
**Objective**

Send Telegram notifications for new comments.

#### **Steps**
**Steps**

1. Create a new event type or filter attribute for Telegram notifications.
2. Set up a trigger to route these events to a Camel-K integration service.
3. Use Apache Camel to send messages to a Telegram chat by setting up the telegram-sink.

#### **What You Will Learn**
**What You Will Learn**

- Integrating with external notification services using Apache Camel.
- Using triggers to route specific events.
- Working with the Telegram API.

#### **Estimated Time**
**Estimated Time**

0.5-1 hours

## **Help**

![image](images/image2.png)

Join the supportive Knative community via the Cloud Native Computing Foundation (CNCF) Slack, particularly the #knative channel. Before posting your questions, please search to see if they've already been answered. Your feedback on this tutorial is invaluable, so don't hesitate to reach out with suggestions or questions.
Join the supportive Knative community via the Cloud Native Computing Foundation (CNCF) Slack, particularly the [#knative](https://cloud-native.slack.com/archives/C04LGHDR9K7){:target="_blank"} channel. Before posting your questions, please search to see if they've already been answered. Your feedback on this tutorial is invaluable, so don't hesitate to reach out with suggestions or questions.
19 changes: 10 additions & 9 deletions docs/bookstore/page-0.5/pg0.5-env-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Running `docs/code-samples/eventing/bookstore-sample-app/start/setup.sh` will au

## **Instructions**

### Task 1: Set Up a Running Kubernetes Cluster with Knative Installed
### **Task 1: Set Up a Running Kubernetes Cluster with Knative Installed**

![Image](images/image13.png)

Expand All @@ -60,7 +60,7 @@ Please follow the instructions here [https://knative.dev/docs/install/](https://

![Image](images/image2.png)

#### Extra Step for Minikube Users:
#### **Extra Step for Minikube Users:**

![Image](images/image3.png)

Expand All @@ -72,17 +72,18 @@ Run the following command and keep the terminal open:
minikube tunnel
```

If there aren't any error messages, it means you have set up the tunnel successfully.
???+ success "Verify"
If there aren't any error messages, it means you have set up the tunnel successfully.

### Task 2: Running the Bookstore Web App
### **Task 2: Running the Bookstore Web App**

![Image](images/image12.png)

The Next.js frontend app is located in the `docs/code-samples/eventing/bookstore-sample-app/start/frontend` folder.

Ensure that port 3000 on your local machine is not being used by another application.

#### Deploy the Frontend App
#### **Deploy the Frontend App**

You can either [build the image locally](https://docs.docker.com/get-started/02_our_app/) or use our pre-built image. If you are using the pre-built image, you can proceed to the next step.

Expand All @@ -104,7 +105,7 @@ You will see that your front end pod is running.

![Image](images/image4.png)

#### Port Forwarding (Optional under condition)
#### **Port Forwarding (Optional under condition)**

![Image](images/image9.png)

Expand Down Expand Up @@ -140,15 +141,15 @@ Don’t close the terminal when port-forwarding is established.



### Task 3: Running the Book Review Service
### **Task 3: Running the Book Review Service**

![Image](images/image6.png)

The Node.js server is located in the `docs/code-samples/eventing/bookstore-sample-app/start/node-server` folder.

Ensure that port 8080 on your local machine is not being used by another application.

#### Deploy the Book Review Service: Node.js Server
#### **Deploy the Book Review Service: Node.js Server**

You can either [build the image locally](https://docs.docker.com/get-started/02_our_app/) or use our pre-built image. If you are using the pre-built image, you can proceed to the next step.

Expand All @@ -170,7 +171,7 @@ You will see that your node-server pod is running.

![Image](images/image14.png)

#### Port Forwarding (Optional under condition)
#### **Port Forwarding (Optional under condition)**

![Image](images/image9.png)

Expand Down
4 changes: 2 additions & 2 deletions docs/bookstore/page-0/page-0-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ Join the supportive Knative community via the Cloud Native Computing Foundation

Clone the repo first
```sh
git clone git@github.com:knative/docs.git
git clone https://github.com/knative/docs.git
```



!!! warning

**IMPORTANT**: Please take some time to read the [Disclaimer](https://docs.google.com/document/d/125Wok7L5lzf1XnsM5HIM8SuZ1ty2NCbddKrEtM_Xebs/edit?usp=sharing) before moving to the next page.
**IMPORTANT**: Please take some time to read the [Disclaimer](../disclaimer/README.md){:target="_blank"} before moving to the next page.

![Environment Setup](images/13.png)

Expand Down
Loading

0 comments on commit 89482b8

Please sign in to comment.