DEV Community

Cover image for Action Protocol, abstract layer to help create your microservice.
Julio Contreras
Julio Contreras

Posted on

3 2

Action Protocol, abstract layer to help create your microservice.

Hello world! I've been a programmer for over ten years in different technologies.

This year I started making my own microservices and found many interesting things like DDD architecture, gRPC protocols and metrics systems.

In the middle of development I came across a question. How use HTTP or gRPC without change my application?

It was when I had the idea to create an abstraction layer, where I pass the action, data and authorization token.

This also allows to control the time and quantity of general requests or by type of action.

Image description

Example data:

{
  "action": "createCar",
  "data": {
    "brand": "Ferrary",
    "color": "red"
  },
  "token": "mytokensecret" 
}
Enter fullscreen mode Exit fullscreen mode

Repository:
https://www.npmjs.com/package/action-grpc

Example project using action-grpc:

  • src/infrastructure/http/http.ts
  • src/infrastructure/grpc/grpc.ts

https://github.com/julioacontreras/authenticator-storage

Thank´s and good vibes!
Bye

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay