Getting Started
Installation
Requires NodeJS version 18.14.0+
Requires npm version 9.3.1+
Install the required packages using the npm package manager.
npm iSetup
Before running the application, the API path for the application needs to be defined. The path can be configured in the config.js file under src\api\
directory. Below shows an example configuration to use the local server for development.
export const API_BASEURL = "http://localhost:5000";Additionally, Firebase needs to be configured to utilise the cloud storage API. The Firebase application configuration can be set in the index.js file
under src\firebase\ directory. An example configuration of the file is shown below:
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
import { getStorage } from "firebase/storage";
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyB5nc2HhrAc0otW8wGMBDEtJ4JfISk8rXo",
authDomain: "iot-sensor-platform.firebaseapp.com",
projectId: "iot-sensor-platform",
storageBucket: "iot-sensor-platform.appspot.com",
messagingSenderId: "686540352678",
appId: "1:686540352678:web:a09616011a1bdfbd811867"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
// Initialize Cloud Storage and get a reference to the service
export const storage = getStorage(app);The values for firebaseConfig needs to be replaced by your Firebase application configurations.
If you do not have your Firebase application configurations, refer to Firebase
Running
To run the application locally, run:
npm startThe application will run on http://localhost:3000 (opens in a new tab) by default.