Jump to content

Installation Guide

From Logistack
Revision as of 04:03, 7 October 2025 by Lee Miller (talk | contribs) (Created page with "= LogiStack Pro — Installation Guide = This guide covers a fresh install of LogiStack Pro on a Linux web server with PHP and MySQL/MariaDB. == 1) Prerequisites == * Web server: Apache 2.4+ or Nginx 1.18+ with PHP-FPM * PHP: 8.1+ (8.2/8.3 recommended) with required extensions: pdo_mysql, mbstring, intl, openssl, curl, json, fileinfo, zip, gd (or imagick), opcache * Database: MySQL 8.0+ or MariaDB 10.5+ * Shell access to create database and set file permissions * A dom...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LogiStack Pro — Installation Guide

This guide covers a fresh install of LogiStack Pro on a Linux web server with PHP and MySQL/MariaDB.

1) Prerequisites

  • Web server: Apache 2.4+ or Nginx 1.18+ with PHP-FPM
  • PHP: 8.1+ (8.2/8.3 recommended) with required extensions: pdo_mysql, mbstring, intl, openssl, curl, json, fileinfo, zip, gd (or imagick), opcache
  • Database: MySQL 8.0+ or MariaDB 10.5+
  • Shell access to create database and set file permissions
  • A domain or hostname with HTTPS available

2) Obtain the application

  • Place the application files under your web root, for example:
 * /var/www/logistack (or your hosting account’s web directory)
  • Directory layout (example):
/var/www/logistack/
  assets/
  customer/
  includes/
  pro/
  uploads/
    invoices/
    pod/
  index.php

3) Create the database

  • Create a database and a user with privileges:
CREATE DATABASE logistack DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'logistack'@'%' IDENTIFIED BY 'strong-password';
GRANT ALL PRIVILEGES ON logistack.* TO 'logistack'@'%';
FLUSH PRIVILEGES;
  • If you have a schema SQL file, import it now. Otherwise create the minimal tables you need (users, customers, jobs, job_pod_files, invoices, settings). Example minimal cores:
-- settings (key/value store)
CREATE TABLE IF NOT EXISTS settings (
  k VARCHAR(64) PRIMARY KEY,
  v TEXT NOT NULL,
  updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- users (unified auth with roles)
CREATE TABLE IF NOT EXISTS users (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(120) NOT NULL,
  email VARCHAR(190) NOT NULL UNIQUE,
  password_hash VARCHAR(255) NOT NULL,
  role ENUM('admin','manager','supervisor','superuser','staff','driver','customer') NOT NULL DEFAULT 'staff',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- customers (linked to users for role=customer)
CREATE TABLE IF NOT EXISTS customers (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  user_id INT UNSIGNED NULL UNIQUE,
  company VARCHAR(190) NOT NULL,
  contact_name VARCHAR(190) NOT NULL,
  email VARCHAR(190) NOT NULL,
  phone VARCHAR(40) NULL,
  billing_address TEXT NULL,
  FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- jobs
CREATE TABLE IF NOT EXISTS jobs (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  customer_id INT UNSIGNED NOT NULL,
  driver_id INT UNSIGNED NULL,
  pickup_address TEXT NOT NULL,
  drop_address TEXT NOT NULL,
  price DECIMAL(10,2) NULL,
  status VARCHAR(40) NOT NULL DEFAULT 'open',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  delivered_at TIMESTAMP NULL,
  video_url VARCHAR(500) NULL,
  FOREIGN KEY (customer_id) REFERENCES customers(id) ON UPDATE CASCADE ON DELETE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- POD files
CREATE TABLE IF NOT EXISTS job_pod_files (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  job_id INT UNSIGNED NOT NULL,
  driver_id INT UNSIGNED NULL,
  file_path VARCHAR(255) NOT NULL,
  uploaded_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY (job_id) REFERENCES jobs(id) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- invoices (basic)
CREATE TABLE IF NOT EXISTS invoices (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  job_id INT UNSIGNE_