No description
Find a file
Claudio Maggioni fc4fcf0552 Merge branch 'fix-properties' into 'master'
fix

See merge request sa4-2020/the-sanmarinoes/backend!68
2020-03-26 11:21:01 +01:00
docs polished er diagram for current db model 2020-02-27 15:48:53 +01:00
git-hooks First Controller 2020-02-25 14:25:03 +01:00
gradle/wrapper Added an initial pipeline for the continous integration 2020-03-11 17:35:04 +01:00
src fix 2020-03-26 11:17:42 +01:00
.gitignore Added installation instructions and tweaked Dockerfile 2020-03-25 14:57:46 +01:00
.gitlab-ci.yml Added installation instructions and tweaked Dockerfile 2020-03-25 14:57:46 +01:00
build.gradle idk 2020-03-17 14:13:34 +01:00
Dockerfile Added installation instructions and tweaked Dockerfile 2020-03-25 14:57:46 +01:00
gradle.yml Unauthenticated socket works 2020-03-14 20:32:54 +01:00
gradlew Imported Spring Boot starter project 2020-02-20 15:22:37 +01:00
gradlew.bat Imported Spring Boot starter project 2020-02-20 15:22:37 +01:00
README.md fix 2020-03-26 11:17:42 +01:00
settings.gradle Imported Spring Boot starter project 2020-02-20 15:22:37 +01:00
socket_test.html Socket now sends sensor updates 2020-03-15 13:41:57 +01:00

backend

Installation guide

In order to install a SmartHut.sm, you can use Docker and Docker Compose in order to create che corresponding containers.

Use the following docker-compose.yml example file. Change the values of $PASSWORD and $SECRET to respectively the chosen PostgreSQL password and the JWT secret used to run the server. $SECRET must be at least 64 chars long.

version:            '2.1'

services:
  smarthutdb:
    restart:             always
    image:               postgres:12-alpine
    container_name:      smarthutdb
    volumes:
      - ./data:/var/lib/postgresql/data
    environment:
      PGDATA:            /var/lib/postgresql/data/data
      POSTGRES_DB:       smarthut
      POSTGRES_USERNAME: postgres
      POSTGRES_PASSWORD: $PASSWORD
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 30

  smarthutbackend:
    restart:             always
    image:               smarthutsm/smarthut-backend:M1
    depends_on:
      smarthutdb:
        condition: service_healthy
    ports:
      - 8080:8080
    environment:
      - POSTGRES_JDBC=jdbc:postgresql://smarthutdb:5432/smarthut
      - POSTGRES_USER=postgres
      - POSTGRES_PASS=$PASSWORD
      - SECRET=$SECRET
      - MAIL_HOST=smtp.gmail.com
      - MAIL_PORT=587
      - MAIL_STARTTLS=true
      - MAIL_USER=smarthut.sm@gmail.com
      - MAIL_PASS=dcadvbagqfkwbfts
      - BACKEND_URL=http://localhost:8080
      - FRONTEND_URL=http://localhost

  smarthut:
    restart:             always
    image:               smarthutsm/smarthut:M1
    ports:
      - 80:80
    environment:
      - BACKEND_URL=http://localhost:8080