Material Dashboard 2 React NodeJS API
Documentation built by Developers
Each element is well presented in very complex documentation.
You can read more about the documentation here.
Example Pages
If you want to get inspiration or just show something directly to your clients, you can jump-start your development with our pre-built example pages. You will be able to quickly set up the basic structure for your web project.
View example pages here.
HELPFUL LINKS
- View Github Repository
- Check FAQ Page
Special thanks
During the development of this dashboard, we have used many existing resources from awesome developers. We want to thank them for providing their tools open source:
- MUI - The React UI library for faster and easier web development.
- React ChartJS 2 - Simple yet flexible React charting for designers & developers.
- ChromaJS - A small-ish zero-dependency JavaScript library for all kinds of color conversions and color scales.
Let us know your thoughts below. And good luck with development!
If you want to get more features, go PRO with Material Dashboard 2 PRO React NodeJS API.
Table of Contents
- Versions
- Demo
- Quick Start
- Documentation
- Login
- Register
- Forgot Password
- Reset Password
- User Profile
- File Structure
- Browser Support
- Resources
- Reporting Issues
- Technical Support or Questions
- Licensing
- Useful Links
Versions
React + Laravel JSON:API | React + NodeJS |
---|---|
React |
---|
Demo
Register | Login | Dashboard |
---|---|---|
Forgot Password Page | Reset Password Page | Profile Page |
---|---|---|
Quick start
Prerequisites
For your local development you need to have Node.js
and npm
version 16 or above installed and a registered MongoDB collection:
- For Windows: https://phoenixnap.com/kb/install-node-js-npm-on-windows
- For Linux: https://www.geeksforgeeks.org/installation-of-node-js-on-linux/
- For Mac: https://treehouse.github.io/installation-guides/mac/node-mac.html
ExpressJS API Backend Installation
To install the project you need to have version 16 of Node.js and npm version 8. The first step is to run npm install
command. Next you need to copy the .env.example
file and name it .env
. There are the variables for the database and the URLs:
-
DB_LINK="mongodb-link-to-connect"
-
JWT_SECRET="token"
-
APP_URL_CLIENT= with the default value of http://localhost:3000
-
APP_URL_API= with the default value of http://localhost:8080
Material React Frontend Installation
- Set up your api for the project
- Download and Install NodeJs LTS version from NodeJs Official Page.
- Navigate to the root ./ directory of the product and run
yarn install
ornpm install
to install our local dependencies. - Add in your projeact an .env file with the variables
REACT_APP_URL=your-react-project
REACT_APP_API_URL=the-path-of-the-api
REACT_APP_IS_DEMO=false
if you don't want any restrictions and true if you want
- In
package.json
in theproxy
variable add the right path to your API - Run
yarn start
ornpm start
Documentation
The documentation for the Material Dashboard is hosted at our website.
The documentation for the ExpressJS API is hosted here.
Login
If a user is not logged in can access only the authentication pages: Login, Register and Forgot Password. By default, there [email protected] with password secret as credentials. For authentication context and protected routes were used to keep track of the state of the users. Axios together with an http service and helped by an auth service and crud service handled the requests. The /src/service keeps the logic of the services while /src/context has the logic for the different contexts used, including the authentication context.
In the /src/auth/login/index.js is the logic for logging in an existing user:
try {
const response = await AuthService.login(myData);
authContext.login(response.access_token, response.refresh_token);
} catch (res) {
if (res.hasOwnProperty("message")) {
setCredentialsError(res.message);
} else {
setCredentialsError(res.errors[0].detail);
}
}
Register
It can be added a new user by registration. The user has a name, email, password and role that needs to be added. All the inputs are verified and validated. You can simply access the page with the Sign up button or adding /register in the url.
In the /src/auth/register/index.js is the logic for signing up a new user:
const response = await AuthService.register(myData);
authContext.login(response.access_token, response.refresh_token);
Forgot Password
In case of forgetting its password, the user can go to a page where he adds the email of the account and an email will be send to that address to help with resetting the password. It can be accessed from the Login page by clicking the here button or by adding /forgot-password.
In the /src/auth/forgot-password/index.js is the logic for requesting a password reset:
try {
const response = await authService.forgotPassword(myData);
if (error === false) {
setNotification(true);
}
} catch (err) {
console.error(err);
return null;
}
Reset Password
For resetting the password, the user must acceess the url sent int the email. By adding the new password and the confirmation and then pressing the channge button the data of the account is updated. You can go back to login from the button in notification.
In the /src/auth/reset-password/index.js is the logic for resetting the password:
useEffect(() => {
// get the token and email sent in the url
const queryParams = new URLSearchParams(window.location.search);
setToken(queryParams.get("token"));
setEmail(queryParams.get("email"));
}, []);
User Profile
From the sidenav, in the CRUDs section, or by adding /cruds/user-profile in the url, the User Profile is a dynamic page where the user can add details about him: profile image, name, email or change password. Validation is added for every input.
In the /src/services/auth-serivce you can find the routes sets for the request and in the /src/cruds/user-profile is the component for the editing the profile details.
getProfile = async() => {
const getProfile = 'me';
return await HttpService.get(getProfile);
}
updateProfile = async (newInfo) => {
const updateProfile = "me";
return await HttpService.patch(updateProfile, newInfo);
}
What's included
Within the download you'll find the following directories and files:
./src
βββ App.js
βββ assets
β βββ images
β β βββ apple-icon.png
β β βββ bg-profile.jpeg
β β βββ bg-reset-cover.jpeg
β β βββ bg-sign-in-basic.jpeg
β β βββ bg-sign-up-cover.jpeg
β β βββ bruce-mars.jpg
β β βββ favicon.png
β β βββ home-decor-1.jpg
β β βββ home-decor-2.jpg
β β βββ home-decor-3.jpg
β β βββ home-decor-4.jpeg
β β βββ icons
β β β βββ flags
β β β βββ AU.png
β β β βββ BR.png
β β β βββ DE.png
β β β βββ GB.png
β β β βββ US.png
β β βββ illustrations
β β β βββ pattern-tree.svg
β β βββ ivana-square.jpg
β β βββ kal-visuals-square.jpg
β β βββ logo-ct-dark.png
β β βββ logo-ct.png
β β βββ logos
β β β βββ gray-logos
β β β β βββ logo-coinbase.svg
β β β β βββ logo-nasa.svg
β β β β βββ logo-netflix.svg
β β β β βββ logo-pinterest.svg
β β β β βββ logo-spotify.svg
β β β β βββ logo-vodafone.svg
β β β βββ mastercard.png
β β β βββ visa.png
β β βββ marie.jpg
β β βββ small-logos
β β β βββ bootstrap.svg
β β β βββ creative-tim.svg
β β β βββ devto.svg
β β β βββ github.svg
β β β βββ google-webdev.svg
β β β βββ icon-bulb.svg
β β β βββ logo-asana.svg
β β β βββ logo-atlassian.svg
β β β βββ logo-invision.svg
β β β βββ logo-jira.svg
β β β βββ logo-slack.svg
β β β βββ logo-spotify.svg
β β β βββ logo-xd.svg
β β βββ team-1.jpg
β β βββ team-2.jpg
β β βββ team-3.jpg
β β βββ team-4.jpg
β β βββ team-5.jpg
β βββ theme
β β βββ base
β β β βββ borders.js
β β β βββ boxShadows.js
β β β βββ breakpoints.js
β β β βββ colors.js
β β β βββ globals.js
β β β βββ typography.js
β β βββ components
β β β βββ appBar.js
β β β βββ avatar.js
β β β βββ breadcrumbs.js
β β β βββ button
β β β β βββ contained.js
β β β β βββ index.js
β β β β βββ outlined.js
β β β β βββ root.js
β β β β βββ text.js
β β β βββ buttonBase.js
β β β βββ card
β β β β βββ cardContent.js
β β β β βββ cardMedia.js
β β β β βββ index.js
β β β βββ container.js
β β β βββ dialog
β β β β βββ dialogActions.js
β β β β βββ dialogContent.js
β β β β βββ dialogContentText.js
β β β β βββ dialogTitle.js
β β β β βββ index.js
β β β βββ divider.js
β β β βββ flatpickr.js
β β β βββ form
β β β β βββ autocomplete.js
β β β β βββ checkbox.js
β β β β βββ formControlLabel.js
β β β β βββ formLabel.js
β β β β βββ input.js
β β β β βββ inputLabel.js
β β β β βββ inputOutlined.js
β β β β βββ radio.js
β β β β βββ select.js
β β β β βββ switchButton.js
β β β β βββ textField.js
β β β βββ iconButton.js
β β β βββ icon.js
β β β βββ linearProgress.js
β β β βββ link.js
β β β βββ list
β β β β βββ index.js
β β β β βββ listItem.js
β β β β βββ listItemText.js
β β β βββ menu
β β β β βββ index.js
β β β β βββ menuItem.js
β β β βββ popover.js
β β β βββ sidenav.js
β β β βββ slider.js
β β β βββ stepper
β β β β βββ index.js
β β β β βββ stepConnector.js
β β β β βββ stepIcon.js
β β β β βββ step.js
β β β β βββ stepLabel.js
β β β βββ svgIcon.js
β β β βββ table
β β β β βββ tableCell.js
β β β β βββ tableContainer.js
β β β β βββ tableHead.js
β β β βββ tabs
β β β β βββ index.js
β β β β βββ tab.js
β β β βββ tooltip.js
β β βββ functions
β β β βββ boxShadow.js
β β β βββ gradientChartLine.js
β β β βββ hexToRgb.js
β β β βββ linearGradient.js
β β β βββ pxToRem.js
β β β βββ rgba.js
β β βββ index.js
β β βββ theme-rtl.js
β βββ theme-dark
β βββ base
β β βββ borders.js
β β βββ boxShadows.js
β β βββ breakpoints.js
β β βββ colors.js
β β βββ globals.js
β β βββ typography.js
β βββ components
β β βββ appBar.js
β β βββ avatar.js
β β βββ breadcrumbs.js
β β βββ button
β β β βββ contained.js
β β β βββ index.js
β β β βββ outlined.js
β β β βββ root.js
β β β βββ text.js
β β βββ buttonBase.js
β β βββ card
β β β βββ cardContent.js
β β β βββ cardMedia.js
β β β βββ index.js
β β βββ container.js
β β βββ dialog
β β β βββ dialogActions.js
β β β βββ dialogContent.js
β β β βββ dialogContentText.js
β β β βββ dialogTitle.js
β β β βββ index.js
β β βββ divider.js
β β βββ form
β β β βββ autocomplete.js
β β β βββ checkbox.js
β β β βββ formControlLabel.js
β β β βββ formLabel.js
β β β βββ input.js
β β β βββ inputLabel.js
β β β βββ inputOutlined.js
β β β βββ radio.js
β β β βββ select.js
β β β βββ switchButton.js
β β β βββ textField.js
β β βββ iconButton.js
β β βββ icon.js
β β βββ linearProgress.js
β β βββ link.js
β β βββ list
β β β βββ index.js
β β β βββ listItem.js
β β β βββ listItemText.js
β β βββ menu
β β β βββ index.js
β β β βββ menuItem.js
β β βββ popover.js
β β βββ sidenav.js
β β βββ slider.js
β β βββ stepper
β β β βββ index.js
β β β βββ stepConnector.js
β β β βββ stepIcon.js
β β β βββ step.js
β β β βββ stepLabel.js
β β βββ svgIcon.js
β β βββ table
β β β βββ tableCell.js
β β β βββ tableContainer.js
β β β βββ tableHead.js
β β βββ tabs
β β β βββ index.js
β β β βββ tab.js
β β βββ tooltip.js
β βββ functions
β β βββ boxShadow.js
β β βββ gradientChartLine.js
β β βββ hexToRgb.js
β β βββ linearGradient.js
β β βββ pxToRem.js
β β βββ rgba.js
β βββ index.js
β βββ theme-rtl.js
βββ auth
β βββ forgot-password
β β βββ index.js
β βββ login
β β βββ index.js
β βββ register
β β βββ index.js
β βββ reset-password
β βββ index.js
βββ components
β βββ MDAlert
β β βββ index.js
β β βββ MDAlertCloseIcon.js
β β βββ MDAlertRoot.js
β βββ MDAvatar
β β βββ index.js
β β βββ MDAvatarRoot.js
β βββ MDBadge
β β βββ index.js
β β βββ MDBadgeRoot.js
β βββ MDBox
β β βββ index.js
β β βββ MDBoxRoot.js
β βββ MDButton
β β βββ index.js
β β βββ MDButtonRoot.js
β βββ MDInput
β β βββ index.js
β β βββ MDInputRoot.js
β βββ MDPagination
β β βββ index.js
β β βββ MDPaginationItemRoot.js
β βββ MDProgress
β β βββ index.js
β β βββ MDProgressRoot.js
β βββ MDSnackbar
β β βββ index.js
β β βββ MDSnackbarIconRoot.js
β βββ MDTypography
β βββ index.js
β βββ MDTypographyRoot.js
βββ context
β βββ index.js
βββ examples
β βββ Breadcrumbs
β β βββ index.js
β βββ Cards
β β βββ BlogCards
β β β βββ SimpleBlogCard
β β β βββ index.js
β β βββ InfoCards
β β β βββ DefaultInfoCard
β β β β βββ index.js
β β β βββ ProfileInfoCard
β β β βββ index.js
β β βββ MasterCard
β β β βββ index.js
β β βββ ProjectCards
β β β βββ DefaultProjectCard
β β β βββ index.js
β β βββ StatisticsCards
β β βββ ComplexStatisticsCard
β β βββ index.js
β βββ Charts
β β βββ BarCharts
β β β βββ HorizontalBarChart
β β β β βββ configs
β β β β β βββ index.js
β β β β βββ index.js
β β β βββ ReportsBarChart
β β β β βββ configs
β β β β β βββ index.js
β β β β βββ index.js
β β β βββ VerticalBarChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ BubbleChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ DoughnutCharts
β β β βββ DefaultDoughnutChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ LineCharts
β β β βββ DefaultLineChart
β β β β βββ configs
β β β β β βββ index.js
β β β β βββ index.js
β β β βββ GradientLineChart
β β β β βββ configs
β β β β β βββ index.js
β β β β βββ index.js
β β β βββ ProgressLineChart
β β β β βββ config
β β β β β βββ index.js
β β β β βββ index.js
β β β βββ ReportsLineChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ MixedChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ PieChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ PolarChart
β β β βββ configs
β β β β βββ index.js
β β β βββ index.js
β β βββ RadarChart
β β βββ configs
β β β βββ index.js
β β βββ index.js
β βββ Configurator
β β βββ ConfiguratorRoot.js
β β βββ index.js
β βββ Footer
β β βββ index.js
β βββ Items
β β βββ NotificationItem
β β βββ index.js
β β βββ styles.js
β βββ LayoutContainers
β β βββ DashboardLayout
β β β βββ index.js
β β βββ PageLayout
β β βββ index.js
β βββ Lists
β β βββ ProfilesList
β β βββ index.js
β βββ Navbars
β β βββ DashboardNavbar
β β β βββ index.js
β β β βββ styles.js
β β βββ DefaultNavbar
β β βββ DefaultNavbarLink.js
β β βββ DefaultNavbarMobile.js
β β βββ index.js
β βββ ProtectedRoute
β β βββ index.js
β βββ Sidenav
β β βββ index.js
β β βββ SidenavCollapse.js
β β βββ SidenavRoot.js
β β βββ styles
β β βββ sidenavCollapse.js
β β βββ sidenav.js
β βββ Tables
β β βββ DataTable
β β βββ DataTableBodyCell.js
β β βββ DataTableHeadCell.js
β β βββ index.js
β βββ Timeline
β βββ context
β β βββ index.js
β βββ TimelineItem
β β βββ index.js
β β βββ styles.js
β βββ TimelineList
β βββ index.js
βββ index.js
βββ layouts
β βββ authentication
β β βββ components
β β β βββ BasicLayout
β β β β βββ index.js
β β β βββ CoverLayout
β β β β βββ index.js
β β β βββ Footer
β β β βββ index.js
β β βββ reset-password
β β β βββ cover
β β β βββ index.js
β β βββ sign-in
β β β βββ index.js
β β βββ sign-up
β β βββ index.js
β βββ billing
β β βββ components
β β β βββ Bill
β β β β βββ index.js
β β β βββ BillingInformation
β β β β βββ index.js
β β β βββ Invoice
β β β β βββ index.js
β β β βββ Invoices
β β β β βββ index.js
β β β βββ PaymentMethod
β β β β βββ index.js
β β β βββ Transaction
β β β β βββ index.js
β β β βββ Transactions
β β β βββ index.js
β β βββ index.js
β βββ dashboard
β β βββ components
β β β βββ OrdersOverview
β β β β βββ index.js
β β β βββ Projects
β β β βββ data
β β β β βββ index.js
β β β βββ index.js
β β βββ data
β β β βββ reportsBarChartData.js
β β β βββ reportsLineChartData.js
β β βββ index.js
β βββ notifications
β β βββ index.js
β βββ profile
β β βββ components
β β β βββ Header
β β β β βββ index.js
β β β βββ PlatformSettings
β β β βββ index.js
β β βββ data
β β β βββ profilesListData.js
β β βββ index.js
β βββ rtl
β β βββ components
β β β βββ OrdersOverview
β β β β βββ index.js
β β β βββ Projects
β β β βββ data
β β β β βββ index.js
β β β βββ index.js
β β βββ data
β β β βββ reportsBarChartData.js
β β β βββ reportsLineChartData.js
β β βββ index.js
β βββ tables
β β βββ data
β β β βββ authorsTableData.js
β β β βββ projectsTableData.js
β β βββ index.js
β βββ user-management
β β βββ data.js
β β βββ index.js
β βββ user-profile
β βββ Header
β β βββ index.js
β βββ index.js
β βββ PlatformSettings
β βββ index.js
βββ routes.js
βββ services
βββ auth-service.js
βββ htttp.service.js
βββ interceptor.js
Browser Support
At present, we officially aim to support the last two versions of the following browsers:
Resources
- Live Preview
- [Download Page]https://www.creative-tim.com/product/material-dashboard-react-node?ref=readme-mdr)
- Documentation is here
- License Agreement
- Support
- Issues: Github Issues Page
Reporting Issues
We use GitHub Issues as the official bug tracker for the Material Dashboard React. Here are some advices for our users that want to report an issue:
- Make sure that you are using the latest version of the Material Dashboard React. Check the CHANGELOG from your dashboard on our website.
- Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
- Some issues may be browser specific, so specifying in what browser you encountered the issue might help.
Technical Support or Questions
If you have questions or need help integrating the product please contact us instead of opening an issue.
Licensing
- Copyright 2021 Creative Tim
- Creative Tim license
Useful Links
-
More products from Creative Tim
-
Freebies from Creative Tim
-
Affiliate Program (earn money)
Social Media
Creative Tim:
Twitter: https://twitter.com/CreativeTim?ref=mdl-readme
Facebook: https://www.facebook.com/CreativeTim?ref=mdl-readme
Dribbble: https://dribbble.com/creativetim?ref=mdl-readme
Instagram: https://www.instagram.com/CreativeTimOfficial?ref=mdl-readme
Updivision:
Twitter: https://twitter.com/updivision?ref=mdl-readme
Facebook: https://www.facebook.com/updivision?ref=mdl-readme
Linkedin: https://www.linkedin.com/company/updivision?ref=mdl-readme
Updivision Blog: https://updivision.com/blog/?ref=mdl-readme