Skip to content

Commit 521d686

Browse files
RDoc-3729 Add Samples to documentation
1 parent 5284735 commit 521d686

56 files changed

Lines changed: 4065 additions & 107 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docusaurus.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,15 @@ const config: Config = {
108108
showLastUpdateTime: true,
109109
},
110110
],
111+
[
112+
"content-docs",
113+
{
114+
id: "samples",
115+
path: "samples",
116+
routeBasePath: "samples",
117+
sidebarPath: require.resolve("./sidebarsSamples.js"),
118+
},
119+
],
111120
[
112121
"@docusaurus/plugin-ideal-image",
113122
{
@@ -119,6 +128,7 @@ const config: Config = {
119128
},
120129
],
121130
require.resolve("./src/plugins/recent-guides-plugin"),
131+
require.resolve("./src/plugins/recent-samples-plugin"),
122132
],
123133
headTags: [
124134
{

package-lock.json

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@
3030
"@mdx-js/react": "^3.0.0",
3131
"autoprefixer": "^10.4.21",
3232
"clsx": "^2.1.1",
33+
"framer-motion": "^12.38.0",
3334
"prettier": "^3.6.2",
3435
"prism-react-renderer": "^2.3.0",
3536
"react": "^19.0.0",
3637
"react-dom": "^19.0.0",
38+
"react-github-btn": "^1.4.0",
3739
"yet-another-react-lightbox": "^3.24.0"
3840
},
3941
"devDependencies": {

samples/home.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Samples
3+
hide_title: true
4+
slug: /
5+
pagination_next: null
6+
pagination_prev: null
7+
wrapperClassName: samples-home-page
8+
hide_table_of_contents: true
9+
---
10+
11+
import { SamplesHomePage } from "@site/src/components/Samples";
12+
13+
<SamplesHomePage />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cloud-tax:
2+
label: "Cloud Tax"
3+
gen-ai-data-enrichment:
4+
label: "Gen AI Data Enrichment"
5+
integration-patterns:
6+
label: "Integration Patterns"
7+
semantic-search:
8+
label: "Semantic Search"

samples/tags/feature.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
vector-search:
2+
label: "Vector Search"
3+
document-refresh:
4+
label: "Document Refresh"
5+
include:
6+
label: "Include"
7+
azure-storage-queues-etl:
8+
label: "Azure Storage Queues ETL"
9+
ai-agents:
10+
label: "AI Agents"
11+
full-text-search:
12+
label: "Full-Text Search"

samples/tags/tech-stack.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
csharp:
2+
label: "C#"
3+
nodejs:
4+
label: "Node.js"
5+
python:
6+
label: "Python"
7+
java:
8+
label: "Java"
9+
php:
10+
label: "PHP"
11+
aspire:
12+
label: "Aspire"
13+
azure-storage-queues:
14+
label: "Azure Storage Queues"
15+
azure-functions:
16+
label: "Azure Functions"

samples/the-ravens-library.mdx

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
title: "The Library of Ravens"
3+
description: "A simple library management application. Built with RavenDB, Aspire, Azure Storage Queues, and Azure Functions. "
4+
challengesSolutionsTags: [cloud-tax, gen-ai-data-enrichment, integration-patterns, semantic-search]
5+
featureTags: [azure-storage-queues-etl, document-refresh, include, vector-search]
6+
techStackTags: [csharp, aspire, azure-storage-queues, azure-functions]
7+
category: "Ecommerce"
8+
license: "MIT License"
9+
image: "/img/samples/library-of-ravens/cover.webp"
10+
gallery:
11+
- src: "/img/samples/library-of-ravens/01.webp"
12+
alt: "The Library of Ravens - Main Interface"
13+
- src: "/img/samples/library-of-ravens/02.webp"
14+
alt: "The Library of Ravens - Author Profile"
15+
---
16+
17+
import { ActionsCard, RelatedResource, FeatureAccordion, SampleMetadataColumn, SampleLayout } from '@site/src/components/Samples';
18+
import Gallery from '@site/src/components/Common/Gallery';
19+
20+
export const sampleDetails = (
21+
<SampleMetadataColumn
22+
actionsCard={
23+
<ActionsCard
24+
githubUser="ravendb"
25+
githubRepo="samples-library"
26+
demoUrl="https://demo.ravendb.net"
27+
/>
28+
}
29+
relatedResources={
30+
<>
31+
<RelatedResource
32+
type="documentation"
33+
documentationType="docs"
34+
subtitle="Vector Search Overview"
35+
articleKey="ai-integration/vector-search/overview"
36+
/>
37+
<RelatedResource
38+
type="documentation"
39+
documentationType="docs"
40+
subtitle="Azure Storage Queues ETL"
41+
articleKey="server/ongoing-tasks/etl/queue-etl/azure-queue"
42+
/>
43+
</>
44+
}
45+
/>
46+
);
47+
48+
<SampleLayout details={sampleDetails} gallery={<Gallery images={frontMatter.gallery} />}>
49+
50+
## Overview
51+
52+
The Library of Ravens **solves the "architecture bloat"** of managing separate databases by **consolidating full-text and vector search into a single database**. Instead of wrestling with data synchronization across multiple platforms, you get a unified search experience that keeps your infrastructure lean and your development cycle fast.
53+
54+
The app demonstrates **robust integration patterns using Azure Storage Queues**. By leveraging RavenDB’s change tracking and ETL services, the system ensures that critical library updates are never lost, providing architectural resilience.
55+
56+
Finally, the app **addresses the "cloud tax" of high egress fees** by utilizing ETags and native HTTP caching driven by RavenDB’s metadata. This approach significantly reduces the volume of data sent over the wire, slashing public cloud billing while providing a snappier, more responsive experience for the end user through efficient data reuse.
57+
58+
Built with [RavenDB](https://ravendb.net/), [Aspire](https://aspire.dev/), [Azure Storage Queues](https://github.com/ravendb/samples-library/blob/main/azure.microsoft.com/en-us/products/storage/queues), and [Azure Functions](https://azure.microsoft.com/en-us/products/functions).
59+
60+
61+
## Features used
62+
63+
<FeatureAccordion
64+
title="Include"
65+
description="RavenDB's Include feature fetches related documents, solving N+1 issues."
66+
icon="link"
67+
>
68+
RavenDB's Include feature allows loading related documents in a single request, eliminating the N+1 query problem. In the Library application, when loading a book, we simultaneously fetch the author and category documents without additional roundtrips to the database.
69+
70+
Implementation example:
71+
72+
```csharp
73+
// Load a book with its related author in one request
74+
using var session = store.OpenAsyncSession();
75+
76+
var book = await session
77+
.Include<Book>(b => b.AuthorId)
78+
.Include<Book>(b => b.CategoryId)
79+
.LoadAsync<Book>("books/1-A");
80+
81+
// These are already loaded - no additional DB calls
82+
var author = await session.LoadAsync<Author>(book.AuthorId);
83+
var category = await session.LoadAsync<Category>(book.CategoryId);
84+
85+
// Example: Loading multiple books with their authors
86+
var books = await session.Query<Book>()
87+
.Include(b => b.AuthorId)
88+
.Where(b => b.IsAvailable)
89+
.ToListAsync();
90+
```
91+
</FeatureAccordion>
92+
93+
<FeatureAccordion
94+
title="Vector Search"
95+
description="Semantic search powered by AI embeddings for intelligent content discovery."
96+
icon="vector-search"
97+
>
98+
Vector search enables semantic similarity matching, allowing users to find books based on meaning rather than just keywords.
99+
</FeatureAccordion>
100+
101+
<FeatureAccordion
102+
title="Azure Storage Queues ETL"
103+
description="Reliable data integration with Azure Storage Queues."
104+
icon="azure-queue-storage-etl"
105+
>
106+
ETL to Azure Storage Queues ensures that all library updates are reliably propagated to downstream systems.
107+
</FeatureAccordion>
108+
109+
<FeatureAccordion
110+
title="Document Refresh"
111+
description="Automatic document updates based on external data sources."
112+
icon="document-refresh"
113+
>
114+
Document Refresh keeps book metadata up-to-date by automatically fetching the latest information from external APIs.
115+
</FeatureAccordion>
116+
117+
## Technologies
118+
119+
The following technologies were used to build this application:
120+
121+
- [RavenDB](https://ravendb.net/)
122+
- [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
123+
- [Aspire](https://aspire.dev/)
124+
- [Azure Functions](https://azure.microsoft.com/en-us/products/functions)
125+
- [Azure Storage Queues](https://azure.microsoft.com/products/storage/queues)
126+
- [SvelteKit](https://svelte.dev/)
127+
128+
## Run locally
129+
130+
If you want to run the application locally, please follow the steps:
131+
132+
1. Check out the GIT repository
133+
2. Install prerequisites:
134+
1. [.NET 10](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
135+
2. [Aspire.dev](https://aspire.dev/get-started/install-cli/)
136+
3. [nodejs](https://nodejs.org/)
137+
3. Request a [dev license](https://ravendb.net/license/request/dev-ai-agent-inside) and set it under `RAVEN_LICENSE` env variable
138+
4. Get the app running by opening `/src/RavenDB.Samples.Library.sln` and starting the `Aspire` `AppHost` project
139+
140+
## Community & Support
141+
142+
If you spot a bug, have an idea or a question, please let us know by raising an issue or creating a pull request.
143+
144+
We do use a [Discord server](https://discord.gg/ravendb). If you have any doubts, don't hesitate to reach out!
145+
146+
## Contributing
147+
148+
We encourage you to contribute! Please read our [CONTRIBUTING](https://github.com/ravendb/samples-library/blob/main/CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
149+
150+
## License
151+
152+
This project is licensed with the [MIT license](https://github.com/ravendb/samples-library/blob/main/LICENSE).
153+
154+
</SampleLayout>

sidebarsSamples.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This file has to be in JavaScript, otherwise @docusaurus/plugin-content-docs doesn't work properly
2+
export default {
3+
guides: [
4+
{
5+
type: "category",
6+
label: "Samples",
7+
link: {
8+
type: "doc",
9+
id: "home",
10+
},
11+
collapsible: false,
12+
items: [{ type: "autogenerated", dirName: "." }],
13+
},
14+
],
15+
};

0 commit comments

Comments
 (0)