Skip to content

New app wizard for creation of a new Dapr project. Including Dapr component selection and app scaffolding of a new app based on user choices.

License

Notifications You must be signed in to change notification settings

mchmarny/daprme

Repository files navigation

daprme

Go Report Card Test Release codecov

This new app wizard CLI guides you through the creation of a new Dapr project. Including the Dapr component selection and scaffolding of a new application.

Currently supported application types:

  • Command-line (e.g. CLI)
  • HTTP Service
  • gRPC Service

Each one of these applications supports options have client to call into Dapr API

Currently supported development languages:

  • Go
  • Node.js (under development)

The daprme wizard is template driven, PRs with support for other languages welcomed

Installation

Mac OS using Homebrew

brew tap dapr-templates/daprme
brew install dapr-templates/daprme/daprme

Other

  1. Download the latest daprme release for your OS
  2. Move it to your desired in PATH location (e.g. /usr/local/bin)

Usage

Assuming the daprme CLI is already in PATH (see Installation above)

Run daprme and follow the prompts

daprme

To specify the output directory (defaults to current), provide the --out flag, for example:

daprme --out ~/Downloads

To re-use an existing app manifest provide the --file flag, for example:

daprme --file ~/dapr-templates/my-common-app.yaml

Here is an example of an app template for a gRPC service application type in Go with a couple of components:

The daprme prompt will guide you through template definition and output resulting manifest at the end, so no need to write any YAML by hand.

Meta:
  Name: demo
  Type: gRPC
  Lang: go
  Main: main.go
  Port: 50050
  UsesClient: true
  Owner: mchmarny
PubSubs:
- Type: pubsub.redis
  Name: redis-pubsub
  Topic: messages
Bindings:
- Type: bindings.cron
  Name: cron-binding
Services:
- Name: myService
- Name: myOtherService
Components:
- Type: secretstores.local.env
  Name: localenv-secret
- Type: state.redis
  Name: redis-store

Adding Language Support

To learn about ways you can contribute and how to setup your development environment check the CONTRIBUTING.md doc.

The best place to start is adding support for additional languages. daprme is uses Go templating, so adding addition language support is as simple as providing language specific templates in the template directory. In the template, you can use any value from the context daprme passes to these templates.

In addition, you will need to implement the language specific provider interface Configurable in pkg/lang package. It lists the templates and provides language specific configuration.

When possible, aim for runnable project vs advanced features that require users to perform additional "plumbing" steps.

Code of Conduct

Please refer to our included Code of Conduct

About

New app wizard for creation of a new Dapr project. Including Dapr component selection and app scaffolding of a new app based on user choices.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks