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

Add the readme for sample app codes, and update the code-sample page #6059

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions code-samples/eventing/bookstore-sample-app/README.md
Original file line number Diff line number Diff line change
@@ -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!
45 changes: 45 additions & 0 deletions code-samples/eventing/bookstore-sample-app/solution/README.md
Original file line number Diff line number Diff line change
@@ -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.
26 changes: 26 additions & 0 deletions code-samples/eventing/bookstore-sample-app/start/README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 4 additions & 0 deletions docs/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: maybe we can indicate that this uses serving and eventing and functions? The other items in this list mention serving/eventing so it can be a little confusing to figure out which is used from just the text here


!!! 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

Expand Down
Loading