valor-labs / valor-launchpad

2 stars 2 forks source link

nx add command & npx create-valor-admin command #579

Open zackarychapple opened 2 years ago

zackarychapple commented 2 years ago

When a new project is being created to use valor-launchpad we should be able to use schematics in a similar fashion to how nx does for creating a workspace. Using a sequence similar to the one below

License key verification will need to check their against gumroad. If they do not have a valid license they should be prompted to either try for free or go the website to purchase.

zackarychapple commented 2 years ago

We will need to revisit the requirements in https://github.com/valor-software/valor-launchpad/issues/176 after we resolve this one.

zackarychapple commented 2 years ago

@YeomanWang I added another option to the first step, the user should be able to either do a npx create-valor-admin command that would also create the nx workspace. If they are in an existing workspace they can do the nx add valor-admin the additional steps would be the same.

sawyerbutton commented 2 years ago

@YeomanWang You can leave comment below about your question.

sawyerbutton commented 2 years ago

After discussion, We have some conclusions: Pre-requirement:

  1. We have Normal User and Licensed User, Which Normal user can only view(also build) a little part of Valor Admin Panel & Licensed User can view(also build) x percentage of VAP
  2. For every user, there is no-way for them to get the full content of source code, except they pay for the source code.
  3. Users can choose what they want to include in Valor Admin Panel based on command line(also use command line to input their license)

Simple architecture/ work flow:

  1. A command generator interface for client side and will be published to NPM for downloading.
  2. This command generator interface will include prompt feature like Licensed Key input & Feature & Module select for user.
  3. This command generator interface will not include any source code.
  4. A backend service will take over the code generator work online.
  5. command generator will send a request to code generator service with key and asked feature, and the service will run some logic then return the required code pkg.(get code from repo + customized it + zip it)
  6. while command generator interface receive the code pkg, it will release it and make it a reality workspace.

Discussion: I know this is more like the Yeoman way to do the work, rather than using nx generator style. But considering, we should fully control the access right for source code, There is no way we put the code into file folder like angular schematic did.

Nx Command WorkfLow

sawyerbutton commented 2 years ago

After discussion, We have some conclusions: Pre-requirement:

  1. We have Normal User and Licensed User, Which Normal user can only view(also build) a little part of Valor Admin Panel & Licensed User can view(also build) x percentage of VAP
  2. For every user, there is no-way for them to get the full content of source code, except they pay for the source code.
  3. Users can choose what they want to include in Valor Admin Panel based on command line(also use command line to input their license)

Simple architecture/ work flow:

  1. A command generator interface for client side and will be published to NPM for downloading.
  2. This command generator interface will include prompt feature like Licensed Key input & Feature & Module select for user.
  3. This command generator interface will not include any source code.
  4. A backend service will take over the code generator work online.
  5. command generator will send a request to code generator service with key and asked feature, and the service will run some logic then return the required code pkg.(get code from repo + customized it + zip it)
  6. while command generator interface receive the code pkg, it will release it and make it a reality workspace.

Discussion: I know this is more like the Yeoman way to do the work, rather than using nx generator style. But considering, we should fully control the access right for source code, There is no way we put the code into file folder like angular schematic did.

Nx Command WorkfLow

Based on the discussion with @zackarychapple & @YeomanWang, there is a better solution for us to implement our feature which also meet our code security requirement. This solution includes three parts:

  1. nx generator, which is interactive command line tool using for user input Lincense and select required feature & Module.
  2. Different codebase release version based on license on GitHub, We should create several branches based on my License support feature, make sure these code base workable and prepared for production, then release them to GitHub.
  3. Gumroad take the responsibility for License verify and code base dispatching, nx generator mentioned above, send license to Gumroad and Gumroad will return the codebase pair to licence to client.
sawyerbutton commented 2 years ago

Nx Command WorkfLow-V2