• Stars
    star
    412
  • Rank 105,024 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Community driven repository for Dapr samples

Dapr Samples

Note: The Dapr samples have been recently reorganized. Samples that are aimed for newcomers and are meant to help users get started quickly with Dapr have been migrated to a separate repository dapr/quickstarts.

Samples in this repository showcase Dapr capabilities using different languages and address wide array of common scenarios. Some focus on specific usage patterns or particular Dapr capability while others are end-to-end demos leveraging several Dapr building blocks and capabilities.

If you are new to Dapr, you may want to review following resources first:

Note, these samples are maintained by the Dapr community and are not guaranteed to work properly with the latest Dapr runtime version.

Samples in this repository

Sample Details
Twitter Sentiment Processor Code sample used to demo Dapr during Microsoft's Build 2020 conference showing a polyglot distributed application which performs sentiment processing for tweets
Hello world slim (no Docker dependency) This sample is a version of the hello-world quickstart sample showing how to install initialize and use Dapr without having Docker in your local environment
Hello TypeScript This sample is a version of the hello-world quickstart sample showing how to use Dapr in a TypeScript project.
Docker compose sample Demonstrates how to get Dapr running locally with Docker Compose
Dapr, Azure Functions, and KEDA Shows Dapr being used with Azure Functions and KEDA to create a polygot Functions-as-a-Service application which leverages Dapr pub/sub
Middleware OAuth to Google APIs - Interactive Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization and inject client secrets for Google APIs.
Middleware OAuth to Microsoft and AAD APIs - Non Interactive Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization and inject client secrets for Microsoft and Azure Active Directory apps.
Read Kubernetes Events Shows Dapr being used with the Kubernetes Input binding to watch for events in Kubernetes cluster
Batch File Processing This sample demonstrates an end-to-end sample for processing a batch of related text files using microservices and Dapr. Through this sample you will learn about Dapr's state management, bindings, Pub/Sub, and end-to-end tracing.
Dapr integration in Azure APIM Dapr configuration in Azure API Management service using self-hosted gateway on Kubernetes. Illustrates exposing Dapr API for service method invocation, publishing content to a Pub/Sub topic, and binding invocation with request content transformation.
Distributed Calendar Shows use of statestore, pubsub and output binding features of Dapr to roughly create a distributed version of a MVCS architecture application.
Hello Service Fabric Shows use of statestore, pubsub and service invocation in a Service Fabric environment running the Dapr sidecar as a guest executable.
Pub-sub routing Demonstrates how to use Dapr to enable pub-sub applications with message routing.
Distributed Calculator with Knative Serving Demonstrates how to use Dapr and Knative Serving using distributed calculator from quickstarts.
commercetools GraphQL sample output binding Connects to commercetools, allowing you to query or manipulate a commercetools projects using a provided GraphlQL query.
WebAssembly Middleware Demonstrates how to serve HTTP responses directly from the dapr sidecar using WebAssembly.

External samples

Sample Details
Dapr RetroPOS Dapr Retro Point of Sales is a sample of backend workflow based on microservices.
Dapr Traffic Control Simulated traffic-control system with speeding cameras. This sample features all the Dapr building-blocks. This is also the sample application used in the book Dapr for .NET Developers.
Dapr Examples Example usage of Dapr in Golang. This repository contains examples about to use of state store, access management, pubsub and subscription.

Sample maintenance

Each sample includes README.md which provides information about the validated versions of Dapr for that sample.

If you would like to have a sample updated or better yet, update it yourself to a newer version of Dapr, please see the contribution guide to learn more about opening issues and submitting pull requests to this repository.

Note, over time, for maintainability reasons, some samples may be removed from this repository.

Sample contribution

If you want to contribute a sample to this repo, please see the sample contribution guide for details on the PR process.

Samples should follow these high-level guiding principles:

  • Sample should have a meaningful name that helps users understand what this sample is about
  • Sample code should be complete (i.e. no major code additions should be needed to make the sample work)
  • Each sample should include a README.md file clearly explaining what the sample does and how to run it including prerequisites. This file should also include details on the Dapr core version this sample is compatible with (see below).
  • Highly recommended:
    • architecture diagrams of the sample application
    • scripts and automation to allow users to easily run samples which require complex setup and multiple steps to run

Along with the sample code and README, samples should be listed in this page in the above samples table

Sample info section at the top of the main sample README should follow the following template:

Attribute Details
Dapr runtime version vX.X
Language [Languages used in the sample code]
Environment [Environment name]

Note: If you are not sure what Dapr runtime version you are running, use the Dapr CLI command dapr --version

Example:

Attribute Details
Dapr runtime version v0.7.1
Language Go, C# (.NET Core), Node.js
Environment Local or Kubernetes

Code of Conduct

Please refer to our Dapr Community Code of Conduct

More Repositories

1

dapr

Dapr is a portable, event-driven, runtime for building distributed applications across cloud and edge.
Go
23,824
star
2

dotnet-sdk

Dapr SDK for .NET
C#
1,107
star
3

quickstarts

Dapr quickstart code samples and tutorials showcasing core Dapr capabilities
Java
1,027
star
4

docs

Dapr user documentation, used to build docs.dapr.io
HTML
992
star
5

components-contrib

Community driven, reusable components for distributed apps
Go
543
star
6

go-sdk

Dapr SDK for go
Go
443
star
7

cli

Command-line tools for Dapr.
Go
317
star
8

java-sdk

Dapr SDK for Java
Java
258
star
9

python-sdk

Dapr SDK for Python
Python
222
star
10

rust-sdk

Dapr SDK for Rust - Alpha
Rust
212
star
11

js-sdk

Dapr SDK for Javascript
JavaScript
197
star
12

dashboard

General purpose dashboard for Dapr
Go
181
star
13

community

Governance and community material for Dapr and its open source sub-projects
140
star
14

php-sdk

Dapr SDK for PHP
PHP
70
star
15

dapr-shared

Dapr Shared enables users to deploy Dapr as a DaemonSet or a Deployment instead of a sidecar
Go
48
star
16

installer-bundle

Dapr bundled installer containing CLI and runtime packaged together. This eliminated the need to download Docker images when initializing Dapr locally.
36
star
17

cpp-sdk

C++ SDK for Dapr
Makefile
36
star
18

helm-charts

Helm Charts for Dapr
20
star
19

mechanical-markdown

Python
20
star
20

kit

Shared utility code for Dapr runtime
Go
19
star
21

sig-api

Repository for Dapr API Special Interest Group
HTML
18
star
22

proposals

Proposals for new features in Dapr
15
star
23

test-infra

Test apps and tools for Dapr
C#
14
star
24

setup-dapr

GitHub Action for installing the Dapr CLI
JavaScript
10
star
25

docs-zh

Chinese translation of the Dapr documentation
9
star
26

kubernetes-operator

Go
6
star
27

blog

HTML
5
star
28

website

Website for the Dapr project
HTML
5
star
29

sig-sdk-spec

Repository for Dapr SDk Spec Special Interest Group
3
star
30

.github

1
star
31

homebrew-tap

Repository to enable Dapr cli installation via macOS' Homebrew.
Ruby
1
star