Skip to content

johnvan7/mern-iot-dashboard

Repository files navigation

MERN Stack IoT Dashboard

MongoDB Express.js React.js Node.js

Typescript - material ui - iot

Getting started

Step 1: Clone the repository

git clone https://github.com/johnvan7/mern-iot-dashboard.git
cd mern-iot-dashboard

Step 2: Setup your MongoDB database

  • Create a new MongoDB database and obtain its connection URI.

Step 3: Edit the Environment File

  • In the /backend directory of the project, create a new file named .env and copy the contents of template.env into it.

  • Edit the MONGO_URI variable and replace it with the connection URI of your MongoDB database.

  • Edit the JWT_SECRET variable and replace it with a secret string of your choice.

    Do the same for frontend (optional).

Step 4: Install Backend Dependencies

In your terminal, navigate to the /backend directory

cd backend

and run the following command to install the backend dependencies:

npm install

Step 5: Start the Backend Server

Now run the following command in the same terminal to start the backend server:

npm run dev

This command will start the backend server, and it will listen for incoming requests.

Step 6: Install Frontend Dependencies

Open a new terminal window and navigate to the /frontend directory of the project.

cd frontend
npm install

Step 9: Run the Frontend Server

Now run the following command in the same terminal to start the frontend server:

npm run dev

Now open http://localhost:3000 to view it in the browser.

Screenshots