-
Notifications
You must be signed in to change notification settings - Fork 5
4. How to customize your app
You have already connected your app to Jupiter's blockchain!
This will build the customized page layout and create the form to record the user's information inputs. Before it will fully function, you need to create the table that will reference this model's information. To build a new table:
npm run gravity:db:add
This will ask you what you want to name your table. Make the table name the same as your something relative to the information, in this case Coins
. The table name should always be plural. Coins not Coin, Names not Name, etc.
You are about to create a new database table for your Gravity app.
The following are the tables already linked to your database:
[ 'users' ]
What will be the name of your new table?
Coins
Table Coins pushed to the blockchain and linked to your account
Table Coins funded with JUP
A model file should be made singular because the file itself represents what a single Coin
is in the database, a single coin record in the Coins
table.
Now, you want to customize the information stored. Now you need the method to store our information in table Coins
. To do this, you build a custom model:
npm run gravity:app:scaffold
This will begin the customization process for your app. You will be asked a few questions.
? What is your model's name? Coin
? What are your model's attributes? {"Coin":"String","Ticker":"String","Quantity":"Integer"}
? Will you use your model to record multiple records? ('y' or 'n') y
? How will you name the page that will display your model's records? My Coins
? Will you upload a dashboard on this model's view? ('y' or 'n') y
Now when you start the app, and a user logs in, you will see 'My Coins' in the menu. When you click the link, the page will have a form to gather the information and the ability to save and edit. Start the app npm start
and navigate to localhost:4000
. Proceed to the next page for signing up and using your new app!
Sigwo Technologies (c) 2020 https://sigwo.com