# Logistics support tool

> The support tool for ALPLA Prod

## Overview

Quick summary of current rewrite/migration goal.

- **Phase:** Backend rewrite
- **Last updated:** 2026-06-17

---

## Feature Status

| Feature | Description | Status |
|----------|--------------|--------|
| User Authentication | ~~Login~~, ~~Signup~~, API Key | 🟨 In Progress |
| User Profile | ~~Edit profile~~, upload avatar | 🟨 In Progress |
| User Admin | ~~Edit user~~, ~~create user~~, remove user, alplaprod user integration | ⏳ Not Started |
| Notifications | ~~Subscribe~~, ~~Create~~, ~~Update~~, ~~~~Remove~~, Manual Trigger | 🟨 In Progress |
| Datamart | ~~Create~~, ~~Update~~, ~~Run~~, Deactivate | 🟨 In Progress |
| Frontend | Analytics and charts | ⏳ Not Started |
| Docs | Instructions and trouble shooting | ⏳ Not Started |
| One Click Print | ~~Get printers~~, monitor printers, label process, material process, Special processes | 🟨 In Progress |
| Silo Adjustments | Create, History, Comments | ⏳ Not Started |
| Demand Management | Orders, Forecast, Special Mappings, Create trucks, Load Trucks (tablet scanning) | ⏳ Not Started |
| Open Docks | Integrations | 🟨 In Progress |
| Transport Insight | Integrations | ⏳ Not Started |
| Quality Request Tool | Add Pallet, Monitor for moved, status changes, alerts | ⏳ Not Started |
| Logistics | Consume material, return and print, label info, relocate | ⏳ Not Started |
| EOM | ~~Endpoints~~, Report Pull for finance, SSRS report | 🟨 In Progress |
| ~~OCME~~ | ~~Custom integration~~ | Canceled |
| API Migration | Moving to new REST endpoints | 🔧 In Progress |
| System | Tests,Builds, Updates, Remote Logging, DB Backups, Alerting | ⏳ Not Started |

_Status legend:_  
✅ Complete 🟨 In Progress ⏳ Not Started

---

# Install

## Files needed to be downloaded before install.

### To run the server

-   [PostgresSQL](https://www.postgresql.org/download/windows/) - current version using is 17
-   [NodeJS](https://nodejs.org)
-   [NSSM](https://nssm.cc/)

### To manage the server

-   [VSCODE](https://code.visualstudio.com/)

## Creating directories needed

-   Create a new folder where we will host the server files.
    -   Copy the nssm.exe into this folder
-   Copy the get the build from the releases and extract.
    -   This will house all the compiles and minified files needed to start the server up, this includes the frontend.
-   Save the nssm.exe into this folder as well, this will be used to control the service.

## Do the initial install

### DB instal setup

1. Install postgres
2. Open pgAdmin
3. create a new Database named lst_db_v3. this can also be to your liking

### Initial server setup

1. Open VSCode and navigate to the folder where you extracted the files.
2. Click trusted when it pops up.
3. Open a terminal window inside vscode.
4. Run the install script this will install all dependence's needed as well as do all the database migrations


### Create the .env file

In the root of the folder create a new .env file by renaming .env-example to .env

change all the parameters to your desired server

```bash
npm run install --omit=dev
```

Next we want to do an initial db

```bash
npm run dev:db:migrate
```

### Run the start command to get all the basic settings and modules installed

1. Run the below

```bash
npm start
```

### Creating first user.

 Open http://[SERVER]:[PORT]/api/docs or postman and create a user.
    - Please do not try to manually enter a new user this is due to how the password is hashed, as well as setting systemAdmin for the first user.
    - Change the server and port to what you changed in the DB.

### Running as a serivice.

You want to CD into the scripts folder.

```bash
cd .\scripts\
```

Next use the example command below to get the service up and running.

-   Options legend
    -   serviceName = not recommended to change to reduce issues with the update process
    -   option = use install for the install, but you can use this script later to stop, start, restart the service.
    -   appPath = where did you extract the server files
    -   description = no need to change this unless you want it to be something else
    -   command = do not change this unless you know what your doing and really need to change this.

```powershell
.\services.ps1 -serviceName "LSTV3_app" -option "install" -appPath "D:\LS_V3T" -description "Logistics Support Tool V3" -command "run start"
```
