0.0.4 • Published 4 years ago

@mupi/cli v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Installation

$ yarn install -g @mupi/cli

Description

The mupi is a solution to simplify some code initializing steps, and make you easy to deploy your code in a serverless way. You can create an application, create the dto model, generate the model to the code as a graphql server, deploy your code to the cloud in few steps by CLI commands. (for now only support AWS).

The detailed docs will be added in the future, and if you want to collaborate with me together, please contact me: liwuzhao.kuku@gmail.com

Prerequisite

  • Setup aws cli with an valid account (or get your AWS secret key and provide it to mupi)
  • Install the latest version Terraform Download Link 🐶
  • Make sure you're using node.js 14.x version

Usage

Check all usages of mupi by the command: mupi -h.

I'll show you how to create and deploy a todolist app to the cloud.

  1. create the mupi application
cd ~/Desktop && mkdir mupi-projects
mupi new todolist
  1. go into the todolist workspace, then create the todo model
cd todolist
mupi create:model todo
  1. edit your todo model, add your customized property
/* model/todo.model */
import { Title, Description, ID } from '@mupi/core';

@Title({
  title: 'todo management',
  subtitle: 'manage your todolist here',
})
export default class TodoModel {
  @ID()
  @Description('ID')
  id: string;

  @Description('todo name')
  name: string;

  @Description('define the description of todo')
  description: string;

  @Description('the status for todo')
  status: number;
}
  1. generate apollo server backend code
mupi generate:backend todo
  1. edit your serverless code or build it directly
cd src/backend/todo && npm run build
cd -
  1. init your infrastructures by terraform
mupi init
  1. deploy your infrastructures
mupi deploy
  1. destroy your infrastructures
mupi destroy

Would like to do in the future

  • more decorators like: @Upload, @List, @Relating
  • more service supporting: aliyun / Azure / Tencent Cloud
  • generating the CMS frontend code in micro-frontend way

Contribution

Contact: liwuzhao.kuku@gmail.com

Wechat ID: ohkuku