Skip to content

Installation ​

Install the Labmin PHP and Angular Fusion packages via CLI and start the Vite development server.

Prerequisites ​

  • PHP 8.2+ with pdo, pdo_mysql, and mysqli extensions
  • Composer 2
  • Node 22+ (npm, pnpm, or bun)
  • MySQL 5.7/8.x or MariaDB 10.x/11.x

1. Create a Gitea access token (one-time per machine) ​

Labmin's Composer and npm packages are hosted on the private Gitea registry (git.labmin.online). Skip this step if you already have a token configured on your machine.

  1. Open Labmin Gitea → Settings → Applications.
  2. Under Manage Access Tokens, enter a token name (for example, lims-packages).
  3. Expand Select permissions and set:
    • Access level: All (public, private, and limited) (if shown, so private labmin organization packages are included)
    • package → Read — this single Gitea Package Registry scope covers both Composer and npm/pnpm/bun installs. No other permissions are needed.
  4. Click Generate Token and copy it immediately — Gitea displays the token only once.

2. PHP packages & namespaces ​

Add the Labmin Composer registry & install packages ​

bash
composer config repositories.labmin composer https://git.labmin.online/api/packages/labmin/composer

Install the Labmin PHP packages — Composer will prompt for your Gitea username and the access token from Step 1 on first run:

bash
composer require \
  labmin/router:^0.5 \
  labmin/materialize:^0.2 \
  labmin/materialize-my-sql:^0.5 \
  labmin/database-manager:^0.1 \
  labmin/file-storage:^1.3 \
  labmin/access-control:^0.3 \
  labmin/feature-flags:^0.1 \
  labmin/fusion:^0.4

Verify PSR-4 namespace ​

Composer does not have a CLI command for autoload.psr-4. Make sure composer.json maps LIMS\ to admin/ (which automatically covers both LIMS\Platform\ and LIMS\Modules\), then rebuild the autoloader:

json
{
  "autoload": {
    "psr-4": {
      "LIMS\\": "admin/"
    }
  }
}
bash
composer dump-autoload

Platform folder

If the LIMS does not have admin/Platform/ yet, copy it unchanged from lims-demo and run admin/Modules/AccessControlManager/INSTALL/install.sql once. Never edit admin/Platform/ directly in a client LIMS.


3. Wire admin/engine.php ​

Add the Fusion::configure() and LimsRouter::appRequestFile() block in admin/engine.php right after $accessOB->setupAccessControl(...) and before the closing ?> / <!DOCTYPE html> output:

php
include_once("Modules/QualityManager/QualityManager_class.php");
require_once('Ajax/Actions.php');

use Labmin\Fusion\Fusion; 
use LIMS\components\DevTools\DevTools;
use LIMS\Platform\LimsRouter; 

$dev = new DevTools();
if (!isset($_SESSION['loggedin']['devtools']))
    $_SESSION['loggedin']['devtools'] = array();

$url = getPathURL();
$dev->calculatePageLoadTimes(true);

$accessOB = new AccessControl();
$accessOB->setupAccessControl($_SESSION['loggedin']['userID']);

Fusion::configure([ 
    // true: load scripts from the Vite dev server (`npm run dev`).
    // false: load the production build from dist/ (`npm run build`).
    'development' => !(defined('STATE') && in_array(STATE, ['PRODUCTION', 'STAGING'], true)), 
]); 

header('Vary: X-App-Request'); 

if (($appFile = LimsRouter::appRequestFile()) !== null) { 
    require $appFile; 
    exit; 
} 

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...>

4. Frontend & Fusion setup ​

Configure the @labmin registry (optional — one-time per machine) ​

Writes to your user ~/.npmrc (shared across all repositories and read by npm, pnpm, and bun). Skip this if you have already configured it in another repo:

bash
npm config set --location=user @labmin:registry https://git.labmin.online/api/packages/labmin/npm/
npm config set --location=user //git.labmin.online/api/packages/labmin/npm/:_authToken YOUR_TOKEN

Scaffold Fusion & Angular ​

Run @labmin/fusion-ignite to set up Fusion, Angular, Vite, and Tailwind/daisyUI:

bash
npx @labmin/fusion-ignite
bash
pnpm dlx @labmin/fusion-ignite
bash
bunx @labmin/fusion-ignite

5. Run the dev server ​

Start Vite while developing locally (serves scripts on http://localhost:5173):

bash
npm run dev
bash
pnpm dev
bash
bun run dev

Next: create your first module in Build Your First Module.

Labmin LIMS Module Developer Documentation