From 83a79b2ffe806dbe09880f789fc2fae40441b3de Mon Sep 17 00:00:00 2001 From: programmingPug <36635276+programmingPug@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:13:30 -0500 Subject: [PATCH] Runtime and readme updates --- README.md | 125 ++++++++++++++++++++++++++-- SoilMoistureAPI/SoilMoisture.db | Bin 0 -> 4096 bytes SoilMoistureAPI/SoilMoisture.db-shm | Bin 0 -> 32768 bytes SoilMoistureAPI/SoilMoisture.db-wal | Bin 0 -> 57712 bytes docker-compose.yml | 8 +- plant-browser/nginx.conf | 2 +- 6 files changed, 122 insertions(+), 13 deletions(-) create mode 100644 SoilMoistureAPI/SoilMoisture.db create mode 100644 SoilMoistureAPI/SoilMoisture.db-shm create mode 100644 SoilMoistureAPI/SoilMoisture.db-wal diff --git a/README.md b/README.md index 917d84b..f0971b5 100644 --- a/README.md +++ b/README.md @@ -36,25 +36,134 @@ The end goal is to have the probe nodes collect soil moisture, soil temperature, This project is built on the following technologies: +- [NPM](https://www.npmjs.com/) +- [Node](https://nodejs.org/en) +- [Node](https://www.docker.com/) - [Angular](https://angular.dev/) - [.Net](https://dotnet.microsoft.com/en-us/download) - [XAIO ESP32-C6](https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/) - [Eagle](https://www.autodesk.com/products/eagle/overview?term=1-YEAR&tab=subscription) - [Arduino](https://www.arduino.cc/) -### Installation +## Project Structures: - ```sh -docker build -t plantpal-client:latest . -docker image tag plantpal-client 192.168.1.193:5000/plantpal-client -docker push 192.168.1.193:5000/plantpal-client - ``` +- plant-browser: Front-end client. +- SoilMoistureAPI: Backend API. +- Eagle: PCB project for soil nodes. +- batteryValidationTest: Arduino project for testing batteries. +- soilReporterNode: Arduino project for probe notes to report and forward data to API. +- soilProbeNode: Arduino project for gathering plant information. - ```sh +## Requirement (Client and API) + +- Node: v22.12.0 +- NPM: v10.9.0 +- Docker: v27.4.0 + +## Requirement (Hardware) +- Arduino IDE: v10 + - WiFiManager + - Additional Boards: (https://espressif.github.io/arduino-esp32/package_esp32_index.json) +- XAIO ESP32C6 +- Soil Sensor 2.0 +- Miscellaneous electrical components + +## Installing for Local Development: + +### API: +You will need to modify a few things int he API project for local development. + +1) program.cs +```js +options.ListenAnyIP(80) --> options.ListenAnyIP(8000) +``` + +2) appsettings.json +```js +"DefaultConnection": "Data Source=app/data/SoilMoisture.db" --> "DefaultConnection": "Data Source=SoilMoisture.db" +``` + +Then just click "http" to run the API. + +## Install client dependencies: +From the client folder + +Install dependencies +```sh +npm install +``` + +Run the Client: +```sh +ng s +``` + +## Building Images: +Building images for runtime distrobution + +### API image: + +Build docker image +```sh docker build --no-cache -t plantpal-api:latest . +``` + +Tag image +```sh docker image tag plantpal-api 192.168.1.193:5000/plantpal-api +``` + +Push to registry +```sh docker push 192.168.1.193:5000/plantpal-api - ``` +``` + +### Client image: +Building images for runtime distrobution + +Build docker image +```sh +docker build -t plantpal-client:latest . +``` + +Tag image +```sh +docker image tag plantpal-client 192.168.1.193:5000/plantpal-client +``` + +Push to registry +```sh +docker push 192.168.1.193:5000/plantpal-client +``` + +### Running Docker Images: + +Create new docker network for the containers to communicate +```sh +docker network create soilmoisture_network +``` + +### Run API image + +Run API +```sh +docker run -d --name plantpal_api --network soilmoisture_network -p 8000:80 plantpal_api:latest +``` + +Run client image +```sh +docker run -d --name plantpal_client --network plantpal_network -p 3000:80 plantpal_client:latest +``` + +### Docker Compose: +optionally You can also use docker compose with the file at the root + +```sh +docker-compose up -d --build +``` + + + ## Roadmap - [X] Functional API diff --git a/SoilMoistureAPI/SoilMoisture.db b/SoilMoistureAPI/SoilMoisture.db new file mode 100644 index 0000000000000000000000000000000000000000..0de02ecf623141161c863ee065d9f7dd83cbe849 GIT binary patch literal 4096 zcmWFz^vNtqRY=P(%1ta$FlG>7U}9o$P*7lCU|@t|AVoG{WYDWBbhdkq6Znt7Aa7Qg$0EwzEQ&zC1V(Y&uYpZV;3_bV=`{-k`Xw;y*SMx7&=R<7 zWsv{@0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjZN GA@B=U%q2Vk literal 0 HcmV?d00001 diff --git a/SoilMoistureAPI/SoilMoisture.db-wal b/SoilMoistureAPI/SoilMoisture.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..11b42ca02d4917384d7dc38777e4a053b992622f GIT binary patch literal 57712 zcmeI*PiUKU7{Kv2Nt?Q|wjxM`!hDH4bactyH%s%jRpzqxt!7J;uFb}(n=wmY<+W*J zleb0ZL0Tpb_25AertTm*rU+hknkPXV9>hP#!gP3$RmJH<*ujIpH_h86P3$^POY{Aa zmc0LdeSe>XLY_X)Q|)E%k`(yq0ZF=7vd7ThuICm`{qn)SYd4R+^Vz{UvCCDt|CO18 zZ+*V6$2)O2Zd!)?OujIavE;qtYPVb3FU#Uwclpb{%pUgjEv09x-%9gUY}b40mV&3| zI>ZrI*CUd6Fc3fh0R#|0009ILKmY**5NJ4o#i*;zr>d@{fR#C!Gty~&WYm1Nkg?4C zY%!kCPS@^n4~^^5lrE>D2jaTyuRXyp_jI(&V)$cIemRy%>5u8-aw3_M6G!54c_^8f zNR3Cue%U{EC|&RRvGLewbbL}iq)+ZHPn9xfjG~p9dEPIl^kZVG@^l^Ty99dabG{QV zIQiAZ#CPX@e$W2QUJfNR-0Q*(BY*$`2q1s}0tg_000IagfWW2&s^S9OmtQ;nd%}Eo z^>6vhQrGgP=ix*I5I_I{1Q0*~0R#|0009ILxN8JIQX+^?(%;WW)&|H!^J7v63oXd&o z`E+L9%9pm+CFDCRRqL+R{tSGN{U+HWbp#%JElwT5)o)+_<81f-r>G;aRTu~$fB*sr zAbHj-Yk>8|6BJ?LUa83ZM@msm@n`swc=kkgScsY6`m5e3CPaM?~DW`Y* zu(4ofjhX~|=dg48abv;A`DM}FKEBpo-Z|&L+Rr=36J~bWCaO)gr;ecXzXY1Nj^NdS zM|Uiqzj2nngH8U+nB^mY00IagfB*srAba5g;kTl&NmyNe7G<^pf^aba(5kLR|1Q0*~0R#|0009IL zxHAE}SAf@v3mksw&udp!E?*}uaA$~|jQ|1&Ab5)ZedZTCXCu?EV5(ae*Jt9KSGq