generators

API Generator - instantly generate REST and GraphQL APIs (openapi (OAS) 3.0.0)

Github星跟踪图

Rest/GraphQL APIs + React Components Generator 🔥

Buy Ligit License
Follow on Twitter
Average time to resolve an issue
Percentage of issues still open
npm package
NPM Downloads

Sugar Generator - API Edition

App Demo

This project is sponsored by

SponsoredBy.dev

Quick Start

  1. Install the npm module
# install
npm i -g sugar-generate
  1. Create a json schema save, this to monkey.json
{
  "name": "monkey",
  "schema": {
    "name": {
      "type": "String",
      "default": ""
    },
    "alive": {
      "type": "Boolean",
      "default": false
    },
    "age": {
      "type": "Number",
      "default": false
    }
  }
}
  1. Generate your api and app
sugar-generate \
--schema monkey.json \
--destination ./my-monkeys

Boom, you now have:

API:

  • GraphQL API
  • REST API
  • Working Tests

APP:

  • React create item form
  • React table that supports
    • search
    • sort
    • filter
    • pagination
    • edit item
    • create item

Start the API

cd ./my-monkeys/api
npm i
npm run start

# http://localhost:7777

Start the APP

cd ./my-monkeys/app
npm i
npm run dev

# http://localhost:3000

Behold Magic

A fully functioning react table and form with searching sorting filtering, editing, adding, global search, download, and refresh.

SugarKubes Generated App

Links

GraphQL is on localhost:7777/graphql

Swagger is on localhost:7777

APP is on localhost:3000

API is on localhost:7777

Documentation

API Documentation (generated back end)

App Documentation (generated front end)

Experimental Embeddable Components

What if you could remotely update your components without having to push new code?

Thats one question we're exploring with the experimental embeddable react components. There are of course cool ways to serve single pages as serverless functions but what's cooler would be a way for even non-technical people to update a database schema and a form or table in real time without writing any code.

  • Each component comes out in an embeddable format under /embed
  • TBD - How to easily deploy these and use them.

Updates

  • 8/5/19 support for mongo arrays in documents

主要指标

概览
名称与所有者wrannaman/generators
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2019-06-02 03:05:54
推送于2022-12-30 17:52:06
最后一次提交2020-03-03 14:51:34
发布数0
用户参与
星数236
关注者数2
派生数28
提交数113
已启用问题?
问题数8
打开的问题数0
拉请求数6
打开的拉请求数9
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?