All Projects → panacloud → cli

panacloud / cli

Licence: other
Panacloud Command Line Interface (CLI) uses the design-first approach for developing APIs. It generates Modern Multi-Tenant Serverless Cloud API infrastructure, mocks, stubs, tests, and stages using CDK. GraphQL schemas and OpenAPI specifications are used to implement the design-first approach.

Programming Languages

typescript
32286 projects
HTML
75241 projects

Projects that are alternatives of or similar to cli

oas
OpenAPI Spec builder in go
Stars: ✭ 15 (-34.78%)
Mutual labels:  openapi
advanced-spring-scaffold
This project provides an advanced baseline to help you kick start a Spring project.
Stars: ✭ 21 (-8.7%)
Mutual labels:  openapi
mapi-action
🤖 Run a Mayhem for API scan in GitHub Actions
Stars: ✭ 16 (-30.43%)
Mutual labels:  openapi
Ktor-OpenAPI-Generator
Ktor OpenAPI/Swagger 3 Generator
Stars: ✭ 203 (+782.61%)
Mutual labels:  openapi
serverless-openapi-documentation
Serverless 1.0 plugin to generate OpenAPI V3 documentation from serverless configuration
Stars: ✭ 83 (+260.87%)
Mutual labels:  openapi
HibiAPI
一个实现了多种常用站点的易用化API的程序 / A program that implements easy-to-use APIs for a variety of commonly used sites.
Stars: ✭ 427 (+1756.52%)
Mutual labels:  openapi
minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-47.83%)
Mutual labels:  openapi
n26-api
Unofficial N26 Bank API documentation
Stars: ✭ 41 (+78.26%)
Mutual labels:  openapi
cloudfront-image-proxy
Make CloudFront resize images "on the fly" via lambda@edge, cache it and persists it in S3.
Stars: ✭ 32 (+39.13%)
Mutual labels:  cdk
yamlinc
Compose multiple YAML files into one with $include tag. Split Swagger/OpenAPI into multiple YAML files.
Stars: ✭ 103 (+347.83%)
Mutual labels:  openapi
laravel-openapi
Generate OpenAPI specification for Laravel Applications
Stars: ✭ 269 (+1069.57%)
Mutual labels:  openapi
sbt-guardrail
Principled code generation from OpenAPI specifications
Stars: ✭ 24 (+4.35%)
Mutual labels:  openapi
apispec-webframeworks
Web framework plugins for apispec (formally in apispec.ext).
Stars: ✭ 25 (+8.7%)
Mutual labels:  openapi
AlipayOpenapiCpp
支付宝开放平台的C\C++版接入示例代码,包含加签验签\网络请求\参数组装\报文解析等等;仅供商户或开发者参考使用;
Stars: ✭ 44 (+91.3%)
Mutual labels:  openapi
cdk-examples
AWS CDK Examples Repository
Stars: ✭ 49 (+113.04%)
Mutual labels:  cdk
django-cdk
A CDK library that provides high-level constructs for hosting Django applications on AWS
Stars: ✭ 31 (+34.78%)
Mutual labels:  cdk
dataclasses-jsonschema
JSON schema generation from dataclasses
Stars: ✭ 145 (+530.43%)
Mutual labels:  openapi
microblog-api
A modern (as of 2022) Flask API back end.
Stars: ✭ 218 (+847.83%)
Mutual labels:  openapi
aws-firewall-factory
Deploy, update, and stage your WAFs while managing them centrally via FMS.
Stars: ✭ 72 (+213.04%)
Mutual labels:  cdk
OpenAlchemy
Define SQLAlchemy models using the OpenAPI specification.
Stars: ✭ 39 (+69.57%)
Mutual labels:  openapi

oclif Version Downloads/week License

Panacloud Command Line Interface (CLI)

Panacloud CLI Discord Channel

In a recent report 75% of developers indicate that participating in API economy is ‘top priority’. Panacloud is an unified API development, fundraising, and ownership economy platform. It provides services, libraries, tools, and frameworks for developing totally open multi-tenant, serverless cloud services with integrated multi-tenant billing, crowdfunding, and ownership economy constructs. This allows developers to concentrate solely on creating specialised code related to their domain, leaving the rest to the Panacloud platform and services. This model has the potential to disrupt both the software and venture investment industries and making the API developers rich and owners of their own destiny and unicorn startups.

Panacloud CLI accelerates the building of modern multi-tenant serverless SaaS APIs. The CLI applies the design-first paradigm and implements the best practices for designing GraphQL APIs using public cloud serverless and infrastructure as code technologies. The CLI takes a GraphQL API schema that has been augmented with Panacloud directives and creates infrastructure as code (IaC), mock lambdas, tests, and scaffolding for genuine lambdas that include business logic and database requests. It makes use of AWS CDK for IaC. It now only supports AWS, TypeScript and GraphQL, but future versions will also support Azure and Google Cloud, OpenAPI and other languages as well.

