Skip to content

Commit 11518cc

Browse files
Rework README
Signed-off-by: Xavier Geerinck <[email protected]>
1 parent 8bbf5fb commit 11518cc

File tree

1 file changed

+52
-65
lines changed

1 file changed

+52
-65
lines changed

README.md

Lines changed: 52 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,68 @@
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+
## Documentation
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+
Visit [https://docs.dapr.io/developing-applications/sdks/js/](https://docs.dapr.io/developing-applications/sdks/js/) to view the full 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+
## Who is using Dapr?
2833

29-
**component.yaml**
34+
Dapr is used by the world's leading companies.
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+
<div align="center" style="display: flex; justify-content: space-around; align-content: center;">
37+
<img src="https://dapr.io/images/bosch.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
38+
<img src="https://dapr.io/images/zeiss.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
39+
<img src="https://dapr.io/images/alibaba.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
40+
<img src="https://dapr.io/images/ignition-group.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
41+
<img src="https://dapr.io/images/roadwork.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
42+
<img src="https://dapr.io/images/autonavi.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
43+
<img src="https://dapr.io/images/legentic.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
44+
<img src="https://dapr.io/images/man-group.png" style="flex-grow: 0; flex-shrink: 0;" width="100px">
45+
</div>
4446

45-
**example.ts**
47+
<br />
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+
The Dapr community can be found on [Discord](https://discord.com/invite/ptHhX6jc34), where you can ask questions, propose features, and share your thoughts.
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+
## Contributing
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+
Please see our [Contributing Overview](https://docs.dapr.io/contributing/js-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-
```
70-
71-
Which will result in the message:
59+
### Good First Issues
7260

73-
```bash
74-
Received: {"hello":"world"}
75-
```
61+
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.
7662

77-
## Information & Links
63+
## Authors
7864

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.
65+
- [Xavier Geerinck](https://www.linkedin.com/in/xaviergeerinck/) ([@XavierGeerinck](https://twitter.com/XavierGeerinck)) – [M18X](https://xaviergeerinck.com/) & [Proximus](https://proximus.com)
66+
- [Shubham Sharma](https://www.linkedin.com/in/shubham1172/) ([@shubham1172](https://twitter.com/shubham1172)) – [Microsoft](https://microsoft.com)
67+
- [Amulya Varote](https://www.linkedin.com/in/amulya-varote-96954287/) - [Microsoft](https://microsoft.com)
68+
- [Tanvi Gour](https://www.linkedin.com/in/tanvigour/) - [Microsoft](https://microsoft.com)

0 commit comments

Comments
 (0)