Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Decentralized application focused on end-user sensors networks.

License

NotificationsYou must be signed in to change notification settings

airalab/sensors.social

Repository files navigation


📌 Overview

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.


🚀 Deployment

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.

1️⃣ Fork & Clone the Repository

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.

2️⃣ Install Dependencies

EnsureNode.js andYarn are installed:

 node -v# Should be >= 16 yarn -v# Should be installed

Then install the required dependencies:

 yarn install

3️⃣ Start the Server Locally for Development

 yarn dev

🔧 Setup Your Own Map (For Experienced Users)

1️⃣ Deploy Your Own Instance of the Map

Refer to the "🚀 Deployment" section.

2️⃣ Enable GitHub Actions

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/.

3️⃣ Configure Deployment

Option 1: Deploy Without a Custom Domain

  • Open.github/workflows/main.yaml and remove the line:
    cname:sensors.social
  • Add the following permissions block right belowruns-on: ubuntu-latest:
    permissions:contents:write
  • Invite.config.js, add the following line to thedefineConfig object, just above theplugins section:
    base:"/<repository_name>/",
    Replace<repository_name> with the name of your fork.

Option 2: Deploy With a Custom Domain

  • Open.github/workflows/main.yaml and replace:
    cname:sensors.social
    with your custom domain:
    cname:your-custom-domain.com
  • Add the following permissions block right belowruns-on: ubuntu-latest:
    permissions:contents:write

4️⃣ Finalizing Deployment

After modifying the necessary files, deploy your instance of the map by following these steps:

  1. Commit and push the changes to your forked repository:
    git add.git commit -m"Configured deployment settings"git push origin main
  2. Wait until the GitHub Actions workflow successfully completes.
  3. Navigate to thePages section in your repositorySettings.
  4. Enable GitHub Pages by selectingDeploy from a branch as the source.
  5. Choose thegh-pages branch and the root folder.
  6. 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.


💬 Localization & Translations

You can add a new language to the map by modifying the translation files located insrc/translate/.

📝 Adding a New Language

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"},];

📏 Translating Measurements

Measurement values are located insrc/measurements/.
To support multiple languages, update the relevant files in this folder.

Files to Update

Measurement TypeFile Name
Carbon Monoxideco.js
Background Radiationgs.js
Humidityhumidity.js
Ammonia (NH₃)nh3.js
Nitrogen Dioxide (NO₂)no2.js
Noise Levelsnoise.js,noiseavg.js,noisemax.js
PM10 Particulate Matterpm10.js
PM2.5 Particulate Matterpm25.js
Pressurepressure.js
Temperaturetemperature.js

Example Translation Update (humidity.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"}}]

How to Fork the Repository with Custom Configuration Files

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.


❓ Support

For questions or suggestions, create anissue in the repository.



[8]ページ先頭

©2009-2025 Movatter.jp