ResourceHub API. Not for production. Replacement Rocket crate (library) to Actix (Actix web), added endpoints for get, get_by_id, create for first tests, later i will add database connection and impliment saving sensor data into Database.,

This commit is contained in:
SocioCyber
2026-04-14 09:20:19 -07:00
parent cb698814ee
commit 8fce4071a2
11 changed files with 703 additions and 1021 deletions

View File

@@ -1,8 +1,14 @@
# ResourceHUB [API]
![Resource-hub-2](./images/Resource-hub-2-2.png)![SOFT](./images/SOFT.png)
## [API] Library
[ACTIX (actix-web)](https://actix.rs/docs/server)
> [!NOTE]
> **[DataCollector]** sends [**sensor's data] **like as *PH Level*, *Humidity*, *Temperature*, etc) as ++JSON++ to this **[API]**
> **RESOURCE HUB - means a Public Storage with Sensors Data,.**![Resource-hub-2](./images/Resource-hub-2-2.png)**
> **[DataCollector]** sends [**sensor's data] **like as *PH Level*, *Humidity*, *Temperature*, etc) as ++JSON++ to this [API]**
> **RESOURCE HUB - means a Public Storage with Sensors Data,.**
> ![image](./images/pasted_20260318-150812.png)
> ```json
> {
@@ -53,15 +59,14 @@
> - **S1** - Means: **Sector** **1**
> - **C1** - Means: **Cell** **1**
> - **:** - field splitter (for future. May be parsers can use this for getting fields: cityid, cords, sector, cell)
>
> ### In concept
> > SECTOR-5-CELL-1 can collect data about tomatos
> > SECTOR-5-CELL-2 can collect data about potatos
> > SECTOR-5-CELL-1 can collect data about tomatos
> > SECTOR-5-CELL-2 can collect data about potatos
> > **In future can be added 'resource' journals,.**
> > **a. "how much" system make a 'tomatos', 'gabbages,.' : 10 tomatos/month, 40 gabbeges/month, etc,.)**
> > **b. "n/year"**
> > **c. **
> ## * Sensors Data Table * [**Example**]
> ## Sensors Data Table [**Example**]
>
> | id | city_codename_cords_sector_cell | sensor_name_and_model | value | unit | timestamp |
> | --- | -------------------------------------------------------------------------------- | ---------------------------------------------------- | ----- | ------- | --------- |