Skip to content

Commit

Permalink
READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Dec 1, 2023
1 parent 3396640 commit 1055c4e
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 31 deletions.
97 changes: 66 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,75 @@

Browse this repository to see how easy distributed applications development becomes with Restate.

## Typescript examples
## Starters

### Starter examples
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)

* [Lambda greeter](typescript/lambda-greeter): A simple example of how you can run a Restate service on AWS Lambda.
* [Payment api](typescript/payment-api/): Example API for payments, inspired by the Stripe API.
* [Food ordering](typescript/food-ordering): See how to integrate Restate with external services using Awakeables and side effects.
[Hello world on AWS Lambda](typescript/hello-world-lambda)
```shell
# Download the example
export EXAMPLE=typescript-hello-world-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)

[Hello World HTTP](jvm/hello-world-java-http)
```shell
# Download the example
export EXAMPLE=jvm-hello-world-java-http && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

[Hello world on AWS Lambda](jvm/hello-world-java-lambda)
```shell
# Download the example
export EXAMPLE=jvm-hello-world-java-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

![Kotlin](https://img.shields.io/badge/kotlin-%237F52FF.svg?style=for-the-badge&logo=kotlin&logoColor=white)

[Hello World HTTP](jvm/hello-world-kotlin-http)
```shell
# Download the example
export EXAMPLE=jvm-hello-world-kotlin-http && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

[Hello world on AWS Lambda](jvm/hello-world-kotlin-lambda)
```shell
# Download the example
export EXAMPLE=jvm-hello-world-kotlin-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Patterns

![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)

[Payment api](typescript/payment-api): Example API for payments, inspired by the Stripe API
```shell
# Download the example
export EXAMPLE=typescript-payment-api && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

### Intermediate examples
## Applications

* [Ticket reservation](typescript/ticket-reservation): An example to illustrate how Restate's keyed-sharding and concurrency guarantees simplify microservice architectures.
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)

### Advanced examples
[Food ordering](typescript/food-ordering): Integrate Restate with external services
```shell
# Download the example
export EXAMPLE=typescript-food-ordering && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

[Ticket reservation](typescript/ticket-reservation): Example showing Restate's keyed-sharding and concurrency guarantees
```shell
# Download the example
export EXAMPLE=typescript-ticket-reservation && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

- [Ecommerce store](typescript/ecommerce-store): A sophisticated example on how to build an ecommerce store based on Restate using the grpc-based Typescript SDK.
[Ecommerce store](typescript/ecommerce-store): An ecommerce store completely built on top of Restate
```shell
# Download the example
export EXAMPLE=typescript-ecommerce-store && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Joining the community

Expand Down Expand Up @@ -80,27 +134,8 @@ This should give you the following output in case of the ticket reservation exam

## Releasing (for Restate developers)

In order to create a new release, push a tag of the form `vX.Y.Z`.
Then [create a release via GitHub](https://github.com/restatedev/example-lambda-ts-greeter/releases).

### Upgrading the SDK dependency (for Restate developers)

In order to upgrade/update the SDK dependency you have to run:
Before releasing, trigger the "pre-release" workflow to update sdk versions. This automatically creates a pull request, which must be manually merged.

**Major version** change:
Once the repo is ready for the release, push a tag of the form `vX.Y.Z`.

```shell
npm --prefix typescript install @restatedev/restate-sdk@^Z.Y.X --workspaces
```

**Minor/patch version** change:

```shell
npm --prefix typescript update @restatedev/restate-sdk --workspaces
```

Now check whether the examples are still building:

```shell
npm --prefix typescript run verify --workspaces
```
This triggers a workflow that [creates a draft release](https://github.com/restatedev/examples/releases) on Github, which you need to approve to finalize it.
6 changes: 6 additions & 0 deletions jvm/hello-world-java-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Sample project configuration of a Restate service using the Java interface and H
* [Test `GreeterTest`](src/test/java/dev/restate/sdk/examples/GreeterTest.java)
* [Logging configuration](src/main/resources/log4j2.properties)

## Download the example

```shell
export EXAMPLE=jvm-hello-world-java-http && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Running the example

You can run the Java greeter service via:
Expand Down
6 changes: 6 additions & 0 deletions jvm/hello-world-java-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Sample project configuration of a Restate service using the Java interface and A
* [Test `GreeterTest`](src/test/java/dev/restate/sdk/examples/GreeterTest.java)
* [Logging configuration](src/main/resources/log4j2.properties)

## Download the example

```shell
export EXAMPLE=jvm-hello-world-java-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Package

Run:
Expand Down
6 changes: 6 additions & 0 deletions jvm/hello-world-kotlin-http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ Sample project configuration of a Restate service using the Kotlin coroutines in
* [Test `GreeterTest`](src/test/kotlin/dev/restate/sdk/examples/GreeterTest.kt)
* [Logging configuration](src/main/resources/log4j2.properties)

## Download the example

```shell
export EXAMPLE=jvm-hello-world-kotlin-http && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Running the example

You can run the Kotlin greeter service via:
Expand Down
6 changes: 6 additions & 0 deletions jvm/hello-world-kotlin-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Sample project configuration of a Restate service using the Kotlin coroutines in
* [Test `GreeterTest`](src/test/kotlin/dev/restate/sdk/examples/GreeterTest.kt)
* [Logging configuration](src/main/resources/log4j2.properties)

## Download the example

```shell
export EXAMPLE=jvm-hello-world-kotlin-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Package

Run:
Expand Down
6 changes: 6 additions & 0 deletions typescript/ecommerce-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ Restate is a system for easily building resilient applications using **distribut
- Optional: Docker Compose
- Optional: AWS account with permissions for ECS, RDS, ECR, security groups, VPC, service discovery, IAM roles.

## Download the example

```shell
export EXAMPLE=typescript-ecommerce-store && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Deployment on Docker Compose

Build the Docker containers for the web app and services:
Expand Down
6 changes: 6 additions & 0 deletions typescript/food-ordering/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ The example illustrates the following aspects:
- How to resolve Awakeables from an external service and thereby resuming Restate invocations.
- How delayed calls can be used to schedule tasks for later moments in time.

## Download the example

```shell
export EXAMPLE=typescript-food-ordering && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Detailed description

This application implements the order processing middleware that sits between food delivery providers and restaurants.
Expand Down
6 changes: 6 additions & 0 deletions typescript/hello-world-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ Restate is a system for easily building resilient applications using **distribut

This example contains the greeter service which you can deploy on AWS Lambda.
Take a look at [how to deploy Restate services on AWS Lambda](https://docs.restate.dev/services/deployment/lambda#tutorial) for more information.

## Download the example

```shell
export EXAMPLE=typescript-hello-world-lambda && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```
6 changes: 6 additions & 0 deletions typescript/payment-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Despite the relatively few lines of code (no careful synchronization, retries, o
this application maintaines a high level of consistency in the presence of concurrent external requests
and failures.

## Download the example

```shell
export EXAMPLE=typescript-payment-api && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Running this example

### Prerequisites
Expand Down
6 changes: 6 additions & 0 deletions typescript/ticket-reservation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ Restate is a system for easily building resilient applications using **distribut

❓ Learn more about Restate from the [Restate documentation](https://docs.restate.dev).

## Download the example

```shell
export EXAMPLE=typescript-ticket-reservation && wget https://github.com/restatedev/examples/releases/latest/download/$EXAMPLE.zip && unzip $EXAMPLE.zip -d $EXAMPLE && rm $EXAMPLE.zip
```

## Quickstart

To set up the example, use this sequence of commands:
Expand Down

0 comments on commit 1055c4e

Please sign in to comment.