Skip to content

Installation

This guide is for you if you want to install the TaskView API server and database on your own server. After installation, you will be able to connect to your server through the TaskView Web App or using the mobile apps: TaskView iOS and TaskView Android.

Infrastructure

The server side is provided as Docker images and includes three containers:

  • db – PostgreSQL
  • migration – migrations for db
  • taskview-api-server – the TaskView API server that handles all requests and manages the database (does not contain UI/WebApp) for connecting use official web app and mobile apps. Container with web app "UI" will be published later

Analytics

TaskView server and applications do not use any analytics system or ads.

NO ADS!
NO ANALYTICS!

Step 0: Request license file

DANGER

For commercial use, you must purchase a license.

INFO

To run the TaskView server you need a License. For personal use it is absolutely free.

To obtain a license, send an email to [email protected] with the subject TaskView License. The email should contain:

  • Company name (for personal use you can use your email)
  • Maximum users count (Max 7 users for personal use)

Company name will be used as value for header X-Taskview-Server-Owner for each HTTP request

Step 1: Install Docker and Docker Compose

TaskView server is distributed as a Docker image. You need to install Docker and Docker Compose on your server.

Download Docker images

You can download TaskView Docker images here.

TaskView API

TaskView API image

bash
docker pull gimanhead/taskview-api-server

TaskView DB Migration

TaskView DB Migration

bash
docker pull gimanhead/taskview-db-migration

Step 2: Create .env files

TaskView requires two .env files – one for PostgreSQL and one for TaskView API.

  • .env.postgresql
  • .env.taskview

Why not a single .env file?

It is better to keep credentials separated. PostgreSQL does not need credentials from TaskView.

conf
POSTGRES_USER="tvdbuser"       
POSTGRES_PASSWORD="tvdbpass"   
POSTGRES_DB="taskviewdb"       
LANG=C.UTF-8
LC_ALL=C.UTF-8
POSTGRES_INITDB_ARGS=--locale=C.UTF-8
TZ=UTC
PGTZ=UTC
conf
DB_HOST="db"
DB_USER="tvdbuser"             
DB_PASSWORD="tvdbpass"         
DB_NAME="taskviewdb"           
DB_PORT=5432
APP_PORT=1401
JWT_ALG="HS256"
JWT_SIGN="12312312312312"      
ACCESS_LIFE_TIME="3d"
REFRESH_LIFE_TIME="9d"

# change this if you want use email functions 
# like recovery/password change/login by code
SMTP_HOST="smtp"
SMTP_PORT=465
SMTP_USERNAME="smtp-user-here"
SMTP_PASSWORD="smtp-password"
SMTP_ENCRYPTION="ssl"
SMTP_FROM_NAME="TaskViewApiServer"
SMTP_FROM_EMAIL="smtp"

# Constant value
APP_URL="https://taskview.handscream.com"

Step 3: Add docker-compose.yaml

WARNING

⚠️ Do not miss to put .env files near the docker-compose.yaml.
⚠️ Be careful with exposing ports 5432 for public server!

WARNING

⚠️ Do not miss to pass TaskView.lic file to the docker container.

yaml
services:
  db:
    image: postgres:17
    restart: unless-stopped
    env_file:
      - ./.env.postgresql 
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U tvdbuser -d taskviewdb"]
      interval: 5s
      timeout: 5s
      retries: 5

  migration:
    image: gimanhead/taskview-db-migration:1.14.0
    restart: "no"
    depends_on:
      db:
        condition: service_healthy
    env_file:
      - ./.env.taskview
  
  taskview-api-server:
    image: gimanhead/taskview-api-server:1.14.0
    restart: "no"
    ports:
      - "1401:1401"
    depends_on:
      db:
        condition: service_healthy
      migration:
        condition: service_completed_successfully
    env_file:
      - ./.env.taskview
    volumes:
      - ./path-to-license-file/TaskView.lic:/usr/src/app/TaskView.lic
      - /local-log-folder/log:/usr/src/app/logs

volumes:
  pgdata:

Step 4: Run Docker Compose

Run TaskView server:

bash
docker-compose up
# or
docker-compose up -d

More about Docker Compose

Step 5: Check the connection

Default user

By default, the database includes one user with the following credentials:

Default user credentials ⚠️ (MUST BE CHANGED!)

login:    user  
password: user1!#Q

Steps to test:

  1. Open TaskView.
  2. Click Add your server.
  3. Enter http://localhost:1401 and press Add.
  4. Choose Login with password.
  5. Select the server http://localhost:1401.
  6. Enter the default user credentials.
  7. Try to create a Project and Tasks.

⚠️ After successful login, immediately change the default credentials and rerun the container with production credentials.

To generate a secure password hash in Node.js:

js
import { hashSync } from 'bcryptjs';

const passwordHash = hashSync('mySuperPassword', 12); 
console.log(passwordHash);

Step 6: Finalize setup

If you followed all the steps, your system should now be working. After setup, make sure you replace all demo credentials with secure ones.

Change all demo credentials before production

POSTGRES_USER="tvdbuser"
POSTGRES_PASSWORD="tvdbpass"
POSTGRES_DB="taskviewdb"
DB_USER="tvdbuser"
DB_PASSWORD="tvdbpass"
DB_NAME="taskviewdb"
JWT_SIGN="12312312312312"
SMTP_HOST="smtp"
SMTP_PORT=465
SMTP_USERNAME="smtp-user-here"
SMTP_PASSWORD="smtp-password"
SMTP_ENCRYPTION="ssl"
SMTP_FROM_NAME="TaskViewApiServer"
SMTP_FROM_EMAIL="smtp"

Database time zone

Your database must always run in UTC.

bash
docker compose exec db psql -U tvdbuser -d taskviewdb -c "SHOW timezone;"
docker compose exec db date

SMTP

TLS for SMTP

Use SMTP_ENCRYPTION="tls" if you need to use tls

PostgreSQL helpers

Create backup

bash
sudo -u postgres pg_dump -U postgres -d database-name-here -Fc -f /tmp/taskview_backup.dump

Download backup to backup store

bash
rsync -avz user@server:/tmp/taskview_backup.dump ~/backups/

Restore backup

bash
cat ~/backups/taskview_backup.dump | docker exec -i container_id \
  pg_restore \
    -U user-name-here -d database-name-here \
    --no-owner --no-privileges \
    --data-only \
    --disable-triggers

!!! Truncate data in old database USE IT CAREFULLY IT WILL DROP YOUR DATA

bash
docker exec -i container_id psql -U user-name-here -d database-name-here <<'SQL'
SET session_replication_role = replica;
DO $$
DECLARE r record;
BEGIN
  FOR r IN
    SELECT format('%I.%I', schemaname, tablename) AS fqn
    FROM pg_tables
    WHERE schemaname IN ('about','app','tasks','history','tv_auth','collaboration','tasks_auth')
  LOOP
    EXECUTE 'TRUNCATE TABLE ' || r.fqn || ' CASCADE';
  END LOOP;
END $$;
SET session_replication_role = DEFAULT;
SQL