Ownware
Home›Restock›Quickstart
Restock · Quickstart

Restock Quickstart, as shipped in the download

The QUICKSTART.txt in the download — the same steps your delivery email carries.

RESTOCK — QUICKSTART
====================
Inventory Forecasting & Reorder-Point Calculator — self-hosted PHP + MySQL/SQLite.

REQUIREMENTS
------------
  - PHP 8.1+ (tested on 8.3) with extensions: pdo, pdo_sqlite (or pdo_mysql)
  - MySQL 5.7+ OR SQLite 3 (SQLite requires no extra setup)
  - A web server (Apache with mod_rewrite, or Nginx with try_files)


SHARED HOSTING / CPANEL (RECOMMENDED FOR MOST BUYERS)
------------------------------------------------------
1. Upload the CONTENTS of the `app/` folder to your web root (e.g. public_html/)
   or a subdirectory (e.g. public_html/restock/).

2. Make sure this directory is writable by PHP:
     data/
   Via cPanel File Manager: right-click -> Permissions -> 755 or 775.

3. Visit https://yourdomain.com/install/ in your browser.

4. Fill in the installer:
     - Database: choose MySQL (host/name/user/pass) or SQLite (no setup)
     - Business name + currency symbol
     - Forecast window (days of history to average — default 90)
     - Target cover (days of stock a suggested order should reach — default 30)
     - Timezone (the demand window "today" is computed in this zone)
     - Admin name, email, and password

5. The installer writes config.php and sends you to the login page.

6. Sign in, then add products and import sales — or click "Load demo data" on
   the dashboard to explore with a realistic sample business first.


VPS / SELF-HOSTED (APACHE)
--------------------------
  <VirtualHost *:80>
    DocumentRoot /var/www/restock/app
    <Directory /var/www/restock/app>
      AllowOverride All
      Require all granted
    </Directory>
  </VirtualHost>

Run the web installer as above, or use the CLI seeder:
  php bin/demo.php     # loads demo data (login: admin@restock.app / admin123)


NGINX
-----
  root /var/www/restock/app;
  location / { try_files $uri /index.php?$args; }
  location ~ \.php$ { include fastcgi_params; fastcgi_pass unix:/run/php/php-fpm.sock;
                      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
  location ~ /(config\.php|data/|src/|bin/|tests/|controllers/) { deny all; }


DOCKER (QUICK TEST)
-------------------
  docker run --rm -p 8080:8080 -v "$(pwd)/app:/var/www/html" -w /var/www/html \
    php:8.3-cli php -S 0.0.0.0:8080 router.php
  Then visit http://localhost:8080/install/


RUN THE TESTS
-------------
  php app/tests/run.php
  # or:
  docker run --rm -v "$PWD/app:/app" -w /app php:8.3-cli php tests/run.php


DAILY USE
---------
  * Dashboard      — below / near / healthy counts and the most urgent products.
  * Products       — stock, avg daily demand, days left, reorder point, suggested
                     order per SKU; click any product for the full forecast breakdown.
  * Reorder report — everything at or near its reorder point, most urgent first,
                     with quantities + estimated cost. Export CSV for your supplier.
  * Import CSV     — products (sku,name,stock,lead time days,...) and sales
                     history (date,sku,qty). Columns matched by header name.
  * Settings       — forecast window and target cover days: the two dials that
                     drive every number.

  THE MATH (deterministic, no AI):
    avg daily demand = units sold in window / window days
    safety stock     = safety-days x avg demand (or your manual unit override)
    reorder point    = avg demand x lead time + safety stock
    suggested order  = target-cover days x avg demand - current stock

  Forecasts are estimates from your own sales history, not guarantees.


NEW IN 2.0
----------
  * REST API + signed webhooks .... "API & Webhooks" in the sidebar; see API.md
  * Two-factor authentication ..... "Security" in the sidebar
  * Dry-run imports ............... Import CSV now previews every row and writes
                                    nothing until you confirm
  * Reorder alerts ................ Settings -> Email notifications; fires on the
                                    crossing, once, not on every later import
  * One-click backup .............. Security -> Backups (JSON, plus the raw DB on SQLite)
  * Dark mode ..................... the "Theme" toggle at the bottom of the sidebar
  * Uptime ping ................... GET /healthz  (no login required)

  Upgrading from 1.x: overwrite the app files and open the site once. The new tables
  and columns are added automatically; your data is untouched. Back up first anyway.


POST-INSTALL SECURITY CHECKLIST
--------------------------------
  [ ] config.php is protected (the .htaccess does this automatically)
  [ ] data/ is not web-accessible (.htaccess blocks it automatically)
  [ ] Use HTTPS in production
  [ ] Keep PHP updated

Full docs in README.md.

← Back to Restock · Manual · API · Test run

Affiliate program
Recommend tools people own — earn 35% on every sale. 90-day tracking, instant delivery, payouts by Lemon Squeezy.
Become an affiliate →