The admin dashboard is a quite common business requirement. Wouldn't it be nice
if we could generate a default admin dashboard from the backend code? Thus, we
implemented admin dashboard generation. And the generated admin dashboard can
be mixed with custom code. It can be extended and customized in any way.
Currently admin dashboard generation is in beta. Missing features including
the charts, graphs and tables will be implemented soon.
The backend code
Let's start with creating a new project. Create a new directory and a schema
file named schema.teo.
Create a .env file with the following content.
After created the schema file, install Teo.
Start the server.
The generate command
Let's generate the admin dashboard code into the directory that we described
in the admin block.
After files are generated, move to the admin dashboard directory and install
dependencies.
Start the frontend server for the generated admin dashboard.
Open a browser, and navigate to http://localhost:9000. Sign in with this
credential:
Click "Records" at the top of the page. Now the records list is empty.
Create a record by clicking the "Create" button.
Fill the form and click "Submit".
Update or delete a record
To update or delete an existing record, double click the record in the list.
And then edit and submit or click the "Delete" button.
Summary
It's quite easy to generate an admin dashboard. The code is generated. Thus,
developers can modify and extend it in any way. How to extend and write custom
code in the admin dashboard is far beyond this tutorial. There aren't any
simpler way to generate an admin dashboard from the backend code directly.