All Projects → sdkgen → sdkgen

sdkgen / sdkgen

Licence: MIT License
sdkgen is a tool to help design, implement and maintain good APIs with minimal effort

Programming Languages

typescript
32286 projects
dart
5743 projects
F#
602 projects
swift
15916 projects
HTML
75241 projects
kotlin
9241 projects

Projects that are alternatives of or similar to sdkgen

Phpboot
☕️ 🚀 tiny & fast PHP framework for building Microservices/RESTful APIs, with useful features: IOC, Hook, ORM, RPC, Swagger, Annotation, Parameters binding, Validation, etc.
Stars: ✭ 638 (+945.9%)
Mutual labels:  restful, rpc
Go Api Boilerplate
Go Server/API boilerplate using best practices DDD CQRS ES gRPC
Stars: ✭ 373 (+511.48%)
Mutual labels:  restful, rpc
Go Zero
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity.
Stars: ✭ 13,156 (+21467.21%)
Mutual labels:  restful, rpc
Hasor
Hasor是一套基于 Java 语言的开发框架,区别于其它框架的是 Hasor 有着自己一套完整的体系,同时还可以和先有技术体系做到完美融合。它包含:IoC/Aop容器框架、Web框架、Jdbc框架、RSF分布式RPC框架、DataQL引擎,等几块。
Stars: ✭ 713 (+1068.85%)
Mutual labels:  restful, rpc
ruo
Yet Another RESTful framework (**Work In Progress**)
Stars: ✭ 14 (-77.05%)
Mutual labels:  restful
experiments
Code examples for my blog posts
Stars: ✭ 21 (-65.57%)
Mutual labels:  rpc
ethjs-rpc
A super simple module for making low level queries to the Ethereum RPC layer.
Stars: ✭ 14 (-77.05%)
Mutual labels:  rpc
rudder
RESTful API Proxy for Helm
Stars: ✭ 60 (-1.64%)
Mutual labels:  restful
vue-php-admin
RBAC通用角色权限管理系统, 前后端分离架构, 基于 vue-element-admin 和 PHP CodeIgniter RESTful 实现
Stars: ✭ 4 (-93.44%)
Mutual labels:  restful
moleculer-go
moleculer go implementation
Stars: ✭ 17 (-72.13%)
Mutual labels:  rpc
nest-blog-api
B站全栈之巅:基于TypeScript的NodeJs框架:NestJs开发博客API (node.js+nest.js)
Stars: ✭ 34 (-44.26%)
Mutual labels:  restful
scala-json-rpc
Let your servers and clients communicate over function calls! JSON-RPC 2.0 library for Scala and Scala.js
Stars: ✭ 38 (-37.7%)
Mutual labels:  rpc
lurch
A simple Ruby JSON API client.
Stars: ✭ 15 (-75.41%)
Mutual labels:  restful
kungfu
A REST framework, base on JFinal.
Stars: ✭ 78 (+27.87%)
Mutual labels:  restful
Python-notes
Python related technologies used in work: crawler, data analysis, timing tasks, RPC, page parsing, decorator, built-in functions, Python objects, multi-threading, multi-process, asynchronous, redis, mongodb, mysql, openstack, etc.
Stars: ✭ 104 (+70.49%)
Mutual labels:  rpc
koa-rest-router
Most powerful, flexible and composable router for building enterprise RESTful APIs easily!
Stars: ✭ 67 (+9.84%)
Mutual labels:  restful
Pudding
Pudding 是一款迷你级分布式服务框架
Stars: ✭ 24 (-60.66%)
Mutual labels:  rpc
httpz
Inspect HTTP requests
Stars: ✭ 20 (-67.21%)
Mutual labels:  restful
restana
Super fast and minimalist framework for building REST micro-services.
Stars: ✭ 380 (+522.95%)
Mutual labels:  restful
thinkgo
Public libraries and components for glang development.
Stars: ✭ 14 (-77.05%)
Mutual labels:  rpc

sdkgen

test status badge telegram badge

Getting Started

Installing sdkgen

First of all you need Node.js 12 or newer on your machine. We recommend using the latest LTS version, check for it here: https://nodejs.org/en/download/.

Install the global CLI:

npm i -g @sdkgen/cli

Creating an API description

Create an api.sdkgen to describe your API. For example:

type Post {
    id: uuid
    title: string
    body: string
    createdAt: datetime
    author: {
        name: string
    }
}

fn getPost(id: uuid): Post?

You can then generate the TypeScript source for this description with sdkgen api.sdkgen -o api.ts -t typescript_nodeserver.

Creating base project

Let's start a new project with TypeScript:

npm init -y
npm i --save-dev typescript
npm i @sdkgen/node-runtime
npx tsc --init -t esnext

Then create a main.ts file:

// Import sdkgen's runtime and the generated file
import { SdkgenHttpServer } from "@sdkgen/node-runtime";
import { api } from "./api";

// Every endpoint described must receive some implementation
api.fn.getPost = async (ctx, {id}) => {
    return {
        id,
        title: "Getting Started",
        author: {
            name: "John Doe"
        },
        body: "Lorem ipsum",
        createdAt: new Date(),
    };
};

// Start a HTTP server for the API
const server = new SdkgenHttpServer(api, {});
server.listen(8000);

Run the project

Build and run it:

npx tsc
node main.js
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].