Skip to main content

Plant-it

Plant-it

LinkGithub

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.

Installing Plant-it is pretty straight forward, in order to do so follow these steps:
  • Create a folder andwhere cdyou intowant it.
    to place all Plant-it related files.

    Create

  • backend.env

    backend.env
    MYSQL_HOST=db
    MYSQL_PORT=3306
    MYSQL_USERNAME=root
    MYSQL_PSW=root
    MYSQL_ROOT_PASSWORD=root
    MYSQL_DATABASE=bootdb
    
    JWT_SECRET=32characterscomplicatedkey
    JWT_EXP=1
    
    USERS_LIMIT=2 # including the admin account, so <= 0 if undefined, >= 2 if defined
    UPLOAD_DIR=/upload-dir
    API_PORT=8080
    
    CACHE_TTL=86400
    CACHE_HOST=cache
    CACHE_PORT=6379
    
    TRAFLE_KEY=your key from https://trefle.io/
    
    ALLOWED_ORIGINS=*
  • CreateInside frontend.env

    that
    folder, frontend.envcreate
    PORT=3000a API_URL=http://hostIPadress:8089/apifile WAIT_TIMEOUT=5000
    
    PAGE_SIZE=25
    
    BROWSER=none

    Createnamed docker-compose.yml with this content:

    version: "3"
    
    name: plant-it
    services:
      backend:server:
        image: msdeluise/plant-it-backend:server:latest
        env_file: backend.server.env
        depends_on:
          - db
          - cache
        restart: unless-stopped
        volumes:
          - "./srv/Files/path/Plant-it/upload-dir:/upload-dir"
        ports:
          - "8089:8080:8080"
          #match- with frontend"3000:3000"
    
      db:
        image: mysql:8.0
        restart: always
        env_file: backend.server.env
        volumes:
          - "./srv/Files/path/Plant-it/db:/var/lib/mysql"
    
      cache:
        image: redis:7.2.1
        restart: always
    frontend:
    image:
  • msdeluise/plant-it-frontend:latest
  • env_file:

    Inside frontend.that folder, create a file named server.env links: - backend ports: - "3009:3000" #match with backendthis content:

#
# DB
#
MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USERNAME=root
MYSQL_PSW=root
MYSQL_DATABASE=bootdb
MYSQL_ROOT_PASSWORD=root

#
# JWT
#
JWT_SECRET=putTheSecretHere
JWT_EXP=1

#
# Server config
#
USERS_LIMIT=-1
UPLOAD_DIR=/upload-dir
API_PORT=8080
FLORACODEX_KEY=
LOG_LEVEL=DEBUG
ALLOWED_ORIGINS=*

#
# Cache
#
CACHE_TTL=86400
CACHE_HOST=cache
CACHE_PORT=6379

  • Run the docker compose file (docker compose -f docker-composecompose.yml up -d

    ),

    Change port binding

    Backend

    If you don't want to usethen the defaultservice portwill be available at 8080localhost:3000, you can follow these steps:

    • changewhile the portREST bindingAPI inwill thebe available at docker-compose.ymllocalhost:8080/api file, e.g. (9090:8080 to setup the port 9090localhost:8080/api/swagger-ui/index.html for the backenddocumentation serviceof them).
    • update

    Take a look at the API_URLdocumentation (frontend.env file) variable in order to points tounderstand the correctavailable backend address

Frontend

If you don't want to use the default port 3000, you can follow these steps:configurations.

  • change the port binding in the docker-compose.yml file, e.g. 4040:3000 to setup the port 4040 for the frontend service