Skip to content

Small API with frontend written in React and Node to retrieve system software/hardware information and return it to the user.

Notifications You must be signed in to change notification settings

TheConsciousness/SysInfoAPI

Repository files navigation

SysInfoAPI

Small API written in NodeJS to retrieve system hardware information. The frontend has been developed using React and CoreUI, and leverages Redux for state management. Uses LocalStorage for storing persistent data.

sysinfoapi_ui

Installing and running

Prerequisites

NodeJS

NPM

Instructions

  1. Clone or download the project from the main branch.
  2. Use terminal to cd to the project directory
  3. If needing a self-signed certificate, run:
openssl req -nodes -new -x509 -keyout api_cert.key -out api_cert.cert
  1. Run the commands below:
$ npm install
$ sudo npm install pm2 -g
$ npm start 
  1. Browse to frontend: http://localhost:3000
  2. Make API calls to backend: http://localhost:1337 using calls below.

Environment Variables

Name Default Value Usage
SYSINFOAPI_PORT 1337 Defines port used by the API.
PORT 3000 (React) Defines port used for React frontend development.
REACT_APP_DEBUG_MODE true Turns on console.log statements for debugging.
REACT_APP_API_URL /all The default API URL called by React.

Backend API Calls:

/cpu

{
  "Our_PC_Name": {
    "CPU": {
      "Used": "7%"
    }
  }
}

/memory

{
  "Our_PC_Name": {
    "Memory": {
      "Free": "1.84 GB",
      "Total": "16 GB",
      "PercentUsed": "88%"
    }
  }
}

/hdd

{
  "Our_PC_Name": {
    "HDDs": [
      {
        "_filesystem": "/dev/disk1s7s1",
        "_blocks": "467.13 MB",
        "_used": "28.54 MB",
        "_available": "221.93 MB",
        "_capacity": "12%",
        "_mounted": "/"
      },
      {
        "_filesystem": "devfs",
        "_blocks": "378 Bytes",
        "_used": "378 Bytes",
        "_available": "0 Bytes",
        "_capacity": "100%",
        "_mounted": "/dev"
      }
    ]
  }
}

/all

{
  "Our_PC_Name": {
    "CPU": {
      "Used": "6%"
    },
    "Memory": {
      "Free": "1.8 GB",
      "Total": "16 GB",
      "PercentUsed": "87%"
    },
    "HDDs": [
      {
        "_filesystem": "/dev/disk1s7s1",
        "_blocks": "467.13 MB",
        "_used": "28.54 MB",
        "_available": "221.93 MB",
        "_capacity": "12%",
        "_mounted": "/"
      },
      {
        "_filesystem": "devfs",
        "_blocks": "378 Bytes",
        "_used": "378 Bytes",
        "_available": "0 Bytes",
        "_capacity": "100%",
        "_mounted": "/dev"
      }
    ]
  }
}

About

Small API with frontend written in React and Node to retrieve system software/hardware information and return it to the user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages