You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting started with setting up the development environment is pretty straight forward:
17
12
18
-
# Make sure you have aw-server running, the testing port will be used by default
19
-
# so make sure you are running with the --testing flag
13
+
```bash
14
+
# Start an instance of aw-server running in testing mode (on port 5666, with a separate database),
15
+
# This is what the web UI will connect to by default when run in development mode.
16
+
aw-qt --testing
17
+
# or, to run without watchers:
20
18
aw-server --testing
21
19
20
+
# Install dependencies
21
+
npm install
22
+
# or, to get exact versions of dependencies:
23
+
npm ci
24
+
22
25
# start aw-webui in dev mode
23
26
npm run serve
24
27
```
25
28
29
+
You might have to configure CORS for it to work, see the CORS section below.
30
+
31
+
You may also want to generate fake data so you have something to test with, see: https://github.com/ActivityWatch/aw-fakedata/
32
+
33
+
## Building
34
+
35
+
To build the production bundle, simply run the following:
36
+
37
+
```bash
38
+
# Install dependencies
39
+
npm ci
40
+
41
+
# Build for production
42
+
npm run build
43
+
```
44
+
45
+
### Using a pre-release with your main install
46
+
47
+
**Note:** Running a development version of aw-webui with an old aw-server can lead to issues due to version incompatibilities.
48
+
49
+
You can run a development version of aw-webui with your main version of ActivityWatch by building it (or fetching the latest build from CI) and replacing placing the contents of the `static` directory of your aw-server (or aw-server-rust) installation. For simplicity, back up the original directory for easier switching back.
50
+
51
+
The assets are stored in the following directories (relative to your installation directory), depending on if you use aw-server-python (default) or aw-server-rust:
There are also E2E tests. You need to have an aw-server and the web UI running in development mode (with `npm run serve`, as instructed above). After you have that setup, you can run the tests with:
65
+
66
+
```bash
67
+
make test-e2e
68
+
```
69
+
26
70
## Development
27
71
28
72
### CORS
29
73
30
-
For development you'll also have to add/change CORS configuration in the
31
-
aw-server config by adding `cors_origins = http://localhost:27180` to your
74
+
For development, you'll also have to add/change CORS configuration in the
75
+
aw-server configs by adding `cors_origins = http://localhost:27180` to your
32
76
configuration file `~/.config/activitywatch/aw-server/aw-server.ini` under the
33
77
`server-testing` section.
34
78
@@ -37,10 +81,3 @@ configuration file `~/.config/activitywatch/aw-server/aw-server.ini` under the
37
81
One of the first things that happen in the application is the execution of `src/main.js`. This loads things such as bootstrap-vue and a bunch of other stuff that's globally used (filters, resources).
38
82
39
83
The main.js file then loads the `src/App.vue` file, which is the root component of the application.
0 commit comments