Skip to content

Commit

Permalink
Merge pull request #167 from positivecrash/master
Browse files Browse the repository at this point in the history
updated Readme
  • Loading branch information
ensrationis authored Feb 26, 2025
2 parents b480606 + 7643550 commit f1288c0
Showing 1 changed file with 89 additions and 46 deletions.
135 changes: 89 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,116 @@
# Create open sensors networks without centralization problems
# sensors.social

Decentralized Open Sensors Map. Don't forget to your IFPS ID into `src/agents.json` in case you set up your own [Sensors Connectivity module](https://github.com/airalab/sensors-connectivity/tree/master).
## 📌 Overview

## Setup your own Map
**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:

To deploy your own instance of the map using GitHub Pages, start by forking the [repository](https://github.com/airalab/sensors.robonomics.network) and clone it. To enable GitHub Actions, go to the repository page, click on the `Actions` tab, and set up a workflow if you haven't done so already.
To successfully deploy the map, you will need to modify certain files:
- **Peer-to-peer connectivity** for direct access to sensor data.
- **Federative concept** for accumulating sensor data and displaying measurement history.

### Option 1: you don't have Domain
For more details on connectivity and how to deploy your own map interface (or even a connectivity server), visit [Robonomics Academy](https://robonomics.academy/en/learn/sensors-connectivity-course/overview/).

1. In `.github/workflows/main.yaml` remove `cname: sensors.robonomics.network`.
2. Add the following code right below `runs-on: ubuntu-latest` in `.github/workflows/main.yaml`:
## 🚀 Deployment

### 1️⃣ Clone the Repository

Simply clone the repository and navigate to the project directory:

```sh
git clone https://github.com/airalab/sensors.social.git
cd sensors.social
```
permissions:
contents: write

If you plan to contribute or customize the project extensively, consider forking it first.

### 2️⃣ Install Dependencies

Ensure **Node.js** and **Yarn** are installed:

```sh
node -v # Should be >= 16
yarn -v # Should be installed
```
3. In `vite.config.js` add `base: "/<repository name>/",` to the `defineConfig` object just above the `plugins` section , replacing `<repository_name>` with the name of your fork (default will be `sensors.robonomics.network`)

### Option 2: you have Domanin
Then install the required dependencies:

1. In `.github/workflows/main.yaml` change `cname: sensors.robonomics.network` to your `CNAME`.
2. Add the following code right below `runs-on: ubuntu-latest` in `.github/workflows/main.yaml`:
```sh
yarn install
```
permissions:
contents: write

### 3️⃣ Start the Server Locally for Development

```sh
yarn dev
```

### Manage Github Pages
## 🔧 Setup Your Own Map (For Experienced Users)

After making modifications to the files, you can deploy your instance of the map by following these steps:
### 1️⃣ Deploy Your Own Instance of the Map

1. Commit and push the changes to your forked repository.
2. Wait until the actions have successfully completed.
3. Go to the `Pages` section of your repository `Settings`.
4. Enable GitHub Pages by selecting `Deploy from a branch` as the source
5. Choose the `gh-pages` branch and the `root` folder.
6. Save the settings, and GitHub Pages will deploy your instance of the map.
7. Access it using the provided GitHub Pages URL.
### 2️⃣ Enable GitHub Actions

> If you dont see the GitHub Pages URL try to reload the page.
To activate GitHub Actions in your repository:

## Project setup
- 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/`.

```
yarn install
```
### 3️⃣ Configure Deployment

### Compiles and hot-reloads for development
#### Option 1: Deploy Without a Custom Domain

```
yarn dev
```
- Open `.github/workflows/main.yaml` and remove the line:
```yaml
cname: sensors.social
```
- Add the following permissions block right below `runs-on: ubuntu-latest`:
```yaml
permissions:
contents: write
```
- In `vite.config.js`, add the following line to the `defineConfig` object, just above the `plugins` section:
```javascript
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:
```yaml
cname: sensors.social
```
with your custom domain:
```yaml
cname: your-custom-domain.com
```
- Add the following permissions block right below `runs-on: ubuntu-latest`:
```yaml
permissions:
contents: write
```

### Compiles and minifies for production
### 4️⃣ Finalizing Deployment

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

### Lints and fixes files
1. Commit and push the changes to your forked repository:
```sh
git add .
git commit -m "Configured deployment settings"
git push origin main
```
2. Wait until the GitHub Actions workflow successfully completes.
3. Navigate to the **Pages** section in your repository **Settings**.
4. Enable GitHub Pages by selecting **Deploy from a branch** as the source.
5. Choose the `gh-pages` branch and the root folder.
6. Save the settings—GitHub Pages will deploy your instance of the map.

```
yarn lint
```
You can now access your deployed map using the provided GitHub Pages URL.

### Customize configuration
## ❓ Support

See [Vite Configuration Reference](https://vitejs.dev/config/).
For questions or suggestions, create an **issue** in the repository.

## Recommended IDE Setup
---

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

0 comments on commit f1288c0

Please sign in to comment.