All Projects → ButterCam → sisyphus

ButterCam / sisyphus

Licence: MIT license
Sisyphus is the way how we provide backend services.

Programming Languages

kotlin
9241 projects
ANTLR
299 projects

Projects that are alternatives of or similar to sisyphus

Buildbuddy
BuildBuddy is an open source Bazel build event viewer, result store, and remote cache.
Stars: ✭ 182 (+208.47%)
Mutual labels:  protobuf, grpc
grphp
PHP gRPC Framework
Stars: ✭ 19 (-67.8%)
Mutual labels:  protobuf, grpc
Grpc Kotlin
gRPC with Kotlin Coroutines
Stars: ✭ 190 (+222.03%)
Mutual labels:  protobuf, grpc
grpc-jwt-spring-boot-starter
Spring boot starter for gRPC framework with JWT authorization
Stars: ✭ 24 (-59.32%)
Mutual labels:  protobuf, grpc
compatip
A simple tool to ensure compatibility between microservices
Stars: ✭ 13 (-77.97%)
Mutual labels:  protobuf, grpc
Rules proto
Modern bazel build rules for protobuf / gRPC
Stars: ✭ 179 (+203.39%)
Mutual labels:  protobuf, grpc
protoactor-go
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
Stars: ✭ 4,138 (+6913.56%)
Mutual labels:  protobuf, grpc
Go Grpc Example
An example of gRPC
Stars: ✭ 153 (+159.32%)
Mutual labels:  protobuf, grpc
neofs-api-go
NeoFS API Golang repository contains implementation of core NeoFS structures that can be used for integration with NeoFS.
Stars: ✭ 14 (-76.27%)
Mutual labels:  protobuf, grpc
Clay
Proto-first minimal server platform for gRPС+REST+Swagger APIs
Stars: ✭ 212 (+259.32%)
Mutual labels:  protobuf, grpc
Makeaplan public
【制定一个计划】是一个目标规划应用,通过最直接,最清晰的方式帮助你记录和追踪自己的计划,辅助你达成自己的目标。
Stars: ✭ 174 (+194.92%)
Mutual labels:  protobuf, grpc
protoc-plugin
A protoc compiler plugin for Clojure applications
Stars: ✭ 28 (-52.54%)
Mutual labels:  protobuf, grpc
Flutter Grpc Tutorial
[Tutorial] Asynchronous Flutter chat client with Go chat server which are powered by gRPC (simple and streaming)
Stars: ✭ 167 (+183.05%)
Mutual labels:  protobuf, grpc
Go Grpc Examples
This repo contains examples and implementations of different types of GRPC services and APIs using Golang.
Stars: ✭ 180 (+205.08%)
Mutual labels:  protobuf, grpc
Kratos
A modular-designed and easy-to-use microservices framework in Go.
Stars: ✭ 15,844 (+26754.24%)
Mutual labels:  protobuf, grpc
Istio Micro
istio 微服务示例代码 grpc+protobuf+echo+websocket+mysql+redis+kafka+docker-compose
Stars: ✭ 194 (+228.81%)
Mutual labels:  protobuf, grpc
Grpc Cmake Example
gRPC C++ example with CMake
Stars: ✭ 142 (+140.68%)
Mutual labels:  protobuf, grpc
Go Micro Boilerplate
The boilerplate of the GoLang application with a clear microservices architecture.
Stars: ✭ 147 (+149.15%)
Mutual labels:  protobuf, grpc
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (+249.15%)
Mutual labels:  protobuf, grpc
qtprotobuf
Protobuf generator and bindings for Qt framework
Stars: ✭ 138 (+133.9%)
Mutual labels:  protobuf, grpc

Sisyphus

Awesome gRPC JDK version Gradle version Maven Central

Sisyphus is the way how we provide backend services. It integrates all tools and libraries needed for designing API which follows the Google API Improvement Proposals.

中文文档

We are rolling a huge boulder

Due to analyzing product documents completely, it is not particularly difficult to write an exquisite and easy-to-use API at the beginning for most APIs.

However, many people will break the initial design of the API in the endless updates of products.

It's hard to create a strong and extensible API in the whole project lifetime, just like rolling a huge boulder endlessly up a steep hill.

