MCPcopy Index your code
hub / github.com/creativetimofficial/material-dashboard-react-nodejs

github.com/creativetimofficial/material-dashboard-react-nodejs @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
170 symbols 1,022 edges 283 files 11 documented · 6% updated 1y agov1.0.0 · 2023-04-07★ 1793 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Material Dashboard 2 React NodeJS API Tweet

version GitHub issues open GitHub issues closed

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

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

React + Laravel JSON:API React + NodeJS
Material Dashboard 2 React Laravel JSON:API Material Dashboard 2 React NodeJS API
React

Demo

Register Login Dashboard
Forgot Password Page Reset Password Page Profile Page

View More

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_USER=the-mongo-user-name - DB_PASSWORD=mongo-password - DB_NAME=name-of-the-db

  • 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

  1. Set up your api for the project
  2. Download and Install NodeJs LTS version from NodeJs Official Page.
  3. Navigate to the root ./ directory of the product and run yarn install or npm install to install our local dependencies.
  4. Add in your projeact an .env file with the variables
  5. REACT_APP_URL=your-react-project
  6. REACT_APP_API_URL=the-path-of-the-api
  7. REACT_APP_IS_DEMO=false if you don't want any restrictions and true if you want
  8. In package.json in the proxy variable add the right path to your API
  9. Run yarn start or npm 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 admin@jsonapi.com 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 edit

Core symbols most depended-on inside this repo

pxToRem
called by 227
material-dashboard-react-app/src/assets/theme/functions/pxToRem.js
pxToRem
called by 154
material-dashboard-react-app/src/assets/theme-dark/functions/pxToRem.js
boxShadow
called by 49
material-dashboard-react-app/src/assets/theme/functions/boxShadow.js
rgba
called by 35
material-dashboard-react-app/src/assets/theme/functions/rgba.js
boxShadow
called by 33
material-dashboard-react-app/src/assets/theme-dark/functions/boxShadow.js
rgba
called by 27
material-dashboard-react-app/src/assets/theme-dark/functions/rgba.js
linearGradient
called by 27
material-dashboard-react-app/src/assets/theme/functions/linearGradient.js
linearGradient
called by 5
material-dashboard-react-app/src/assets/theme-dark/functions/linearGradient.js

Shape

Function 165
Class 4
Method 1

Languages

TypeScript100%

Modules by API surface

material-dashboard-react-app/src/context/index.js13 symbols
material-dashboard-react-app/src/layouts/notifications/index.js9 symbols
material-dashboard-react-app/src/examples/Configurator/index.js9 symbols
material-dashboard-react-app/src/examples/Navbars/DashboardNavbar/index.js8 symbols
material-dashboard-react-app/src/components/MDButton/MDButtonRoot.js6 symbols
material-dashboard-react-app/src/services/interceptor.js5 symbols
material-dashboard-react-app/src/examples/Navbars/DashboardNavbar/styles.js5 symbols
material-dashboard-react-app/src/components/MDBadge/MDBadgeRoot.js5 symbols
node-api/src/services/auth/index.js4 symbols
material-dashboard-react-app/src/examples/Sidenav/styles/sidenavCollapse.js4 symbols
material-dashboard-react-app/src/auth/login/index.js4 symbols
material-dashboard-react-app/src/App.js4 symbols

Datastores touched

UserCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add material-dashboard-react-nodejs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact