|
1 | 1 | dtool lookup webapp |
2 | 2 | =================== |
3 | 3 |
|
4 | | -- GitHub: https://github.com/jic-dtool/dtool-lookup-webapp |
5 | | -- Free software: MIT License |
| 4 | +.. image:: https://github.com/livMatS/dtool-lookup-webapp/actions/workflows/build-and-test.yml/badge.svg |
| 5 | + :target: https://github.com/livMatS/dtool-lookup-webapp/actions/workflows/build-and-test.yml |
| 6 | + :alt: dtool-lookup-webapp build and test |
6 | 7 |
|
7 | | -Web application to query and display information about datasets stored in one |
8 | | -or more base URIs. |
| 8 | +.. image:: https://img.shields.io/badge/License-MIT-yellow.svg |
| 9 | + :target: https://opensource.org/licenses/MIT |
| 10 | + :alt: License: MIT |
| 11 | + |
| 12 | +- GitHub repository: https://github.com/jic-dtool/dtool-lookup-webapp |
| 13 | +- License: MIT License (https://opensource.org/licenses/MIT) |
| 14 | + |
| 15 | +This web application allows querying and displaying information about datasets stored in one or more base URIs. |
9 | 16 |
|
10 | 17 | Dependencies |
11 | 18 | ------------ |
12 | 19 |
|
13 | | -This web application depends on having two other web services to talk to: |
| 20 | +The web application requires two other web services: |
14 | 21 |
|
15 | | -1. `dtool-lookup-server <https://github.com/jic-dtool/dtool-lookup-server>`_ |
16 | | -2. `token-generator-ldap <https://github.com/jic-dtool/token-generator-ldap>`_ |
| 22 | +1. dtool-lookup-server: https://github.com/jic-dtool/dtool-lookup-server - Provides a means to search and display dataset metadata. |
| 23 | +2. token-generator-ldap: https://github.com/jic-dtool/token-generator-ldap - Facilitates user authentication. |
17 | 24 |
|
18 | | -The first provides a means to search and display dataset metadata. |
19 | | -The latter provides a means to authenticate users. |
| 25 | +Setup |
| 26 | +----- |
20 | 27 |
|
21 | | -Preamble |
22 | | -------- |
| 28 | +Navigate to the `dtool-lookup-webapp` directory: |
23 | 29 |
|
24 | | -:: |
| 30 | +.. code-block:: bash |
25 | 31 |
|
26 | 32 | cd dtool-lookup-webapp |
27 | 33 |
|
| 34 | +Create a `.env` file in the `dtool-lookup-webapp` directory with the following contents: |
28 | 35 |
|
29 | | -Create a file `.env` in the `dtool-lookup-webapp` directory with the following contents: |
| 36 | +.. code-block:: bash |
30 | 37 |
|
31 | | -``` |
32 | | -VUE_APP_DTOOL_LOOKUP_SERVER_URL="http://localhost:5000" |
33 | | -VUE_APP_DTOOL_LOOKUP_SERVER_TOKEN_GENERATOR_URL="http://localhost:5001/token" |
34 | | -``` |
| 38 | + VUE_APP_DTOOL_LOOKUP_SERVER_URL="http://localhost:5000" |
| 39 | + VUE_APP_DTOOL_LOOKUP_SERVER_TOKEN_GENERATOR_URL="http://localhost:5001/token" |
35 | 40 |
|
36 | 41 | For deployment, replace these URLs with the actual endpoints of the lookup server and the token generator. |
37 | 42 |
|
| 43 | +Customization options for the landing page are available through the following environment variables in the `.env` file: |
| 44 | + |
| 45 | +.. code-block:: text |
| 46 | +
|
| 47 | + VUE_APP_FIRST_CONTAINER_TITLE=Log in |
| 48 | + VUE_APP_SECOND_CONTAINER_TITLE=dserver |
| 49 | + VUE_APP_SECOND_CONTAINER_MESSAGE=Welcome to <b>dserver</b>'s webapp. |
| 50 | + VUE_APP_THIRD_CONTAINER_HEADING=Access |
| 51 | + VUE_APP_THIRD_CONTAINER_MESSAGE=Some notes on how to gain access. |
| 52 | + VUE_APP_FOURTH_CONTAINER_HEADING=Docs |
| 53 | + VUE_APP_FOURTH_CONTAINER_INTRO=Some notes on how to find help. The following list may contain an arbitrary number of links. |
| 54 | + VUE_APP_FOURTH_CONTAINER_RESOURCES=[{"text": "dtool-lookup-webapp repository", "url": "https://github.com/jic-dtool/dtool-lookup-webapp"}] |
| 55 | + VUE_APP_LANDING_PAGE_ICON_PATH=/icons/128x128/dtool_logo.png |
| 56 | +
|
| 57 | +Customization options for the upper right corner drop-down menu in the app are available through the following environment variables in the `.env` file: |
| 58 | + |
| 59 | +.. code-block:: text |
38 | 60 |
|
39 | | -Start a development server |
40 | | --------------------------- |
| 61 | + VUE_APP_OFFER_DTOOL_README_YAML_DOWNLOAD=true |
| 62 | + VUE_APP_OFFER_DTOOL_JSON_DOWNLOAD=true |
| 63 | + VUE_APP_SHOW_INFO_MENU_ENTRY=true |
| 64 | + VUE_APP_DTOOL_JSON_PATH=/data/templates/dtool.json |
| 65 | + VUE_APP_DTOOL_README_YAML_PATH=/data/templates/dtool_readme.yml |
| 66 | + VUE_APP_INFO_CONTENT="<tt>dtool.json</tt> is you local <i>dtool</i> client's configuration file. Place it at <tt>~/.config/dtool/dtool.json</tt>, where <tt>~</tt> is your home directoy, and create the directories if they do not exist.<br /><br /><tt>dtool_readme.yml</tt> is the metadata template used for documenting your datasets. Place it anywhere, but make sure that the entry <tt>DTOOL_README_TEMPLATE_FPATH</tt> within above's dtool.json points to the correct absolute path of your <tt>dtool_readme.yml</tt>. See <a href="https://dtool.readthedocs.io/en/latest/configuring_a_custom_readme_template.html" target="_blank" rel="noopener noreferrer">Configuring a custom README template</a> of <a href="https://dtool.readthedocs.io" target="_blank" rel="noopener noreferrer"></i>dtool</i>'s documentation</a>." |
41 | 67 |
|
42 | | -:: |
| 68 | +All paths provided in these environment variables must be relative to this |
| 69 | +repository's `dtool-lookup-webapp/public` as root. |
| 70 | +Setting any of the `VUE_APP_OFFER_DTOOL_README_YAML_DOWNLOAD`, |
| 71 | +`VUE_APP_OFFER_DTOOL_JSON_DOWNLOAD`, `VUE_APP_SHOW_INFO_MENU_ENTRY` to `true` |
| 72 | +will show a download button for a `dtool_readme.yml` template, for a |
| 73 | +`dtool.json` configuration file, and a button for displaying arbitrary |
| 74 | +textual information configured with `VUE_APP_INFO_CONTENT`. |
| 75 | +Per default, all these buttons are hidden. |
| 76 | + |
| 77 | +To apply changes to the `.env` file, execute: |
| 78 | + |
| 79 | +.. code-block:: bash |
| 80 | +
|
| 81 | + npm install |
| 82 | +
|
| 83 | +Development Server |
| 84 | +------------------ |
| 85 | + |
| 86 | +To start a development server: |
| 87 | + |
| 88 | +.. code-block:: bash |
43 | 89 |
|
44 | 90 | cd dtool-lookup-webapp |
45 | 91 | npm run serve |
46 | 92 |
|
| 93 | +Building for Production |
| 94 | +----------------------- |
47 | 95 |
|
48 | | -Compile into a static single page website |
49 | | ------------------------------------------ |
| 96 | +To compile the application into a static single-page website: |
50 | 97 |
|
51 | | -:: |
| 98 | +.. code-block:: bash |
52 | 99 |
|
53 | 100 | cd dtool-lookup-webapp |
54 | 101 | npm run build |
55 | 102 |
|
| 103 | +Fixing Broken Installations |
| 104 | +--------------------------- |
| 105 | + |
| 106 | +To address issues with dependencies in a broken installation: |
| 107 | + |
| 108 | +.. code-block:: bash |
| 109 | +
|
| 110 | + rm -rf dist/ node_modules/ |
| 111 | + rm package-lock.json |
| 112 | +
|
| 113 | +Then, reinstall the Vue CLI service and rebuild: |
| 114 | + |
| 115 | +.. code-block:: bash |
| 116 | +
|
| 117 | + npm install @vue/cli-service |
| 118 | + npm run build |
| 119 | +
|
| 120 | +Testing |
| 121 | +------- |
| 122 | + |
| 123 | +Testing requires the `jest.config.js` configuration file, which can be auto-generated by: |
| 124 | + |
| 125 | +.. code-block:: bash |
| 126 | +
|
| 127 | + vue add unit-jest |
| 128 | +
|
| 129 | +This step follows the global installation of the Vue CLI: |
| 130 | + |
| 131 | +.. code-block:: bash |
| 132 | +
|
| 133 | + npm install -g @vue/cli |
56 | 134 |
|
57 | | -More information |
58 | | ----------------- |
| 135 | +Additional Information |
| 136 | +---------------------- |
59 | 137 |
|
60 | | -See dtool-lookup-webapp/README.md for more information about how to develop and build. |
61 | | -See provision/README.rst for instructions on how to deploy using Ansibl.e |
| 138 | +For more details on development and build processes, refer to the `README.md` file within the `dtool-lookup-webapp` directory. For deployment instructions using Ansible, consult the `provision/README.rst`. |
0 commit comments