Skip to content

Commit

Permalink
docs: init docs (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleythedeveloper authored Jul 30, 2024
1 parent 30a1967 commit 5668907
Show file tree
Hide file tree
Showing 79 changed files with 13,591 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/buld_publish_docs.yml.disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# TODO: Enable once tagging is enabled
name: Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: yarn

- name: Install dependencies
run: cd documentation && yarn install --frozen-lockfile
- name: Build website
run: cd documentation && yarn build

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./documentation/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ UNTP mock implementation is a mock app that presents how the decentralized app w
- [Node.js](https://nodejs.org/en/) version 20.12.2
- [yarn](https://yarnpkg.com/) version 1.22.22

## Install dependencies
### Install dependencies

```bash
yarn install
```

## Copy the .app-config.example file to .env for the demo explorer
### Copy the .app-config.example file to .env for the demo explorer

```bash
cp packages/mock-app/src/constants/app-config.example.json packages/mock-app/src/constants/app-config.json
Expand Down Expand Up @@ -65,18 +65,36 @@ cp packages/mock-app/src/constants/app-config.example.json packages/mock-app/src
}
```

## Build the package
### Build the package

```bash
yarn build
```

## Start the project
### Start the project

```bash
yarn start
```

## Documentation

```
$ cd documentation
```

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

## Docker

- Dockerfile
Expand Down
16 changes: 15 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,18 @@ services:
args:
- CONFIG_FILE=./app-config.json
ports:
- 3000:80
- 3000:80

documentation:
build:
context: ./documentation
dockerfile: Dockerfile
ports:
- 3002:3002
environment:
- PORT=3002
- DOCS_URL=http://0.0.0.0
- DOCS_BASE_URL=/
volumes:
- ./documentation:/app
- /app/node_modules
20 changes: 20 additions & 0 deletions documentation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
27 changes: 27 additions & 0 deletions documentation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Setup the environment
FROM node:20-alpine

WORKDIR /app

# Set the environment variables
ENV PORT=3002 \
DOCS_URL=http://0.0.0.0 \
DOCS_BASE_URL=/

# Install the dependencies
COPY package.json yarn.lock ./

RUN yarn install --frozen-lockfile

# Build the documentation site
COPY . .

RUN yarn run build

# Expose the port the documentation site will run on
EXPOSE ${PORT}

# Serve the documentation site
CMD yarn serve --port $PORT --host 0.0.0.0


73 changes: 73 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Documentation Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Prerequisites

- [Node.js](https://nodejs.org/en/) version 20.12.2
- [yarn](https://yarnpkg.com/) version 1.22.22

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Docker

This documentation site can be run in a Docker container. Below are the instructions for setting up and running the documentation site using Docker.

### Building the Docker Image

To build the Docker image, run the following command in the `documentation` directory of the project:

```bash
docker build -t tests-untp-docs-app .
```

Replace `tests-untp-docs-app` if your prefer a different image name.

#### Running the Container

After building the image, you can run the container using:

```bash
docker run -d -p 3002:3002 tests-untp-docs-app
```

This command maps port 3002 of the container to port 3002 on your host machine.

#### Accessing the Application

Once the container is running, you can access the documentation site by opening a web browser and navigating to:

```
http://localhost:3002
```

#### Environment Variables

The following environment variables are set in the Dockerfile:

- `PORT`: 3002 (The port on which the application will run)
- `DOCS_URL`: http://0.0.0.0 (The URL for the documentation site)
- `DOCS_BASE_URL`: / (The base URL for the documentation site)

You can override these variables when running the container if needed.

3 changes: 3 additions & 0 deletions documentation/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
3 changes: 3 additions & 0 deletions documentation/docs/_disclaimer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:::info
Please note that this content is under development and is not ready for implementation. This status message will be updated as content development progresses.
:::
44 changes: 44 additions & 0 deletions documentation/docs/introduction/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar_position: 1
title: Introduction
---

import Disclaimer from './../\_disclaimer.mdx';

<Disclaimer />

The UN Transparency Protocol (UNTP) Test Suite is a comprehensive set of tools designed to ensure conformance to the [UNTP Specification](https://uncefact.github.io/spec-untp/). This robust suite enables implementers to thoroughly evaluate their UNTP implementations across various aspects, from technical interoperability to semantic validation.

The Test Suite comprises four primary components:
- Mock Apps
- Technical Interoperability
- Semantic Interoperability
- Graph Validation

## Mock Apps
[Mock Apps](/docs/mock-apps/) allow implementers to model a value chain using UNTP and integrate their implementation at any point within it. These apps provide a flexible environment for testing and demonstrating UNTP functionality in real-world scenarios.

## Technical Interoperability
This component tests the technical interoperability of implementations based on the UNTP specification. It ensures that the technical aspects of the implementation align with the protocol's requirements.

## Semantic Interoperability
The Semantic Interoperability tests focus on verifying that the credentials produced by an implementation are semantically consistent with the UNTP specification. This allows implementors to be conformant with the core specification while allowing for extensions.

## Graph Validation
This component tests the entire trust graph produced by an implementation against the UNTP specification, ensuring the integrity and validity of the trust relationships within the system.

## Extensibility
It's important to note that the Semantic Interoperability, Graph Validation, and Mock Apps components can be extended to meet the specific needs of industries or value chain actors while still conforming to the core UNTP specification. This flexibility allows for customisation without compromising the protocol's fundamental principles.

## Tiered Approach
The UNTP Test Suite follows a tiered approach, with each tier building upon the previous one:

**Tier 1**: Focuses on technical interoperability.

**Tier 2**: Adds semantic interoperability testing.

**Tier 3**: Incorporates graph validation.

This tiered structure allows implementers to progressively validate their UNTP implementations, ensuring a thorough and systematic approach to conformance testing.

By utilising the UNTP Test Suite and the Mock Apps, implementers can confidently develop, test, and deploy UNTP-compliant systems, fostering greater transparency and trust across global value chains.
28 changes: 28 additions & 0 deletions documentation/docs/mock-apps/common/asset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
sidebar_position: 28
title: Asset
---

import Disclaimer from '../.././\_disclaimer.mdx';

<Disclaimer />

## Description
The `Asset` object contains information about the brand's visual identity and verification credentials.

## Example

```json
{
"logo": "https://storage.googleapis.com/acrs-assets/logos/Top-Line-Steel-Logo.jpg",
"brandTitle": "Top Line Steel",
}
```

## Definitions
<!-- TODO: Find out if brandTitle, passportVC and transactionEventVC is actually being used in the system-->

| Property | Required | Description | Type |
|----------|:--------:|-------------|------|
| logo | Yes | The URL of the brand's logo image. (Displayed in the header and sidebar)| String |
| brandTitle | Yes | The title or name of the brand. | String |
Loading

0 comments on commit 5668907

Please sign in to comment.