From 6be0453210dbb0f4fd2438fba64df273fcedd124 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Fri, 19 Jul 2024 12:44:01 -0400 Subject: [PATCH] Add the readme for sample app codes, and update the code-sample page (#6059) * feat: add the readme for sample app codes, and modify the code-sample page to include bookstore app * fix: fix the wrong link * fix: add a note box to mention all 3 parts of knative are being convered in bookstore tutorial --- .../eventing/bookstore-sample-app/README.md | 38 ++++++++++++++++ .../bookstore-sample-app/solution/README.md | 45 +++++++++++++++++++ .../bookstore-sample-app/start/README.md | 26 +++++++++++ docs/samples/README.md | 4 ++ 4 files changed, 113 insertions(+) create mode 100644 code-samples/eventing/bookstore-sample-app/README.md create mode 100644 code-samples/eventing/bookstore-sample-app/solution/README.md create mode 100644 code-samples/eventing/bookstore-sample-app/start/README.md diff --git a/code-samples/eventing/bookstore-sample-app/README.md b/code-samples/eventing/bookstore-sample-app/README.md new file mode 100644 index 00000000000..21a4b18b0ed --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/README.md @@ -0,0 +1,38 @@ +# Knative Bookstore Code Samples + +This folder contains code samples for the Knative Bookstore tutorial, an end-to-end sample application demonstrating Knative's capabilities in building an event-driven architecture. + +## Tutorial + +For a comprehensive guide on building this application and learning about Knative, please visit the [Knative Bookstore Tutorial](https://knative.dev/bookstore/page-0/welcome-knative-bookstore-tutorial/). + +This tutorial covers: +- Setting up your environment +- Implementing event-driven architecture with Knative +- Deploying and connecting various microservices +- Integrating machine learning models +- Connecting to external services like Slack + +Whether you're new to Knative or looking to deepen your understanding, this tutorial provides valuable insights into building scalable, event-driven applications. + +## Contents + +The files are organized into two main folders: + +1. **/start**: Contains the initial code structure and base files to begin the tutorial. + +2. **/solution**: Includes the complete, fully implemented version of the Knative Bookstore application. + +For more details on the directory structure and contents of each folder, please refer to their respective README files: + +- [Start README](start/README.md) +- [Solution README](solution/README.md) + +## Getting Started + +1. Clone this repository +2. Navigate to the `/start` directory to begin the tutorial +3. Follow the Knative Bookstore Tutorial for step-by-step instructions +4. Refer to the `/solution` directory if you need to check the final implementation + +Happy coding! \ No newline at end of file diff --git a/code-samples/eventing/bookstore-sample-app/solution/README.md b/code-samples/eventing/bookstore-sample-app/solution/README.md new file mode 100644 index 00000000000..a156417957a --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/solution/README.md @@ -0,0 +1,45 @@ + +# Knative Bookstore Tutorial - Solution Directory + +Welcome to the solution directory of the Knative Bookstore tutorial. This directory contains the fully implemented version of the event-driven bookstore application using Knative. + +You can find the tutorial for this solution [here](https://knative.dev/bookstore/page-0/welcome-knative-bookstore-tutorial/). + +## Directory Structure + +Here's an overview of the components in the solution: + +- `bad-word-filter/`: Knative Function for filtering out inappropriate content +- `db-service/`: Database service for storing book reviews and comments +- `frontend/`: User interface for the bookstore application built with Next.js +- `node-server/`: Node.js server for handling backend operations +- `sentiment-analysis-app/`: Knative Function for analyzing the sentiment of book reviews +- `sequence/`: Knative Sequence setup for orchestrating workflows +- `slack-sink/`: Integration with Slack for notifications with Apache Camel + +## Additional Files + +- `setup.sh`: Script for setting up the required services including installing Knative, frontend, and backend node-server +- `solution.sh`: Script for installing everything, deploying the entire solution. **It includes the setup script as well.** + +## Running the Solution + +1. Have a running Kubernetes cluster. +2. Install all the prerequisites and deploy the entire solution using the `solution.sh` script: + ``` + ./solution.sh + ``` +If you encountered any permission issues, run the following command: + ``` + chmod +x solution.sh + ``` + +## Next Steps + +- Explore each component to understand how they work together in an event-driven architecture. +- Compare this solution with your own implementation if you've completed the tutorial. +- Experiment with modifying or extending the solution to add new features. + +## Need Help? + +If you encounter any issues or have questions about the solution, refer to the main tutorial documentation or reach out to the Knative community for support. \ No newline at end of file diff --git a/code-samples/eventing/bookstore-sample-app/start/README.md b/code-samples/eventing/bookstore-sample-app/start/README.md new file mode 100644 index 00000000000..70f8107d4b2 --- /dev/null +++ b/code-samples/eventing/bookstore-sample-app/start/README.md @@ -0,0 +1,26 @@ +# Knative Bookstore Tutorial - Start Directory + +Welcome to the starting point of the Knative Bookstore tutorial. This directory contains the initial setup and base files for building your event-driven bookstore application using Knative. + +## Directory Structure + +Here's an overview of the components you'll be working with: + +- `db-service/`: Database service for storing book reviews and comments +- `frontend/`: User interface for the bookstore application built with Next.js +- `node-server/`: Node.js server for handling backend operations +- `sequence/`: Knative Sequence setup for orchestrating workflows +- `slack-sink/`: Integration with Slack for notifications with Apache Camel +- `setup.sh`: Script for setting up the required services including installing Knative, frontend, and backend node-server +## Getting Started + +1. Familiarize yourself with the directory structure above. +2. Each subdirectory contains starter code and placeholders for the services you'll be building. +3. Follow the [Knative Bookstore Tutorial](https://knative.dev/bookstore/page-0/welcome-knative-bookstore-tutorial/) for step-by-step instructions on how to implement each component. +4. As you progress through the tutorial, you'll be adding code and configurations to these directories. + +Remember, this is just the starting point. By the end of the tutorial, you'll have a fully functional event-driven bookstore application. + +## Need Help? + +If you encounter any issues or have questions, refer to the main tutorial documentation or reach out to the Knative community for support. \ No newline at end of file diff --git a/docs/samples/README.md b/docs/samples/README.md index 74f8c96dc31..cf5a4540274 100755 --- a/docs/samples/README.md +++ b/docs/samples/README.md @@ -9,6 +9,10 @@ Knative code samples that are actively tested and maintained by Knative working - [Eventing and Eventing Sources code samples](eventing.md) - [Serving code samples](serving.md) +- [E2E Sample Application - Knative Bookstore](https://github.com/knative/docs/tree/main/code-samples/eventing/bookstore-sample-app) + +!!! tip + E2E Sample Application - Knative Bookstore is a sample application that demonstrates how to use all part of Knative: **Eventing, Serving, and Function**, to build a simple bookstore application. ## Community owned samples