doc(web-app): describe development procedure and usage

This commit is contained in:
fastium
2025-05-20 14:24:09 +02:00
parent d9defce56d
commit 5768c9279b

View File

@@ -1,19 +1,54 @@
# web-app # web-app
This is a web application that uses Vue.js and Chart.js to display data from a database. The data is fetched from the database using an API and displayed in a chart.
## Project setup ## Usage
The web page contains two buttons:
- **New measurments**: fetch the data from the database and add it to the chart.
- **Fetch measurments**: ask for a new measurement at the currrent time.
It has too 3 selectors:
- **User**: select the user to fetch the data from.
- **Room**: select the room to fetch the data from.
- **Device**: select the device to fetch the data from.
The chart is updated when the web page is loaded with default values for the selectors.
The chart can be updated by clicking on the **New measurments** button after selecting the user, room and device. But, the application doesn't care if the combination of user, room and device is valid or not. It will just fetch the data from the database and plot it on the chart.
## Environment setup
Install Node.js version v22.15.0 from [Node.js](https://nodejs.org/en/download/releases/) (LTS version).
Verify the installation by running the following command in your terminal:
```terminal
node --version
npm --version
``` ```
With the following output:
```result
v22.15.0
10.9.2
```
Then install the project dependencies by running:
```terminal
npm install npm install
``` ```
### Compiles and hot-reloads for development Setup the environment variables in the `.env.template` file.
```
### Compile and run for development
```terminal
npm run serve npm run serve
``` ```
### Compiles and minifies for production ### Compile and minifie for production
``` ```terminal
npm run build npm run build
``` ```
### Customize configuration ### Links
See [Configuration Reference](https://cli.vuejs.org/config/). See [Configuration Reference](https://cli.vuejs.org/config/).\
See [Vue.js](https://vuejs.org/guide/introduction.html).\
See [chartjs](https://www.chartjs.org/docs/latest/).\
See [vue-chartjs](https://vue-chartjs.org/).