Skip to content

Commit

Permalink
[INJIVER-444]: update readme file and added fictious assets (#130)
Browse files Browse the repository at this point in the history
* [INJIVER-444]: update readme file and added fictious assets

Signed-off-by: srikanth716 <[email protected]>

* [INJIVER-444]: Organized fictitious assets by placing them in the  directory

Signed-off-by: srikanth716 <[email protected]>

* [INJIVER-444]: updated readme with available tags,release branches and active branches

Signed-off-by: srikanth716 <[email protected]>

---------

Signed-off-by: srikanth716 <[email protected]>
  • Loading branch information
srikanth716 authored Aug 23, 2024
1 parent 8a78a38 commit fa663a5
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 39 deletions.
119 changes: 83 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Inji Verify

Injiverify is a web interface to verify the validity of the QR / credential using a browser from smartphone / tablet / computer. A user should be able to do primariliy 4 key actions - Scan, Validate, Fetch, Display.
Injiverify is a web interface to verify the validity of the QR / credential using a browser from smartphone / tablet / computer. A user should be able to do primariliy 4 key actions - Scan, Validate, Fetch, Display.

# Contents:

This document contains the following sections:
* Installations
* Folder Structure
* Configuration
* Developer Setup
* Demo Setup
* Troubleshoot

- Installations
- Folder Structure
- Configuration
- Developer Setup
- Demo Setup
- Troubleshoot

---

# Installations:
Expand All @@ -20,40 +23,43 @@ Prerequisites:

Can be installed using [nvm](https://github.com/nvm-sh/nvm). Run following commands to install node

```shell
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ nvm install 18
```
```shell
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ nvm install 18
```

- **Docker**

- [Install on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
- [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
- [Other platforms](https://docs.docker.com/engine/install/)
- [Install on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
- [Docker Desktop for Windows](https://docs.docker.com/desktop/install/windows-install/)
- [Other platforms](https://docs.docker.com/engine/install/)

- **Docker Compose**
```Note: Requires installation of Docker. This step can be skippped if Docker desktop(Windows) is installed as it comes along with docker compose. Please install Docker using above links before proceeding for the installation of docker compose```
- [Install as plugin to docker command](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin)
- [Install the Compose standalone](https://docs.docker.com/compose/install/#scenario-three-install-the-compose-standalone)

`Note: Requires installation of Docker. This step can be skippped if Docker desktop(Windows) is installed as it comes along with docker compose. Please install Docker using above links before proceeding for the installation of docker compose`

- [Install as plugin to docker command](https://docs.docker.com/compose/install/#scenario-two-install-the-compose-plugin)
- [Install the Compose standalone](https://docs.docker.com/compose/install/#scenario-three-install-the-compose-standalone)

Once installed, use Docker compose option below to run the Inji Verify application for a quick demo.

---

# Folder Structure:

Once the repo is cloned, following folders can be found under the inji-verify repository folder:

* **helm:** folder contains helm charts required to deploy on K8S
* **inji-verify:** contains the application source code, Dockerfile and docker-compose.yml files
* src (source code)
* Dockerfile
* docker-compose.yml
* **ui-test:** contains the ui automation tests
- **helm:** folder contains helm charts required to deploy on K8S
- **inji-verify:** contains the application source code, Dockerfile and docker-compose.yml files
- src (source code)
- Dockerfile
- docker-compose.yml
- **ui-test:** contains the ui automation tests

---

# Configuration:

The configuration to the Inji Verify application can be passed using the .env file which is present inside the **inji-verify** folder.

It accepts INTERNET_CONNECTIVITY_CHECK_ENDPOINT and INTERNET_CONNECTIVITY_CHECK_TIMEOUT variables at this moment. These are used to check the availability of the internet connection and can be configured when required. The default values are added in the .env file.
Expand All @@ -63,43 +69,59 @@ It accepts INTERNET_CONNECTIVITY_CHECK_ENDPOINT and INTERNET_CONNECTIVITY_CHECK_
# Developer Setup:

Once the repo is cloned, move into the inji-verify repository folder and run the following command to check out to the develop branch:

```shell
cd inji-verify # move into the repository folder
git checkout develop
cd inji-verify # contains source code, Dockerfile and docker-compose.yml
```

### Development server:

To get a development server up and running, run the following commands:

```shell
npm install
npm start
```

### Run Docker Image:
(Note: Make sure that the following commands are run in the directory where Dockerfile is present)

(Note: Make sure that the following commands are run in the directory where Dockerfile is present)

Run the following commands to build and test the application as docker images

```shell
docker build -t <dockerImageName>:<tag> .
docker run -it -d -p 3000:80 --env-file ./.env --name inji-verify-dev <dockerImageName>:<tag>
docker run -it -d -p 3000:8000 --env-file ./.env --name inji-verify-dev <dockerImageName>:<tag>
```

To build the Docker image locally, use the following command. Ensure you are in the directory containing the Dockerfile:

```shell
docker build -t inji-verify:local
```

Stop and delete the docker containers using the following commands:

```shell
docker stop inji-verify-dev
docker rm inji-verify-dev
```

### Run Using Docker Compose:
(Note: Make sure that the following commands are run in the directory where docker-compose.yml file is present)

(Note: Make sure that the following commands are run in the directory where docker-compose.yml file is present)

Use the above image `<dockerImageName>:<tag>` in the docker-compose.yml file and run the following commands to run as docker compose:

```shell
$ docker-compose up -d # if docker compose is installed as a standalone command.
$ docker compose up -d # if docker compose is installed as a plugin to docker command
```

To stop the application, run the following command:

```shell
$ docker-compose down # if docker compose is installed as a standalone command.
$ docker compose down # if docker compose is installed as a plugin to docker command
Expand All @@ -110,81 +132,106 @@ Once started, the application is accessible at http://localhost:3000.
---

# Demo Setup:

This section helps to quickly get started with a demo of the Inji Verify application

Once the repository is cloned, move into the inji-verify repository directory.
Choose one of the release branches that are currently available for the demo:
* release-0.8.0
* release-0.8.1
* release-0.9.0
* master
Choose one of the branches that are currently available for the demo:

release branches:
- release-0.8.x
- release-0.9.x

tags :
- v0.9.0
- v0.8.1
- v0.8.0

active branches:
- master
- develop

```shell
cd ./inji-verify # repository folder
git checkout release-0.9.0 # choose from any of the above branches
git checkout branchName/tagname # choose from any of the above branches
```

To start the application, run the following commands:

```shell
$ cd ./inji-verify # source code folder
$ docker-compose up -d # if docker compose is installed as a standalone command.
$ docker compose up -d # if docker compose is installed as a plugin to docker command
```

The application is now accessible at http://localhost:3000.

Once the demo is done, cleanup using the following command:

```shell
$ docker-compose down # if docker compose is installed as a standalone command.
$ docker compose down # if docker compose is installed as a plugin to docker command
```

# Troubleshoot:

This section contains some common problems that could occur during the setup and steps to resolve then:

## Issue with starting docker compose:

```
no configuration file provided: not found
```

or

```
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml
```

### Solution:

Make sure that you are in the right directory `inji-verify/inji-verify` and the docker-compose.yml file is present in this directory.

Check using `ls` command in ubuntu terminal or `dir` command in windows command prompt for the contents of the current directory

## Issue with ports:

```
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3000 -> 0.0.0.0:0: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
```

### Solution:

Try updating the port in the docker-compose.yml file from 3000:80 to <other_port>:80 and try again

## Issue with building docker image:

```
ERROR: failed to solve: failed to read dockerfile: no such file or directory
```

### Solution:

Make sure that you are in the right directory `inji-verify/inji-verify` and the Dockerfile is present in this directory.

Check using `ls` command in ubuntu terminal or `dir` command in windows command prompt for the contents of the current directory

## Issue with docker engine:

```
docker engine/socket not available
```

### Solution:

In Windows: Start/Restart Docker desktop application

In Ubuntu: Run the following command to make sure that the docker service is running

```shell
sudo systemctl restart docker.service
```
4 changes: 2 additions & 2 deletions inji-verify/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ COPY --from=build /app/build /usr/share/nginx/html

COPY ./nginx.conf /etc/nginx/conf.d/default.conf

# Expose port 80
EXPOSE 80
# Expose port 8000
EXPOSE 8000

ENTRYPOINT [ "./configure_start.sh" ]

Expand Down
2 changes: 1 addition & 1 deletion inji-verify/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
inji-verify:
image: mosipid/inji-verify:latest
ports:
- "3000:80"
- "3000:8000"
environment:
- INTERNET_CONNECTIVITY_CHECK_ENDPOINT=${INTERNET_CONNECTIVITY_CHECK_ENDPOINT-https://dns.google/}
- INTERNET_CONNECTIVITY_CHECK_TIMEOUT=${INTERNET_CONNECTIVITY_CHECK_TIMEOUT-10000}
Expand Down
Binary file added samples/fictitious/Expired/expired-qr-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/Expired/expired-qr-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/Working/valid-qr-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/Working/valid-qr-2.pdf
Binary file not shown.
Binary file added samples/fictitious/blur qrs/blur-1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/fictitious/blur qrs/blur-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fa663a5

Please sign in to comment.