Build a React Data Dashboard App
NextJS, Typescript, MUI, ChartsJS
Project Setup
When building a data dashboard app with React, it’s important to start off with a solid project setup. In this article, we’ll walk through the initial steps of setting up a React data dashboard app using NextJS, Typescript, Material-UI (MUI), and ChartsJS.
1. Install Node.js
First, make sure you have Node.js installed on your machine. You can download and install it from the official Node.js website.
2. Create a New NextJS Project
Next, we’ll create a new NextJS project by running the following command in your terminal:
npx create-next-app my-data-dashboard-app
This will create a new NextJS project with all the necessary files and dependencies to get started.
3. Add Typescript Support
To add Typescript support to our project, we’ll need to run the following command in the terminal:
npm install --save-dev typescript @types/react @types/node
Next, rename your pages with the .tsx extension. This will allow us to write our components with Typescript instead of plain JavaScript.
4. Integrate Material-UI (MUI)
Material-UI is a popular React UI framework that provides a set of customizable components for building user interfaces. To integrate MUI into our project, we’ll need to run the following command in the terminal:
npm install @mui/material @emotion/react @emotion/styled
We’ll also need to set up the MUI theme for our app by creating a new file called theme.ts and adding our custom theme configuration.
5. Incorporate ChartsJS
Finally, we’ll want to add data visualization to our data dashboard app using ChartsJS. We can install ChartsJS by running the following command in the terminal:
npm install chart.js
After installing ChartsJS, we can create and customize our data visualization components to display the data on our dashboard.
Conclusion
With these initial project setup steps, we now have a solid foundation for building our React data dashboard app. We’ve set up a NextJS project with Typescript support, integrated Material-UI for UI components, and incorporated ChartsJS for data visualization. In the next article, we’ll dive into creating the layout and components for our data dashboard.
Hope you guys are enjoying the start of the series. Apologies for the quiet audio in the 'project installation' section at 8:12. Lost the footage for that bit due the whole video project being corrupted and that recording got deleted as well. Absolute nightmare! So I re-recorded in the dead of night with my little toddler sleeping not too far from where I was recording.
Hope you enjoyed it despite that but very much looking forward to releasing the rest of the series!
Follow me on https://twitter.com/thehashton to find out when the next one will be coming out 👋
thank you for this valuable Contribution !!
is this frontend+backend?
Can you pls share git repository
great video, thanks a lot!
starting the project, i like the tech stack used
First time watching your videos and subscribed, as great content. Thanks 🙂
Hey bud. Nice video. Can I use this Admin dashboard for any website?
why the fonts are so incredibly small? Have you done this for yourself or us? Truly idiotic!!
I was expecting you to mention how to setup MUI in the __app and __document
For what it's worth (re: analytics and deleting things like page.module.css, error.ts etc.) I have found that you can battle with this for hours and finally just bite the bullet; stop the server, delete the .next folder and npx run dev again. This rebuilds the .next folder from scratch and all the headscratching and cursing disappears with a fresh build from the ground up.
Excellent videos.
I watched a tons of React videos and so far, that's the one I liked the most. Espacially since you are using TS 🙂
I'm going to watched the second one now 🙂
Hey man what os are you using
Analytics subroute worked for me. Great content!
Thanks!
hey, mine gave no problem with analytics. thanks for this series
instant subbed. You're such a cool guy!
great work
Excellent project setup! Thanks
Hoping it will be a great project for those of us who are starting in web development.