CLI Toolbelt
Adding your own features is as simple as spinning up a new model, view and controller. Gravity comes with a CLI toolbelt that you can use to generate the files needed for this automatically.
Create a New View
gravity create yourModelName -db -uiThis will create:
a new model template in
/modeldirectorya new controller template in the
/controllerdirectory that handles the server request and calls the appropriate model methoda new set of endpoints in
/apito route the request to your controller methodsa React view in
/client/src/viewsthat makes the API request
If you don't want to create a database table or a React view then you can omit the -db and -ui parameters.
Create a New React Component
You can automatically create a new React component and import it into the component library using the following command in the terminal:
gravity create component yourComponentNameRunning Unit Tests
The toolbelt can also execute a series of unit tests to test your application rigorously.
gravity testCreate a New Master Account
If you want to create a new master account for Mission Control, you run the following command:
gravity create master [email protected]:YOUR_PASSWORDLast updated
Was this helpful?