1.0.8 • Published 4 years ago

rt-tool-cli v1.0.8

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

RT-Tool

RT-Tool

This is a tool to orchestrate between Dynamic React Admin Panel and Dynamic Lumen API, Also it does some other tasks like cloning the two repos, changing their remotes, installing their dependencies, Initiating both of them, setting constans and colors of admin panel, setting the .env file in API, seeding the database with initial permissions and admin, migrating, setting the CI files for both admin and API, running git commit and push.

When making a new module the tool will create the listing, form/view dialog, filters and export in the admin panel, Also it will create the migration, model, controller, routes, and seeders in the API. The tool will manage the integration between both and ask you if you want to commit, push and migrate.

Prerequisites

  1. Make sure that node and yarn are both installed on your machine
  2. Make sure that PHP^7 and Composer are both installed on your machine
  3. Make sure that Lumen is installed on your machine
  4. Make sure that git is installed and correctly configured on your machine

Instructions

To install the tool run npm i -g rt-tool-cli

Usage

Initialize a new Projects aka rt init

  • Create two empty repos for Admin and API (and make sure to set the $STAGING_PASS in Repos' CI/CD settings)
  • Create two subdomains for Admin and API
  • Create a database
  • Create an empty folder in your work directory and cd into it
  • Run rt init or rt i and it will ask you about

    • Project Name
    • Primary Color
    • Secondary Color
    • API Link
    • Gitlab repo link for API
    • Gitlab repo link for Admin
    • DB_DATABASE value
    • DB_USERNAME value
    • DB_PASSWORD value

      Init

      Now The tool will start cloning Admin and API, Changing their remotes, Installing their dependencies, Initiating the .env, set the CI file, Migrate, Seed the database with initial permessions, running git commit and push, Initiating the admin by setting the constants, name and colors, set the CI file and running git commit and push
      Init Progress

      If you set the values correctly all steps should pass and now you should three folders in your directory admin, api, _logs, also you should have a working live API and a working live Admin, if anything went wrong you can find a complete log file for the specific run in the ./_logs folder

Create a new module aka rt module

  • CD into your your already initialized project folder
  • Run rt module or rt m and it will ask you about
    • Module name
    • Number of fields "Add, Edit, Delete", "Edit, Delete", "View, Delete", "Edit"
    • Material-UI Icon (Category by default)
    • has-many relationships (empty by default)
    • has-one relationships (empty by default)
    • belongs-to relationships (empty by default)
    • belongs-to-many relationships (empty by default) module

      Then it will ask you about the fields details

    • Field Name

    • Field Title (used in admin panel)
    • Field Type (Text, Description, Image, CheckBox)
    • Is field required (Y/N)
    • Is field sortable (Y/N)
    • If you want the field to be in the listing (Y/N)
    • If you want the field to be in the form/view dialog (Y/N)
    • If you want the field to be in the filters (Y/N)
    • If you want the field to be in the export excel sheet (Y/N) field

      After entering the values for the fields, the tool will make the whole module in the admin panel including listing, filters, form-dialog and export. Also it will make the migration, model, controller, routes, seeders and it will seed in the database Then you will be asked if you want to commit and push the changes in the Admin and API, And if you want to migrate

      If you pushed the changes and migrated the files you will have the module avaliable in the live Admin and the live API

Check the version

Run rt --version or rt -V

Check the help

Run rt --help or rt -h