sensors.social is a decentralized application that visualizes data from sensors sending their measurements to the blockchain (Polkadot network, Robonomics parachain). The platform supports two modes of operation:
- Peer-to-peer connectivity for direct access to sensor data.
- Federative concept for accumulating sensor data and displaying measurement history.
For more details on connectivity and how to deploy your own map interface (or even a connectivity server), visit Robonomics Academy.
This section is intended for contributors working on the existing map and developers setting up their own map interface. For comprehensive instructions on configuring your own user interface, refer to the next sections.
If you plan to contribute or customize the project extensively, consider forking it first. Then clone the repository:
git clone <map repository>
If you plan to contribute or customize the project extensively, consider forking it first.
Ensure Node.js and Yarn are installed:
node -v # Should be >= 16
yarn -v # Should be installed
Then install the required dependencies:
yarn install
yarn dev
Refer to the "🚀 Deployment" section.
To activate GitHub Actions in your repository:
- Navigate to the Actions tab in your GitHub repository.
- If prompted, enable workflows by clicking Enable GitHub Actions.
- Ensure that workflows are correctly set up in
.github/workflows/
.
- Open
.github/workflows/main.yaml
and remove the line:cname: sensors.social
- Add the following permissions block right below
runs-on: ubuntu-latest
:permissions: contents: write
- In
vite.config.js
, add the following line to thedefineConfig
object, just above theplugins
section:Replacebase: "/<repository_name>/",
<repository_name>
with the name of your fork.
- Open
.github/workflows/main.yaml
and replace:with your custom domain:cname: sensors.social
cname: your-custom-domain.com
- Add the following permissions block right below
runs-on: ubuntu-latest
:permissions: contents: write
After modifying the necessary files, deploy your instance of the map by following these steps:
- Commit and push the changes to your forked repository:
git add . git commit -m "Configured deployment settings" git push origin main
- Wait until the GitHub Actions workflow successfully completes.
- Navigate to the Pages section in your repository Settings.
- Enable GitHub Pages by selecting Deploy from a branch as the source.
- Choose the
gh-pages
branch and the root folder. - Save the settings—GitHub Pages will deploy your instance of the map.
You can now access your deployed map using the provided GitHub Pages URL.
You can add a new language to the map by modifying the translation files located in src/translate/
.
1️⃣ Create a new translation file in src/translate/
, e.g., es.js
.
2️⃣ Update index.js
in the same folder:
- Import your newly created translation file:
import es from "./es";
export default { en, ru, es };
- Add the new language to the language list:
export const languages = [
{ code: "en", title: "English" },
{ code: "ru", title: "Русский" },
{ code: "es", title: "Español" },
];
Measurement values are located in src/measurements/
.
To support multiple languages, update the relevant files in this folder.
Measurement Type | File Name |
---|---|
Carbon Monoxide | co.js |
Background Radiation | gs.js |
Humidity | humidity.js |
Ammonia (NH₃) | nh3.js |
Nitrogen Dioxide (NO₂) | no2.js |
Noise Levels | noise.js , noiseavg.js , noisemax.js |
PM10 Particulate Matter | pm10.js |
PM2.5 Particulate Matter | pm25.js |
Pressure | pressure.js |
Temperature | temperature.js |
To add support for Spanish (es), update the name
, nameshort
, and zones
properties:
name: {
en: "Humidity",
ru: "Влажность",
es: "Humedad"
},
nameshort: {
en: "Humidity",
ru: "Влажность",
es: "Humedad"
},
zones: [
{
value: 30,
color: "#ff4d00",
label: {
en: "Very dry",
ru: "Очень сухо",
es: "Muy seco"
}
}
]
For questions or suggestions, create an issue in the repository.