Skip to content

Commit

Permalink
Hello Project!
Browse files Browse the repository at this point in the history
  • Loading branch information
MDeLuise committed Aug 3, 2023
0 parents commit 040dc21
Show file tree
Hide file tree
Showing 167 changed files with 28,444 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: Report a bug in YTSMS
body:
- type: checkboxes
attributes:
label: Avoid duplicated bug reports
description: Please avoid bug report duplication
options:
- label: I've found a bug and checked that there are no open or closed bug report related to this.
required: true

- type: textarea
attributes:
label: Description
description: Please provide a brief description of the bug.
validations:
required: true

- type: textarea
attributes:
label: Expected behaviour
description: Please describe precisely what you'd expect to happen. Be specific.
validations:
required: false

- type: textarea
attributes:
label: Steps to reproduce
description: Please describe the steps to reproduce the bug.
placeholder: |
1. ...
2. ...
3. ...
validations:
required: false

- type: textarea
attributes:
label: Additional info
description: Please provide any additional information that seem useful.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/fr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature Request
description: Request a feature or enhancement in YTSMS
body:
- type: checkboxes
attributes:
label: Avoid duplicated feature requests
description: Please check if someone already required this
options:
- label: There are no open or closed feature requests that are related to this request
required: true

- type: textarea
attributes:
label: Description
description: Please describe your feature request
placeholder: |
- I would like YTSMS to do (thing).
- What if you would add feature (feature here)?
- YTSMS doesn't do (thing).
validations:
required: true

- type: textarea
attributes:
label: Solution
description: Describe what your feature would add to YTSMS.

- type: textarea
attributes:
label: What are alternatives?
description: Please describe what alternatives currently exist.

- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.


9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Ask a question
description: Please ask and answer questions here.
body:
- type: textarea
attributes:
label: Question
description: Please provide the question here.
validations:
required: true
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
Before you create a new PR, please consider:
1) DO NOT include translations in your PR. Only English US sentences.
Thanks.
-->

Fixes issue # (if relevant)

Changes in this pull request:

-
-
-


40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Automated tests

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Maven Action
uses: s4u/[email protected]
with:
java-version: 20

- name: Build
run: mvn clean install -DskipTests -Dcheckstyle.skip
working-directory: ./backend

checkstyle:
runs-on: ubuntu-latest
steps:
- name: Setup Maven Action
uses: s4u/[email protected]
with:
java-version: 20

- name: Verify the checkstyle
run: mvn checkstyle:check
working-directory: ./backend

tests:
runs-on: ubuntu-latest
steps:
- name: Setup Maven Action
uses: s4u/[email protected]
with:
java-version: 20

- name: Run the tests
run: mvn test
working-directory: ./backend
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.DS_Store
135 changes: 135 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<p align="center">
<img width="200px" src="images/plant-it-logo.png" title="Plant-it">
</p>
<p align="center">
<img src="https://img.shields.io/github/checks-status/MDeLuise/plant-it/main?style=for-the-badge&label=build&color=%2228B22" />
<img src="https://img.shields.io/github/v/release/MDeLuise/plant-it?style=for-the-badge&color=%2228B22" />
</p>

<p align="center">Plant-it is a <b>self-hosted gardening companion app.</b><br>Useful for keeping track of plant care, receiving notifications about when to water plants, uploading plant images, and more.</p>

<p align="center"><a href="https:/MDeLuise/plant-it/#why">Why?</a> • <a href="https:/MDeLuise/plant-it/#features-highlight">Features highlights</a> • <a href="https:/MDeLuise/plant-it/#getting-started">Getting started</a> • <a href="https:/MDeLuise/plant-it/#configuration">Configuration</a></p>

<p align="center">
<img src="/images/screenshot-1.png" width="45%" />
<img src="/images/screenshot-2.png" width="45%" />
<img src="/images/screenshot-3.png" width="45%" />
<img src="/images/screenshot-4.png" width="45%" />
</p>

## 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 using [Trefle API](https://trefle.io/) 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)
* 🔜 Dark/Light mode

## 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](https:/MDeLuise/plant-it/blob/main/deployment/docker-compose.yml) 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 <file> 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).

<details>

<summary>Run on a remote host</summary>

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 [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`.
</details>

### 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:
```
API_URL=http://localhost:8080/api
BROWSER=none
PAGE_SIZE=25
```
Change the properties values according to your system.

10 changes: 10 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# target
target/

# IDE specific files
.idea/
.vscode/

# Other
.DS_Store
*.iml
6 changes: 6 additions & 0 deletions backend/deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM openjdk:20-jdk

ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar

ENTRYPOINT ["java","-jar","/app.jar"]
Binary file added backend/images/swagger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 040dc21

Please sign in to comment.