- Notifications
You must be signed in to change notification settings - Fork13
Decentralized application focused on end-user sensors networks.
License
airalab/sensors.social
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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), visitRobonomics 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.
EnsureNode.js andYarn 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 theActions tab in your GitHub repository.
- If prompted, enable workflows by clickingEnable 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 thePages section in your repositorySettings.
- Enable GitHub Pages by selectingDeploy 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 insrc/translate/
.
1️⃣Create a new translation file insrc/translate/
, e.g.,es.js
.
2️⃣Updateindex.js
in the same folder:
- Import your newly created translation file:
importesfrom"./es";exportdefault{ en, ru, es};
- Add the new language to the language list:
exportconstlanguages=[{code:"en",title:"English"},{code:"ru",title:"Русский"},{code:"es",title:"Español"},];
Measurement values are located insrc/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 forSpanish (es), update thename
,nameshort
, andzones
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"}}]
1️⃣ Copy thesrc/config/template
directory to your own:
cp -r src/config/template src/config/my-project
2️⃣ In thesrc/config/my-project/config.json
file, all parameters are optional. You can configure the following settings:
{"LIBP2P":"Configuration for initializing the LIBP2P library","REMOTE_PROVIDER":"Server with Rozman","WIND_PROVIDER":"Server with wind data","MAP": {"zoom":"Zoom level","position": {"lat":"Latitude","lng":"Longitude" } },"SHOW_MESSAGES":"Boolean value (true/false) indicating whether to display user messages on the map","DEFAUL_TYPE_PROVIDER":"Default data provider type (remote or realtime)","TITLE":"Project title","SERIES_MAX_VISIBLE":"Maximum number of data points on the chart before grouping is applied"}
Example:config.json
3️⃣ In thesrc/config/my-project/agents.json
file, specify a list of libp2p identifiers from which data can be received via pubsub in realtime mode.
Example:agents.json
4️⃣ In thesrc/config/main/sensors.js
file, you can set an icon and a website link for a specific sensor:
{"HASH ID_SENSOR": {"icon":"Path to the icon file","link":"URL of the website" }}
Example:sensors.json
5️⃣ To ensure that your configuration is loaded in the final build, set the following environment variable:
VITE_CONFIG_ENV=my-project
You can configure this in your GitHub project settings under the Environments section.

For questions or suggestions, create anissue in the repository.
About
Decentralized application focused on end-user sensors networks.