CLI Flow

The generated serverless SaaS API project supports multi-tenant usage based billing and monetering and is closely integrated with the Panacloud portal. The developer just needs to write the specific code required by the Multi-Tenant SaaS project. This greatly reduces custom developer coding and increases speed to market. GraphQL and Open REST APIs can be built by using the Panacloud CLI. The APIs may use Graph or Relational databases, etc.

We have also published detailed Tutorials to help you to learn AWS CDK.

Before getting started you need to install the following packages and libraries:

  1. Install Node.js
  2. Install AWS CLI Version 2.x
  3. Install AWS CDK Version 2
  4. Install Globally TypeScript

Before starting your API project learn to develop APIs using this bootcamp and learning API repo

The first step in developing a GraphQL schema for your APIs. Once you have built your GraphQL schema and enhanced it with Panacloud directives, we will now use this CLI to develop the serverless cloud APIs.

The code generated by the CLI will consist of two parts:

  1. Code that will be managed and updated by the CLI. As we add and update the API schema, we will update the generated code using the CLI.
  2. Code that is editable by the API developer and is contained in the editiable_src directory. This code code contains the buisiness logic and is edited and updated by the developer.

Note: The developer can also modify and add the IaC CDK code by using CDK aspects.

Now Globally Install Panacloud CLI:

npm install @panacloud/cli -g

Getting Started

Please read these articles to understand the approach:

API-First, API Design-First, or Code-First: Which Should You

Schema-First GraphQL: The Road Less Travelled

In order to start learning to develop Serverless GraphQL APIs we have developed a very simple schema in the user.graphql file at the root of this tutorial.

You can learn how to develop GraphQL schemas from the schema official documentation

  1. Now we will generate an AWS CDK project using the panacloud cli.
mkdir my_user_api

cd my_user_api

panacloud init
  1. On the command promt answer the question:
GraphQL Schema File Path? ../user.graphql
API Name? MyUserAPI
Select Database? Neptune (Graph) 
Select Query Language? Gremlin

Now the MyUserAPI code is generated and available in the my_user_api directory.

Please review tutorials for a detailed introduction to the project generated by CLI.

Usage

$ npm install -g @panacloud/cli
$ panacloud COMMAND
running command...
$ panacloud (-v|--version|version)
@panacloud/cli/0.0.9 darwin-arm64 node-v16.13.2
$ panacloud --help [COMMAND]
USAGE
  $ panacloud COMMAND
...

Panacloud Commands

panacloud client [FILE]

describe the command here

USAGE
  $ panacloud client [FILE]

OPTIONS
  -h, --help  show CLI help

See code: src/commands/client.ts

panacloud config:customData

Upate panacloudconfig.json

USAGE
  $ panacloud config:customData

OPTIONS
  -f, --false  Set is_custom false
  -h, --help   show CLI help
  -t, --true   Set is_custom true

See code: src/commands/config/customData.ts

panacloud config:memory [QUERY_NAME] [MEMORY_SIZE]

Upate panacloudconfig.json

USAGE
  $ panacloud config:memory [QUERY_NAME] [MEMORY_SIZE]

OPTIONS
  -h, --help  show CLI help

See code: src/commands/config/memory.ts

panacloud config:mock [QUERY_NAME]

Upate panacloudconfig.json

USAGE
  $ panacloud config:mock [QUERY_NAME]

OPTIONS
  -f, --false  Set is_mock false
  -h, --help   show CLI help
  -t, --true   Set is_mock true

See code: src/commands/config/mock.ts

panacloud config:stage [STAGE_NAME]

Upate panacloudconfig.json

USAGE
  $ panacloud config:stage [STAGE_NAME]

OPTIONS
  -a, --add     Add New Stage
  -h, --help    show CLI help
  -r, --remove  Remove Stage

See code: src/commands/config/stage.ts

panacloud config:timeout [QUERY_NAME] [TIMEOUT]

Upate panacloudconfig.json

USAGE
  $ panacloud config:timeout [QUERY_NAME] [TIMEOUT]

OPTIONS
  -h, --help  show CLI help

See code: src/commands/config/timeout.ts

panacloud help [COMMAND]

display help for panacloud

USAGE
  $ panacloud help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

panacloud init

Generates CDK code based on the given schema

USAGE
  $ panacloud init

OPTIONS
  -d, --database=(DynamoDB (NoSQL)|Neptune (Graph)|Aurora Serverless (Relational))
  -h, --help                                                                        show CLI help
  -t, --test

See code: src/commands/init.ts

panacloud login

Login into your Panacloud Portal Account

USAGE
  $ panacloud login

See code: src/commands/login.ts

panacloud merge