So we need an all-encompassing guide book to guide us in creating, updating, and modifying APIs.

The Google API Improvement Proposals is the all-encompassing guide book. Google created it in their rich and extensive API design experience. It laid the foundation for anyone to create an extensible API.

Good tools can help you

Choosing good tools can help you 'rolling a huge boulder' faster and easier. Sisyphus provides and integrates many tools in your 'boulder rolling' route.

Kotlin is our target language. The mature JVM community and concise grammar are the reasons.

Spring boot is our old friend to manage and organize our components.

gRPC is our target API framework. Sisyphus also provides the HTTP and gRPC Transcoding component for the environment which isn't compatible with gRPC.

Sisyphus JS is our customized protobuf and gRPC runtime for Javascript/Typescript.

Sisyphus Protobuf is our customized protobuf runtime, which designed for Kotlin.

Sisyphus gRPC Coroutine is our customized gRPC stub runtime, which designed for Kotlin coroutine.

Sisyphus gRPC RxJava is our customized gRPC stub runtime, which designed for RxJava2(Client only, design for Android).

Sisyphus DTO is the way how we create struct without protobuf.

Sisyphus Test is the way how we test our gRPC API by data-driven.

Sisyphus Middleware is the way how we connect Sisyphus and other systems.

Sisyphus Configuration Artifact is the way how we manage configurations and developing environment.

Sisyphus Kubernetes gRPC client is the way how we implement service discovery in Kubernetes.

Sisyphus Protobuf Compiler is the way how we generate Kotlin codes by .proto files.

Sisyphus Project Plugin is the way how we manage project and configuring Gradle.

Sisyphus Protobuf Plugin is the way how we generate code by .proto files in Gradle.

And More tools like CEL(Common Expression Language) , Filtering and Ordering scripts will help you to design APIs following Google AIP.

Rolling with Sisyphus

