diff --git a/README.md b/README.md new file mode 100644 index 000000000..cb450ce0a --- /dev/null +++ b/README.md @@ -0,0 +1,133 @@ +

+ +

+

+ + +

+ +

Plant-it is a self-hosted gardening companion app.
Useful for keeping track of plant care, receiving notifications about when to water plants, uploading plant images, and more.

+ +

Why?Features highlightsGetting startedConfiguration

+ +

+ + + + +

+ +## Why? +Plant-it is a gardening companion app that helps you take care of your plants. +It does not recommend you about which action to take, instead it is designed to logs the activity you are doing. +This is on purpose, I strongly believe that the only one in charge of know when to water your plants, when to fertilize it, etc. is you (with the help of multiple online sources). +Plant-it helps you remember the last time you did a treatment of your plants, which plants you have, collection photo of your plants, and notify you about time passed since last action on them. + + +## Features highlight +* Add existing plants or user created plants to your collection +* Log events like watering, fertilizing, biostimulating, etc. for your plants +* View all the logged events, filtering by plant and/or event type +* Upload photos of your plants +* 🔜 Set reminder for some actions on your plants (e.g. notify if not watered every 4 days) + + +## Getting started +Plant-it provides multiple ways of installing it on your server. +* [Setup with Docker](https://www.plant-it.org/docs/v1/setup/setup-with-docker/) (_recommended_) +* [Setup without Docker](https://www.plant-it.org/docs/v1/setup/setup-without-docker/) + +### Setup with docker +Working with Docker is pretty straight forward. To make things easier, a [docker compose file](#) is provided in the repository which contain all needed services, configured to just run the application right away. + +There are two different images for the service: +* `msdeluise/plant-it-backend` +* `msdeluise/plant-it-frontend` + +This images can be use indipendently, or they can be use in a docker-compose file. +For the sake of simplicity, the provided docker-compose.yml file is reported here: +``` +version: "3" +name: plant-it +services: + backend: + image: msdeluise/plant-it-backend:latest + env_file: backend.env + depends_on: + - db + restart: unless-stopped + + db: + image: mysql:8.0 + restart: always + env_file: backend.env + + frontend: + image: msdeluise/plant-it-frontend:latest + env_file: frontend.env + links: + - backend + + reverse-proxy: + image: nginx:stable-alpine + ports: + - "8080:80" + volumes: + - ./default.conf:/etc/nginx/conf.d/default.conf + links: + - backend + - frontend +``` + +Run the docker compose file (`docker compose -f up -d`), then the service will be available at `localhost:8080`, while the REST API will be available at `localhost:8080/api` (`localhost:8080/api/swagger-ui/index.html` for the documentation of them). + +
+ + Run on a remote host + + Please notice that running the `docker-compose` file from another machine change the way to connect to the server. For example, if you run the `docker-compose` on the machine with the local IP `192.168.1.100` then you have to change the backend url in the [REACT_APP_API_URL](#configurations) variable to `http://192.168.1.100:8080/api`. In this case, the frontend of the system will be available at `http://192.168.1.100:8080`, and the backend will be available at `http://192.168.1.100:8080/api`. +
+ +### Setup without docker +The application was developed with being used with Docker in mind, thus this method is not preferred. + +#### Requirements +* [JDK 19+](https://openjdk.org/) +* [MySQL](https://www.mysql.com/) +* [React](https://reactjs.org/) + +#### Run +1. Be sure to have the `mysql` database up and running +1. Run the following command in the terminal inside the `backend` folder + `./mvnw spring-boot:run` +1. Run the following command in the terminal inside the `frontend` folder + `npm start` + +Then, the frontend of the system will be available at `http://localhost:3000`, and the backend at `http://localhost:8085/api`. + + +## Configuration + +There are 2 configuration file available: +* `deployment/backend.env`: file containing the configuration for the backend. An example of content is the following: + ``` + MYSQL_HOST=db + MYSQL_PORT=3306 + MYSQL_USERNAME=root + MYSQL_PSW=root + JWT_SECRET=putTheSecretHere + JWT_EXP=1 + MYSQL_ROOT_PASSWORD=root + MYSQL_DATABASE=bootdb + USERS_LIMIT=-1 # including the admin account, so <= 0 if undefined, >= 2 if defined + ``` + Change the properties values according to your system. + +* `deployment/frontend.env`: file containing the configuration for the frontend. An example of content is the following: + ``` + REACT_APP_API_URL=http://localhost:8080/api + BROWSER=none + REACT_APP_PAGE_SIZE=25 + ``` + Change the properties values according to your system. + diff --git a/backend/src/main/java/com/github/mdeluise/plantit/common/IdentifiedEntity.java b/backend/src/main/java/com/github/mdeluise/plantit/common/IdentifiedEntity.java deleted file mode 100644 index a5f656fe8..000000000 --- a/backend/src/main/java/com/github/mdeluise/plantit/common/IdentifiedEntity.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.mdeluise.plantit.common; - -public interface IdentifiedEntity { - E getId(); - - void setId(E id); -} diff --git a/images/desktop.png b/images/desktop.png deleted file mode 100644 index 0db1f0e03..000000000 Binary files a/images/desktop.png and /dev/null differ diff --git a/images/mobile.png b/images/mobile.png deleted file mode 100644 index ef38b83cc..000000000 Binary files a/images/mobile.png and /dev/null differ diff --git a/images/plant-it-logo.png b/images/plant-it-logo.png new file mode 100644 index 000000000..071bac338 Binary files /dev/null and b/images/plant-it-logo.png differ diff --git a/images/screenshot-1.png b/images/screenshot-1.png new file mode 100644 index 000000000..3b97c7e08 Binary files /dev/null and b/images/screenshot-1.png differ diff --git a/images/screenshot-2.png b/images/screenshot-2.png new file mode 100644 index 000000000..3477e863d Binary files /dev/null and b/images/screenshot-2.png differ diff --git a/images/screenshot-3.png b/images/screenshot-3.png new file mode 100644 index 000000000..74a142c22 Binary files /dev/null and b/images/screenshot-3.png differ diff --git a/images/screenshot-4.png b/images/screenshot-4.png new file mode 100644 index 000000000..610443e41 Binary files /dev/null and b/images/screenshot-4.png differ diff --git a/images/swagger.png b/images/swagger.png deleted file mode 100644 index 457b89832..000000000 Binary files a/images/swagger.png and /dev/null differ