docs(install): refactoring on the install folder

This commit is contained in:
2025-09-30 06:00:08 -05:00
parent 45bf88aef6
commit 5e4ffa2c27
5 changed files with 190 additions and 11 deletions

View File

@@ -0,0 +1,81 @@
---
sidebar_position: 3
id: install-iis
---
# Runing in IIS (Internet Information Services)
This is the Approved way of running via windows and utlizing HTTPS
This process is optional and not needed to run the app.
Please note that if you plan to utlize the scanner app you must use IIS to run as PWA apps requires ssl
## Creating the application
1. Open IIS
2. Expand the plant and select application pools
![](/img/install/applicationPools.png)
3. Right click and create application
![](/img/install/createApplicationPool.png)
4. Name is LogisticsSupportTool
- NOTE: You must not have spaces due to other scripts utlizing this name for updating.
- Change .NET CLR verion to not managed
- leave the rest as default
![](/img/install/pool.png)
## Create the website
1. Expand the Sites
![](/img/install/defaultsite.png)
2. Right click on default site and click "Add Application..."
![](/img/install/addApplication.png)
3. Fill out the form like below
- For the Alias Enter LST
- Change the Application pool to Logistics Support Tool
- Change the phycical path to the path that you have the lst wrapper in, below is the example we used to install the app from the install instructions.
```bash
E:\LST\lstWrapper\publish
```
![](/img/install/application.png)
## Making sure websocket is enabled
By default websocket is disbabled and we need this in order to run the app.
Open:
```bash
C:\Windows\System32\inetsrv\config\applicationHost.config
```
Search inside for the section definition:
```xml
<section name="webSocket" overrideModeDefault="Deny" />
```
Change it to:
```xml
<section name="webSocket" overrideModeDefault="Allow" />
```
Save and restart IIS:
```bash
iisreset
```

View File

@@ -0,0 +1,184 @@
---
sidebar_position: 1
id: install
---
# Install Process
Get the latest build **From Azure**.
<!-- Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. -->
### What you'll need
- [Node.js](https://nodejs.org/en/download/) version 22.18 or above:
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
- [VS Code](https://code.visualstudio.com/download):
- If you plant to contribute or need to tweak some data this is the recommended editor.
- During the app install updates and minor changes we will always be refering to VScode
- [Notepad ++](https://notepad-plus-plus.org/);
- An alternate solution to doing minor edits to the app including changes to the .env file
- [NSSM](https://nssm.cc/);
- This is used to create the services and required to be in the root of the app.
- [Postgres](https://www.postgresql.org/download/);
- This is the DB of choice.
## Other Items
### Firewall rules
If you will be using lst app on a tablet or scanner you will need to have 443 open
please request this from IT
- Logistics network as the source
- Alpla prod server ip as the destination
- ports to open
- 443 # to access via https://
- 3000 # This is in case you need to go direct to the app utlizing an ip:port
## Creating the app
Create a new directory where all you will host the app recommeneded
```bash
E:\LST
```
Extract the build you downloaded from the repo.
You should see something similar to
```bash
LST/
├── .vscode/ # vscode settings to match across all developers/contributors
│ ├── settings.json
├── controller/
│ ├── main.go
│ ├── build_app.go
│ ├── bump_build.go
│ ├── zip_app.go
├── dist # Main backend
│ ├── internal
│ ├── db
│ ├── main.js
├── frontend/
│ ├── dist # Frontend app
│ ├── public
├── lstDocs/
│ ├── build # Docs on the entire app
├── lstWrapper/
│ │ ├── LastWrapper.exe
│ │ ├── LstWRapper.dll
│ │ ├── webconfig.xml
│ │ ├── several other files related to the wrapper
├── scripts/
│ │ ├── services.ps1 #service controler
├── .env-example
├── nssm.exe
├── package.json
├── package-lock.json
├── README.md
├── CHANGELOG.md
├── Dockerfile
├── docker-compose.yml
├── drizzle.config.ts
├── migrations # for all the db migrations
├── LICENSE
```
## Doing the intial setup
Make sure you have installed both
- VScode
- Node
### Installing dep
open the app in vs code
open terminal
![](/img/install/terminal.png)
run the install command
```bash
npm run install
```
### Creating the env
Create a copy of the .env-example file and rename it .env
Please review all comments in the env file to make sure you are only change what is needed to be change.
```bash
# server port - should only be changed if you really need this changed as its linked to the wrapper
VITE_PORT=4000
# TMS AccoutINFO - This is for Transport Insight only
USERID=ALPLAWS
PASSWORD=password
REQUESTUSER="ALPLAIMPORT"
# logLevel
LOG_LEVEL=debug
# alpaprod tec apiKey
TEC_API_KEY=apikey
# postgres db
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=username
DATABASE_PASSWORD=supersecretpasswrod
DATABASE_DB=lst
# prodServer
PROD_SERVER=usmcd1vms036
PROD_PLANT_TOKEN=test3
PROD_USER=alplaprod
PROD_PASSWORD=password
```
### DB setup
Make sure you have installed Postrgres, and recommended to install PGAdmin
After the install is completed please open PGAdmin and login with
Create a new database and call it lst_db.
NOTE\* You can change the db name you just need to match it to the same as name as you have set in the .env file
back in the termnial run the following command
```bash
npm run db:migrate
```
### First Startup
Last step before moveing over to running as a service and running in iis please start up by running the below
```bash
npm start
```
As this is the first time you will see a lot of logs and eventually see the system say Running.
Please visit
[http://localhost:4000](http://localhost:4000/)
to validate everything is running and create the intial user
by going to [Register](http://localhost:4000/register).
Please note the first user created is the system admin user, after created you will be able to login and change settings and activate features, as most features are disabled by default.
once you are ready to set this up and leave it head over to [Setting up As Service](/docs/install-extras/services)

View File

@@ -0,0 +1,62 @@
---
sidebar_position: 2
id: install-service
---
# Run as a service
To run LST as a serive there are 2 options to accomplish this
## Install
Utlizing the powershell script that is in the scripts folder
Open vscode once again or clear the termnial if you still have it open.
Next run the code below.
```bash
.\scripts\services.ps1 -serviceName "LST_app" -option "install" -appPath "E:\LST" -description "Logistics Support Tool" -command "run start"
```
This will
- Create a windows service using NSSM and call it LST_app
- It will also set the restart policy to restart 3 times
- It will depend on MSQLServer to make sure this is up and running before we try to connect to it
- It will start the node app
- And Lastly will set it to auto start once the server comes up.
## Stop the Service
To stop the service you can utilize the same script
```bash
.\scripts\services.ps1 -serviceName "LST_app" -option "stop" -appPath "E:\LST"
```
This will completely stop the service and you will need to start it
## Start the Service
Yet again utilizing the same script
```bash
.\scripts\services.ps1 -serviceName "LST_app" -option "start" -appPath "E:\LST"
```
## Deleteing the Service
This will compeltely remove the service from the server
```bash
.\scripts\services.ps1 -serviceName "LST_app" -option "delete" -appPath "E:\LST"
```
## Restart
This will stop the service wait 2 seconds and restart the service
```bash
.\scripts\services.ps1 -serviceName "LST_app" -option "restart" -appPath "E:\LST"
```