|
1 |
| -# DCL UI Web based app for managing CSA-DCL |
| 1 | +# DCL UI Web-based App for Managing CSA-DCL |
2 | 2 |
|
3 |
| -DCL-UI is [Vue.js](https://vuejs.org/) - based web application for managing the CSA Distributed Compliance Ledger. This app provides a web interface to view and manage the data in the Ledger. |
| 3 | +DCL-UI is a [Vue.js](https://vuejs.org/)-based web application for managing the CSA Distributed Compliance Ledger. This app provides a web interface to view and manage data in the Ledger. |
| 4 | + |
| 5 | +## Overview |
| 6 | +The DCL-UI provides features for: |
| 7 | +- Viewing and managing compliance records |
| 8 | +- Interacting with the distributed ledger |
| 9 | +- Managing user access and permissions |
| 10 | +- Monitoring ledger status and transactions |
4 | 11 |
|
5 | 12 | ## Prerequisites
|
6 |
| -You will need [Node.js](https://nodejs.org) version 20.x installed on your system. |
| 13 | +- [Node.js](https://nodejs.org) version 20.x |
| 14 | +- Git |
| 15 | +- Modern web browser (Chrome, Firefox, Safari, or Edge) |
| 16 | +- Basic knowledge of Vue.js and blockchain concepts |
7 | 17 |
|
8 | 18 | ## Project Setup
|
9 | 19 |
|
10 |
| -Get the code by cloning this repository using git |
11 |
| - |
12 |
| - > git clone https://github.com/Comcast/dcl-ui.git |
13 |
| - |
14 |
| -Once downloaded, open the terminal in the project directory, and continue with: |
15 |
| - |
| 20 | +### Getting Started |
| 21 | +Clone the repository: |
| 22 | +```bash |
| 23 | +git clone https://github.com/Comcast/dcl-ui.git |
| 24 | +cd dcl-ui |
16 | 25 | ```
|
| 26 | + |
| 27 | +Install dependencies: |
| 28 | +```bash |
17 | 29 | npm install
|
18 | 30 | ```
|
19 | 31 |
|
20 |
| -### Compiles and hot-reloads for development |
21 |
| -``` |
| 32 | +### Development |
| 33 | +Start the development server with hot-reload: |
| 34 | +```bash |
22 | 35 | npm run dev
|
23 | 36 | ```
|
24 | 37 |
|
25 |
| -### Compiles and minifies for production |
26 |
| -``` |
| 38 | +Build for production: |
| 39 | +```bash |
27 | 40 | npm run build
|
28 | 41 | ```
|
29 | 42 |
|
| 43 | +### Project Structure |
| 44 | +``` |
| 45 | +dcl-ui/ |
| 46 | +├── src/ # Source code |
| 47 | +├── public/ # Static assets |
| 48 | +├── dist/ # Production build output |
| 49 | +├── tests/ # Test files |
| 50 | +└── vite.config.js # Vite configuration |
| 51 | +``` |
30 | 52 |
|
31 |
| -## Customize configuration |
| 53 | +## Configuration |
| 54 | + |
| 55 | +### Development Environment |
| 56 | +The default configuration connects to the CSA Testnet Observer Node. The development environment uses a proxy server for CORS-disabled endpoints. |
| 57 | + |
| 58 | +Environment variables (.env.development): |
| 59 | +```env |
| 60 | +VITE_APP_DCL_API_NODE=http://localhost:8080/api |
| 61 | +VITE_APP_DCL_RPC_NODE=http://localhost:8080/rpc |
| 62 | +VITE_APP_DCL_WEBSOCKET_NODE=ws://localhost:8080/websocket |
| 63 | +VITE_APP_DCL_CHAIN_ID=testnet-2.0 |
| 64 | +VITE_APP_DCL_CHAIN_NAME=DCL-Chain-Testnet |
| 65 | +VITE_APP_DCL_ADDR_PREFIX=cosmos |
| 66 | +VITE_APP_DCL_SDK_VERSION=Stargate |
| 67 | +VITE_APP_DCL_TX_API=/rpc/tx?hash=0x |
| 68 | +VITE_APP_DCL_REFRESH=500000 |
| 69 | +``` |
32 | 70 |
|
33 |
| -See [Configuration Reference](https://cli.vuejs.org/config/). |
| 71 | +### Production Deployment |
34 | 72 |
|
35 |
| -### Configuring DCL-UI |
36 |
| -By default DCL UI connects to the CSA Testnet Observer Node when started in development mode. Since CORS is disabled on the CSA Observer Node (https://on.test-net.dcl.csa-iot.org) when the project is started in development mode it configures a http proxy server that takes the request for /api, /rpc and /websocket to the target CSA Observer Node. You can modify the configuration in vue.config.js file. |
| 73 | +1. Create a `.env` file for production settings (use `.env.sample` as reference) |
| 74 | +2. Build the application: |
| 75 | + ```bash |
| 76 | + npm run build |
| 77 | + ``` |
| 78 | +3. Deploy the contents of the `/dist` folder to your web server |
37 | 79 |
|
38 |
| -.env.development file contains the following environment variables (Since the default server starts on port 8080. Please update the ports is you are running the local server on different port.) |
39 |
| -``` |
40 |
| -VUE_APP_DCL_API_NODE=http://localhost:8080/api |
41 |
| -VUE_APP_DCL_RPC_NODE=http://localhost:8080/rpc |
42 |
| -VUE_APP_DCL_WEBSOCKET_NODE=ws://localhost:8080/websocket |
43 |
| -VUE_APP_DCL_CHAIN_ID=testnet-2.0 |
44 |
| -VUE_APP_DCL_CHAIN_NAME=DCL-Chain-Testnet |
45 |
| -VUE_APP_DCL_ADDR_PREFIX=cosmos |
46 |
| -VUE_APP_DCL_SDK_VERSION=Stargate |
47 |
| -VUE_APP_DCL_TX_API=/rpc/tx?hash=0x |
48 |
| -VUE_APP_DCL_REFRESH=500000 |
49 |
| -``` |
| 80 | +## Troubleshooting |
50 | 81 |
|
51 |
| -## Deploying a minified SPA (Single Page Application) |
| 82 | +Common issues and solutions: |
| 83 | +1. **CORS Issues**: Ensure proxy settings are correct in development |
| 84 | +2. **Build Errors**: Check Node.js version and dependencies |
| 85 | +3. **API Connection**: Verify environment variables and network connectivity |
52 | 86 |
|
53 |
| -### Configure for deployment |
54 |
| -Before the application can be deployed, please create a .env file and configure the the environment variables. You can take the .env.sample file as a reference. |
| 87 | +## Contributing |
| 88 | +1. Fork the repository |
| 89 | +2. Create a feature branch |
| 90 | +3. Submit a pull request |
55 | 91 |
|
| 92 | +## Additional Resources |
| 93 | +- [Vue.js Documentation](https://vuejs.org/guide/introduction.html) |
| 94 | +- [Vite Documentation](https://vitejs.dev/guide/) |
| 95 | +- [CSA DCL](https://github.com/zigbee-alliance/distributed-compliance-ledger) |
56 | 96 |
|
57 |
| -### Build the Application |
58 |
| -``` |
59 |
| -npm run build |
60 |
| -``` |
61 |
| -This will generate the compiled package in /dist folder. This folder contains the index.html file, that can be served from any web server. |
62 | 97 |
|
63 |
| -For a more detailed explanation on how this application works, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). |
| 98 | +## Support |
| 99 | +For issues and feature requests, please use the GitHub issue tracker. |
0 commit comments