Ready to rolling boulder with Sisyphus already? Hold on! We need to plan our route first.

  1. System requirement

    • Gradle 6.7+
    • JDK 11+
  2. Configure Sisyphus with gradle.properties

    We use gradle.properties to configure global settings of Sisyphus and all Sisyphus projects.

    # [DEV,RT] Set developer name for developing environment.
    sisyphus.developer=higan
    # [DEV] Set development layer for replacing version of dependencies, could be 'API', 'PLATFORM', 'FRAMEWORK'.
    sisyphus.layer=FRAMEWORK
    # [RT] Set environment for configuration artifact.
    sisyphus.environment=production
    
    # Use 'sisyphus.repository.<name>.url' Register maven repository for Sisyphus usage.
    # [DEV,RT] Url of repository named 'snapshot'.
    sisyphus.repositories.snapshot.url=https://repo1.maven.org/maven2/
    # [DEV,RT] Optional, user name of repository.
    sisyphus.repositories.snapshot.username=
    # [DEV,RT] Optional, password of repository.
    sisyphus.repositories.snapshot.password=
    
    # Repositories for different usage, there are 4 embedded repositories.
    # 'local'(maven local), 'central'(maven central), 'portal'(gradle portal).
    
    # [DEV,RT] Repositories for resolving dependencies, default value is 'local,central,portal'.
    sisyphus.dependency.repositories=local,central,portal
    # [DEV] Repositories for snapshot publishing, default value is 'snapshot'.
    sisyphus.snapshot.repositories=snapshot
    # [DEV] Repositories for release publishing, default value is 'release'.
    sisyphus.release.repositories=release
    # [DEV] Repositories for docker publishing.
    sisyphus.docker.repositories=
    
    # [RT] Configuration artifacts, it will be resolved in runtime.
    sisyphus.config.artifacts=foo.bar:baz:1.0.0

    [DEV] for developing environment properties.

    [RT] for runtime environment properties.

    gradle.properties are shared between Gradle and Spring. Sisyphus Project Plugin will load them and configure Gradle automatically. Sisyphus Configuration Artifact will load them for Spring Framework.

  3. Write Protobuf schemas

    The next step is to design APIs, which means to create a schema project and to write .proto files in this project.

    This is a sample schema project build.gradle.kts config.

    plugins {
        `java-library` // We build this project as a java library.
        kotlin("jvm") version "1.3.72" // Use the kotlin plugin to compile .kt files
        id("com.bybutter.sisyphus.project") version "1.2.2" // Use the sisyphus project management plugin.
        id("com.bybutter.sisyphus.protobuf") version "1.2.2" // Use the sisyphus protobuf compiler plugin.
    }
    
    dependencies {
        api("com.bybutter.sisyphus:sisyphus-grpc-coroutine:1.2.2") // Dependent on sisyphus grpc runtime.
        /*proto("com.foo.bar:baz:1.0.0")*/ // Use 'proto' configuration to config jars need to compile proto.
        /*protoApi("com.foo.bar:baz:1.0.0")*/ // Use 'protoApi' configuration to config needed jars in proto compiling.
        // All dependencies in 'implementation' configuration will auto add to 'protoApi' configuration.
    }

    Now we can write .proto files in src/main/proto folder.

    syntax = "proto3";
    
    option java_multiple_files = true;
    option java_package = "com.bybutter.sisyphus.examples.helloworld";
    
    package sisyphus.examples.helloworld;
    
    import "google/api/annotations.proto";
    
    // The greeting api definition.
    service GreetingApi {
      // Sends a greeting
      rpc Greet (GreetRequest) returns (GreetResponse) {
        option (google.api.http) = {
            post: "/v1:greet"
            body: "*"
        };
      }
    }
    
    // The request message containing the user's name.
    message GreetRequest {
      string name = 1;
    }
    
    // The response message containing the greetings
    message GreetResponse {
      string message = 1;
    }

    Additionally, kotlin and java classes are able to be added to schema project too. However, we do not recommend anything like this added excluding util or helper classes.

    Use the gradlew generateProtos task to generate kotlin files from proto files.

  4. Implement API

    API schema is ready now. The next step is to implement this API schema. Create a service project and refer to the schema project.

    This is a sample service project build.gradle.kts config.

    plugins {
        `java-library`
        kotlin("jvm") version "1.3.72"
        id("com.bybutter.sisyphus.project") version "1.2.2"
    }
    
    dependencies {
        api("com.bybutter.sisyphus.middleware:sisyphus-grpc-client:1.2.2") // Dependent on spring grpc runtime.
        api(project("schema:example-schema")) // Dependent on schema project.
    }

    Create spring auto-config for service project.

    @Configuration
    @ComponentScan(basePackageClasses = [AutoConfig::class])
    class AutoConfig

    Register auto-config in src/main/resources/META-INF/spring.factories.

    org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.bybutter.sisyphus.examples.helloworld.AutoConfig

    Write the implementation by extend generated service classes.

    @RpcServiceImpl
    class GreetingApiImpl : GreetingApi() {
        override suspend fun greet(input: GreetRequest): GreetResponse {
            return GreetResponse {
                message = "Hello ${input.name}!"
            }
        }
    }
  5. Run the Application

    The service project is just a non-runnable library. We need to create an application project to run our service projects.

    This is a sample application project build.gradle.kts config.

    plugins {
        application
        kotlin("jvm") version "1.3.72"
        `kotlin-spring`
        id("com.bybutter.sisyphus.project") version "1.2.2"
    }
    
    dependencies {
        implementation("com.bybutter.sisyphus.starter:sisyphus-grpc-server-starter:1.2.2") // Dependent on spring grpc starter.
        implementation("com.bybutter.sisyphus.starter:sisyphus-grpc-transcoding-starter:1.2.2") // [Optional] Enable the http-transcoding feature.
        implementation("com.bybutter.sisyphus.starter:sisyphus-protobuf-type-server-starter:1.2.2") // [Optional] Enable the type server feature.
        implementation(project("service:example-service")) 	// Dependent on service project.
    }

    We only need one function in the application project, the main function.

    @SpringBootApplication
    @EnableHttpToGrpcTranscoding
    class MarcoApplication
    
    fun main(args: Array<String>) {
        SpringApplication.run(MarcoApplication::class.java, *args)
    }

    Use the gradlew bootRun task to run our application.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].