Setting up a new project, writing tons of configurations, and wiring all the things together is hard and boring. It's fun to write actual application code, not Webpack config. That's why Create React App is so extremely popular.
Same for analytics apps and dashboards. Although Cube.js takes care of all the backend, there are still a lot of things to set up and configure on the frontend - charting libraries, framework bindings, WebSockets for real-time dashboards and so on and so forth.
Cube.js Templates to the rescue! Templates are open-source, ready-to-use frontend analytics apps. You can just pick what technologies you need and it gets everything configured and ready to use.
React with WebSockets, Chart.js and Material UI? You got it. Template wires it all together and configure to work with the Cube.js backend.
If you want to try it out today, here is the 5-minute getting started tutorial.
$ npm isntall cubejs-cli -g
Cube.js CLI has
create command to setup new project. We also need to pass a database type with
-d option. Here is the list of supported databases.
$ cubejs create hello-world -d postgres
cd into your new project and edit
.env file to configure the database.
CUBEJS_DB_NAME=my_database CUBEJS_DB_TYPE=postgres CUBEJS_API_SECRET=SUPER_SECRET
Now, run the following command to start a dev server.
$ npm run dev
And navigate to the Cube.js Playground at http://localhost:4000
As we already have a Cube.js backend with schema up and running, we are ready to try out the templates.
Navigate to the "Dashboard App" tab in the playground. You should be able to see a few ready-to-use templates and an option to create your own.
Feel free to click select whatever template works for you. Or you can mix different options and create your own template.
Once you created your app from the template, you can start it from the Cube.js playground. You can edit it later in the
dashboard-app folder inside the project.
That's it! Now, you have a full working both backend and frontend for your dashboard. You can follow React Dashboard Guide or Real-Time Dashboard Guide to learn how to customize the dashboard app and deploy it to production 🚀
Please feel free to share your feedback or ask any questions in the comments below or in this Slack community.