Skip to content

Commit c003770

Browse files
Merge pull request #278 from XavierGeerinck/issue_236
Rework README
2 parents 752c59f + b9e9269 commit c003770

File tree

2 files changed

+84
-64
lines changed

2 files changed

+84
-64
lines changed

README.md

Lines changed: 53 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,70 @@
1-
[![Discord](https://img.shields.io/discord/778680217417809931)]()
2-
[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/dapr/js-sdk/blob/master/LICENSE)
3-
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fdapr%2Fcomponents-contrib.svg?type=shield)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fdapr%2Fcomponents-contrib?ref=badge_shield)
1+
<p align="center">
2+
<a href="https://dapr.io">
3+
<img src="https://dapr.io/images/dapr.svg" height="128">
4+
<h1 align="center">Dapr</h1>
5+
</a>
6+
</p>
7+
8+
<p align="center">
9+
<a aria-label="NPM version" href="https://www.npmjs.com/package/@dapr/dapr">
10+
<img alt="" src="https://img.shields.io/npm/v/@dapr/dapr?style=for-the-badge&labelColor=000000">
11+
</a>
12+
<a aria-label="License" href="https://github.com/dapr/js-sdk/blob/master/LICENSE">
13+
<img alt="" src="https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge&labelColor=000000">
14+
</a>
15+
<a aria-label="Join the community on Discord" href="https://discord.com/invite/ptHhX6jc34">
16+
<img alt="" src="https://img.shields.io/badge/Join%20the%20community-blueviolet.svg?style=for-the-badge&logo=Discord&labelColor=000000&logoWidth=20&logoColor=FFFFFF">
17+
</a>
18+
</p>
19+
20+
## Getting Started
21+
22+
Instantly get started by installing the Dapr JS SDK and reading the [getting started documentation](https://docs.dapr.io/developing-applications/sdks/js) or [follow one of the quickstarts](https://github.com/dapr/quickstarts)
423

5-
# Dapr Node.js SDKs
6-
7-
The official [Dapr](https://dapr.io) Node.js SDK that allows interfacing with the Dapr sidecar for easy application building.
8-
9-
## Introduction
10-
11-
The Dapr JS SDK will allow you to interface with the Dapr process that abstracts several commonly used functionalities such as Service-to-Service invocation, State Management, PubSub, and more.
12-
13-
![](./documentation/assets/dapr-architecture.png)
14-
15-
Looking at the illustration above, we can see there will always always be another process (the Dapr Sidecar) running that your application will interface with. This process can either be started manually (e.g. through Dapr CLI) or injected as a container (e.g. through Kubernetes Sidecar injection in your pod).
16-
17-
For your application to interface with this, 2 components should be taken into account:
18-
* **DaprServer:** Dapr Sidecar -> our Application - When we Subscribe to a Topic, Create an Actor, ... we receive an event from the Dapr process that abstracted its implementation. Our application should thus listen to this (which this SDK helps you with).
19-
* **DaprClient:** Your Application -> Dapr Sidecar - When we want to Publish an Event, Execute a Binding, ... we will talk with the Dapr process that calls its implementation for us so that we don't have to write it ourself!
20-
21-
## Simple Example
24+
```
25+
npm install --save @dapr/dapr
26+
```
2227

23-
> [Full version](./examples/http/pubsub)
28+
> ⚠️ the [`dapr-client`](https://www.npmjs.com/package/dapr-client) package has been deprecated. Please see https://github.com/dapr/js-sdk/issues/259 for more information.
2429
25-
As a simple example, consider the use case: "Creating a PubSub where we can publish a message on a Topic and also receive messages back from this topic". Normally for this use case we would have to look at the Broker that we want to utilize and implement their specificities. While as with Dapr we can use a simple SDK and configure the "component" that we want to interface with.
30+
## Documentation
2631

27-
> 🤩 This also means that if we want to switch from one broker to another (e.g. [Azure Service Bus](https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-azure-servicebus/) to [RabbitMQ](https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-rabbitmq/)) we just have to change the component implementation!
32+
Visit [https://docs.dapr.io/developing-applications/sdks/js/](https://docs.dapr.io/developing-applications/sdks/js/) to view the full documentation.
2833

29-
**component.yaml**
34+
## Who is using Dapr?
3035

31-
```yaml
32-
apiVersion: dapr.io/v1alpha1
33-
kind: Component
34-
metadata:
35-
name: my-pubsub-component
36-
namespace: default
37-
spec:
38-
type: pubsub.rabbitmq
39-
version: v1
40-
metadata:
41-
- name: host
42-
value: "amqp://localhost:5672"
43-
```
36+
Dapr is used by the world's leading companies.
4437

45-
**example.ts**
38+
<div align="center">
39+
<img src="https://dapr.io/images/bosch.png" width="100px">
40+
<img src="https://dapr.io/images/zeiss.png" width="100px">
41+
<img src="https://dapr.io/images/alibaba.png" width="100px">
42+
<img src="https://dapr.io/images/ignition-group.png" width="100px">
43+
<img src="https://dapr.io/images/roadwork.png" width="100px">
44+
<img src="https://dapr.io/images/autonavi.png" width="100px">
45+
<img src="https://dapr.io/images/legentic.png" width="100px">
46+
<img src="https://dapr.io/images/man-group.png" width="100px">
47+
</div>
4648

47-
```javascript
48-
import { DaprClient, DaprServer } from "@dapr/dapr";
49+
View the main site [https://dapr.io/](https://dapr.io/) to learn more.
4950

50-
const daprHost = "127.0.0.1"; // Dapr Sidecar Host
51-
const daprPort = "50000"; // Dapr Sidecar Port
52-
const serverHost = "127.0.0.1"; // App Host of this Example Server
53-
const serverPort = "50001"; // App Port of this Example Server
51+
## Community
5452

55-
// Create a Server (will subscribe)
56-
const server = new DaprServer(serverHost, serverPort, daprHost, daprPort);
57-
await server.pubsub.subscribe("my-pubsub-component", "my-topic", async (data: any) => console.log(`Received: ${JSON.stringify(data)}`));
58-
await server.start();
53+
For the JS SDK we are utilizing [GitHub Communities](https://github.com/dapr/js-sdk/discussions) to track announcements, articles, and more!
5954

60-
// Create a Client (will publish)
61-
const client = new DaprClient(daprHost, daprPort);
62-
await client.pubsub.publish("my-pubsub-component", "my-topic", { hello: "world" });
63-
```
55+
The General Dapr community can be found on [Discord](https://discord.com/invite/ptHhX6jc34), where you can ask questions, propose features, and share your thoughts.
6456

65-
To start this we of course have to start the Dapr process with it. With the command below we can utilize the CLI to quickly test this:
57+
## Contributing
6658

67-
```bash
68-
dapr run --app-id example-http-pubsub --app-protocol http --app-port 50001 --dapr-http-port 50000 --components-path ./components npm run start
69-
```
59+
Please see our [Contributing Overview](https://docs.dapr.io/contributing/js-contributing/).
7060

71-
Which will result in the message:
61+
### Good First Issues
7262

73-
```bash
74-
Received: {"hello":"world"}
75-
```
63+
We have a list of [good first issues](https://github.com/dapr/js-sdk/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
7664

77-
## Information & Links
65+
## Authors
7866

79-
* [Reference](./documentation/reference.md) containing code snippets of how to use the different methods.
80-
* [Examples](./documentation/examples.md) containing examples you can use to build your application.
81-
* [Development](./documentation/development.md) containing pointers for getting started on how to contribute to the SDK.
67+
- [Xavier Geerinck](https://www.linkedin.com/in/xaviergeerinck/) ([@XavierGeerinck](https://twitter.com/XavierGeerinck)) – [M18X](https://xaviergeerinck.com/) & [Proximus](https://proximus.com)
68+
- [Shubham Sharma](https://www.linkedin.com/in/shubham1172/) ([@shubham1172](https://twitter.com/shubham1172)) – [Microsoft](https://microsoft.com)
69+
- [Amulya Varote](https://www.linkedin.com/in/amulya-varote-96954287/) - [Microsoft](https://microsoft.com)
70+
- [Tanvi Gour](https://www.linkedin.com/in/tanvigour/) - [Microsoft](https://microsoft.com)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
type: docs
3+
title: "JavaScript Examples"
4+
linkTitle: "Examples"
5+
weight: 500
6+
description: Get started with the Dapr Javascript SDK through some of our examples!
7+
---
8+
9+
## Quickstarts
10+
11+
* [State Management](https://github.com/dapr/quickstarts/tree/master/state_management/javascript/sdk): Learn the concept of state management with Dapr
12+
* [Pub Sub](https://github.com/dapr/quickstarts/tree/master/pub_sub/javascript/sdk): Create your own Publish / Subscribe system
13+
* [Secrets Management](https://github.com/dapr/quickstarts/tree/master/secrets_management/javascript/sdk)
14+
* [Service Invocation](https://github.com/dapr/quickstarts/tree/master/service_invocation/javascript/http)
15+
16+
## Articles
17+
18+
> Want your article added? [Let us know!](https://github.com/dapr/js-sdk/discussions/categories/articles) so we can add it below
19+
20+
* [xaviergeerinck.com - Create an Azure IoT Hub Stream Processor with Dapr](https://xaviergeerinck.com/post/2022/05/19/dapr-stream-processor)
21+
22+
* [xaviergeerinck.com - Integrate Dapr with Nest.JS and the Dapr KS SDK](https://xaviergeerinck.com/post/2022/03/29/dapr-with-nestjs)
23+
24+
25+
* [xaviergeerinck.com - Parking Garage Sensor implementation using Dapr Actors](https://xaviergeerinck.com/post/2021/10/09/parking-garage)
26+
27+
* [xaviergeerinck.com - Running Dapr on Azure IoT Edge](https://xaviergeerinck.com/post/2021/04/23/iot-edge)
28+
29+
* [xaviergeerinck.com - Creating an Email Microservice with Typescript and Dapr](https://xaviergeerinck.com/post/2021/03/25/creating-email-microservice)
30+
31+
* [xaviergeerinck.com - Creating a User Login/Register Microservice](https://xaviergeerinck.com/post/2020/04/10/creating-account-microservice)

0 commit comments

Comments
 (0)