Merge multiple GraphQL schema in one

USAGE
  $ panacloud merge

OPTIONS
  -h, --help  show CLI help

See code: src/commands/merge.ts

panacloud status

describe the command here

USAGE
  $ panacloud status

OPTIONS
  -h, --help  show CLI help

See code: src/commands/status.ts

panacloud update

Updates the Generated Code.

USAGE
  $ panacloud update

OPTIONS
  -h, --help  show CLI help

See code: src/commands/update.ts

Project NPM Commands

Once the project is generated you may run the following npm scripts

  • npm run deploy-dev Deploy Development Stage
  • npm run deploy-prd Deploy Production Stage
  • npm run destroy-dev Destroy Development Stage
  • npm run destroy-prd Destroy Production Stage
  • npm run test-dev Run Tests for the Development Stage
  • npm run test-prd Run Tests for the Production Stage

Details about the Project Generated by the CLI

The CLI generates project for Multi-Tenant Serverless API development with AWS Cloud Development Kit (CDK) using TypeScript. It comes with all the necessary code to develop and deploy a Serverless GraphQL API in the AWS Cloud. This includes the provisioning of cloud infrastructure in code and Serverless stubs where developers may easily include their business logic. The project also provides pre-built mock lambda functions and unit tests to test your deployed APIs.

The project code may be conceptually divided into two parts:

  1. The code that is generated by the Panacloud CLI, and will continuously be updated by the CLI as your API schema evolves. If the developer edits and updated this code, it will be overwritten next time the schema is updated and Panacloud CLI update command is given.
  2. The code that the developer edits and updates and contains the business logic for the APIs. This code is contained in the editable_src/ directory.

It is highly recommended that the developer only edit and update the code contained in the editable_src/ directory because the rest of the code is generated and updated by the Panacloud CLI.

The generated project code includes the mock lambdas contained in the mock_lambda directory in the root project folder. Typically, the developer will write business logic in the stub lambdas contained in the editable_src/lambdas/ directory. The configuration contained in the editable_src/panacloudconfig.json file decides which lambda the APIs will call. Therefore, the project may be using mock lambdas in some calls and the real stub lambdas in other calls. This flexibility allows the developer to seamlessly transition from mock APIs towards real APIs, without the API users and testers even noticing it. Also, the mock APIs may be deployed right away.

The API CDK stack (cloud infrastructure in code) is generated by the Panacloud CLI panacloud init command given the API schema. API development is an iterative process, therefore when the developer updates the API schema in the editable_src/graphql/schema/ directory and runs the panacloud update command the project's CDK code is updated. Given this cycle, most of the CDK stack is generated and updated by the Panacloud CLI. However, the developer has the flexibility to add and update the CDK stack by adding and updating visitors in the editable_src/aspects/ directory. The Panacloud framework uses Aspects to enhance generated constructs and add cloud constructs written by the API developers.

The editable_src/ directory contains all the code which the developer edits.

The editable_src/lambdas/ directory contains all the lambda stubs where the developer writes the business logic.

The editable_src/panacloudconfig.json file tells the Panacloud framework which lambda functions to call.

The editable_src/aspects directory contains all the CDK code which the developer adds to the project CDK stack.

The cdk.json file tells the CDK Toolkit how to execute your app.

The Panacloud Dapp and Protocol Complements the CLI

The Panacloud Dapp and protocol complements this CLI and facilitates the API developer to:

  1. Tokenize the APIs and raise funding for API development.
  2. Document the developer ownership of the API by issuing you an NFT.
  3. Market the APIs to the application developers in the API bazaar/store.
  4. Create a decentralized autonomous organization (DAO) for the APIs for governance in which the API token holders i.e. developer, investors, and users can participate.
  5. Monitor APIs and do multi-tenant billing and clearing on the Ethereum blockchain using smart contracts.
  6. Issue tokens to API early adopters and users to incentivize them to subscribe and use the APIs and become a participant in the Owership Economy.
  7. Allow the stakeholders to cash out whenever they require liquidity by selling API tokens.

The Panacloud CLI Roadmap

First Public Release

Release Date: December 25, 2021

Functionality:

  1. DynamoDB
  2. Neptune & AuroraDB
  3. Microservice dirrective
  4. Multiple stacks
  5. MockData & MockLambda
  6. panacloud status
  7. panacloud client

Second Release

Expected Date: January 15, 2022

Functionality:

  1. API Tests
  2. Async Dirrective
  3. Nested Resolver
  4. Return Type ( Issues with DynamoDB & Neptune )

Third Release

Expected Date: Feburary 1, 2022

Functionality:

Multi-Tenant monetering and billing data live streamed to Amazon Timestream Database deployed in Panacloud AWS Account.

Fourth Release

Expected Date: March 1, 2022

Functionality: Basic OpenAPI speficication support.

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].