Skip to content

Commit 3a0cf9b

Browse files
Merge pull request #163 from tazama-lf/20241210-docs-update
docs: guides updated
2 parents c33d0fc + a5e69f7 commit 3a0cf9b

25 files changed

+152
-383
lines changed

Guides/demo-ui-guide.md

+114-51
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
- [Rule Panel Analysis](#rule-panel-analysis)
2121
- [Typology Panel Analysis](#typology-panel-analysis)
2222
- [UI Configuration](#ui-configuration)
23-
- [Deployment instructions](#deployment-instructions)
24-
- [Pre-requisites](#pre-requisites)
25-
- [Installation instructions](#installation-instructions)
23+
- [Demo deployment instructions](#demo-deployment-instructions)
24+
- [Demo UI installation steps for a full service deployment](#demo-ui-installation-steps-for-a-full-service-deployment)
25+
- [Test the end-to-end deployment of the demo UI configuration](#test-the-end-to-end-deployment-of-the-demo-ui-configuration)
26+
- [Configure the demo UI setup](#configure-the-demo-ui-setup)
2627

2728
## Introduction
2829

@@ -248,88 +249,150 @@ The `reset` button restores the settings back to the variables defined in the de
248249

249250
[Top](#top)
250251

251-
## Deployment instructions
252+
## Demo deployment instructions
252253

253-
#### Pre-requisites
254+
The demo UI can be deployed as an optional addon for a public deployment in which case it will include Rule-901 and Typology-999. Follow the guide in the [Full-Stack-Docker-Tazama repository](https://github.com/tazama-lf/Full-Stack-Docker-Tazama)
254255

255-
- Docker Desktop for Windows application should be running
256-
- A public deployment of the Tazama system should be running in docker [Tazama public deployment instructions](https://github.com/tazama-lf/Full-Stack-Docker-Tazama) OR the full service with all private rules should be deployed and running in docker [Tazama full service deployment instructions](full-service-full-stack-docker-tazama.md)
256+
The demo UI can also be deployed with the full service deployment, but the configuration is not currently compatible with the demo UI and the following additional steps are required to run the Tazama demo UI.
257257

258-
#### Installation instructions
258+
## Demo UI installation steps for a full service deployment
259259

260-
**1. Clone the Full-Stack-Docker-Tazama Repository to Your Local Machine**
260+
#### 1. Clone the Full-Stack-Docker-Tazama Repository to Your Local Machine <!-- omit in toc -->
261261

262-
In a Windows Command Prompt, navigate to the full-stack-docker-tazama folder, then clone the repository with the following command:
262+
In a Windows Command Prompt, navigate to the folder where you want to store a copy of the source code. For example, the source code root folder path I have been using to compile this guide is C:\Tazama\GitHub. Once in your source code root folder, clone (copy) the repository with the following command:
263263

264264
```
265-
git clone https://github.com/tazama-lf/tazama-demo -b dev
265+
git clone https://github.com/tazama-lf/Full-Stack-Docker-Tazama -b main
266266
```
267267

268-
**2. Create the demo.env file**
268+
**Output:**
269269

270-
Via VS Code, create a new demo.env file in the full-stack-docker-tazama/env folder with the following contents:
270+
![clone-the-repo](../images/full-stack-docker-tazama-clone-repo.png)
271271

272+
#### 2. Deploy the Core Services via script <!-- omit in toc -->
273+
274+
First, start the Docker Desktop for Windows application.
275+
276+
With Docker Desktop running: from your Windows Command Prompt and from inside the `Full-Stack-Docker-Tazama` folder, execute the following command and follow the prompts:
277+
278+
**Windows**
279+
Command Prompt: `start.bat`
280+
Powershell: `.\start.bat`
281+
282+
**Unix (Linux/MacOS)** <!-- omit in toc -->
283+
Any terminal: `./start.sh`
284+
285+
> [!IMPORTANT]
286+
> Ensure the script has the correct permissions to run. You may need to run `chmod +x start.sh` beforehand.
287+
288+
**Output:**
289+
290+
![start-services-1](/images/full-stack-docker-tazama-start-bat-1.png)
291+
292+
Select `2` from the start.bat docker deployment menu option
293+
294+
![start-services-4](/images/full-stack-docker-tazama-start-bat-4.png)
295+
296+
For option 2 (Full service DockerHub deployment) the output will be as follows:
297+
298+
![full-service-deployed](/images/full-stack-docker-tazama-full-service-option.png)
299+
300+
301+
[Top](#introduction)
302+
303+
#### 3. Configure Tazama for the demo UI <!-- omit in toc -->
304+
305+
Tazama is configured by loading the network map, rules and typology configurations required to evaluate a transaction via the ArangoDB API. The configuration information is hidden in a private repository and if you are a member of the Tazama `frmscoe` Organization on GitHub, you'll be able to clone this repository onto your local machine with the following command:
306+
307+
Change the current folder back to your root source code folder:
308+
```
309+
cd ..
310+
```
311+
312+
Clone the `tms-configuration` repository:
313+
314+
```
315+
git clone https://github.com/frmscoe/tms-configuration -b main
272316
```
273-
# SPDX-License-Identifier: Apache-2.0
274-
275-
NODE_ENV=dev
276-
NEXT_PUBLIC_URL="http://localhost:3001"
277-
PORT="3001"
278-
NEXT_PUBLIC_TMS_SERVER_URL="http://localhost:5000"
279-
NEXT_PUBLIC_TMS_KEY=""
280-
NEXT_PUBLIC_CMS_NATS_HOSTING="nats://nats:4222"
281-
NEXT_PUBLIC_NATS_USERNAME=""
282-
NEXT_PUBLIC_NATS_PASSWORD=""
283-
NEXT_PUBLIC_ARANGO_DB_HOSTING="http://localhost:18529"
284-
NEXT_PUBLIC_DB_USER="root"
285-
NEXT_PUBLIC_DB_PASSWORD=""
286-
NEXT_PUBLIC_WS_URL="http://localhost:3001"
287-
288-
NEXT_PUBLIC_NATS_SUBSCRIPTIONS="['connection', '>', '[email protected]']"
317+
318+
In addition to cloning the configuration repository, we also need to clone the Tazama `Postman` repository so that we can utilize the Postman environment file that is hosted there:
319+
320+
```
321+
git clone https://github.com/tazama-lf/postman -b main
289322
```
290323

291-
![demo.env file](../images/demo-env-file.png)
324+
**Output:**
325+
326+
![clone-config](../images/full-stack-docker-tazama-clone-config.png)
327+
328+
Once these two repositories are cloned, we can perform the following Newman command to load the specific DEMO UI configuration into the ArangoDB databases and collections:
329+
330+
```
331+
newman run collection-file -e environment-file --timeout-request 10200
332+
```
333+
334+
- The `collection-file` is the full path to the location on your local machine where the `tms-configuration\demo\full-service-config-sans-EFRuP.postman_collection.json` file is located.
335+
- The `environment-file` is the full path to the location on your local machine where the `postman\environments\Tazama-Docker-Compose-LOCAL.postman_environment.json` file is located.
336+
- If the path contains spaces, wrap the string in double-quotes.
337+
338+
**Output:**
339+
340+
![execute-config](../images/full-stack-docker-tazama-execute-config.png)
292341

342+
[Top](#introduction)
293343

294-
**3. Edit the docker-compose.yaml file**
344+
#### 4. Restart core processors <!-- omit in toc -->
295345

296-
In the full-stack-docker-tazama folder, open the docker-compose.yaml file and add the following text between 2 other processors
346+
Now that the demo configuration has been loaded we need to restart our core processors. The main reason the configuration needs to preceed the deployment of the processors is that the processors read the network map at startup to set up the NATS pub/sub routes for the evaluation flow.
297347

348+
Navigate back to the `full-stack-docker-tazama` folder:
298349
```
299-
# DEMO
300-
demo:
301-
image: tazamaorg/demo-ui:v1.0.16
302-
env_file:
303-
- path: ./env/demo.env
304-
required: true
305-
restart: always
306-
depends_on:
307-
- tms
308-
- arango
309-
- nats
310-
ports:
311-
- '3001:3001'
350+
cd Full-Stack-Docker-Tazama
351+
```
352+
353+
Execute the following command to restart the core processors:
312354

355+
```
356+
docker restart tazama-ed-1 tazama-tp-1 tazama-tadp-1
313357
```
314358

315-
>> NOTE: the alignment of #DEMO should align with the other headings e.g. #TMS or #NATS-UTILITIES
359+
**Output:**
316360

317-
![docker-compose.yaml file](../images/demo-docker-compose.png)
361+
![processors-restart](../images/demo-processors-restart.png)
318362

363+
[Top](#introduction)
319364

320-
**3. Deploy the Demo**
365+
## Test the end-to-end deployment of the demo UI configuration
321366

322-
From your Windows Command Prompt and from inside the `Full-Stack-Docker-Tazama` folder, execute the following command:
367+
You should be able to submit a test transaction to the Transaction Monitoring Service API and then be able to see the result of a complete end-to-end evaluation in the database. We can run the following Postman test via Newman to see if our deployment was successful:
323368

324369
```
325-
docker compose up demo -d
370+
newman run collection-file -e environment-file --timeout-request 10200 --delay-request 500
326371
```
327372

328-
![docker compose up](../images/demo-docker-compose-up.png)
373+
- The `collection-file` is the full path to the location on your local machine where the `tms-configuration\demo\demo-tms-config-test.postman_collection.json` file is located.
374+
- The `environment-file` is the full path to the location on your local machine where the `postman\environments\Tazama-Docker-Compose-LOCAL.postman_environment.json` file is located.
375+
- If the path contains spaces, wrap the string in double-quotes.
376+
- We add the `--delay-request` option to delay each individual test by 500 milliseconds to give them evaluation time to complete before we look for the result in the database.
377+
378+
**Output:**
379+
380+
![great-success](../images/full-stack-docker-tazama-great-success.png)
329381

330382

383+
## Configure the demo UI setup
331384

385+
Change the default UI configuration settings from 'localhost' to your ip address. You can confirm your ip address by using the command `ipconfig` from the command line.
332386

387+
![localhost](../images/demo-config-localhost.png)
388+
389+
**Output:**
390+
391+
![ipaddress](../images/demo-config-ipaddress.png)
392+
393+
Select the `update` button for the changes to take effect
394+
395+
![demo-landing-page](../images/demo-landing-page.png)
333396

334397

335398

0 commit comments

Comments
 (0)