Skip to content

Commit 1bb7442

Browse files
committed
docs: updated README
1 parent 0414c7e commit 1bb7442

File tree

2 files changed

+56
-19
lines changed

2 files changed

+56
-19
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test:
2727
npm test
2828

2929
test-e2e:
30-
testcafe firefox test/e2e/
30+
npx testcafe firefox test/e2e/
3131

3232
clean:
3333
rm -rf node_modules dist

README.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,78 @@
11
# aw-webui
22

3-
> A webui for ActivityWatch built in Vue.js
3+
A web-based UI for ActivityWatch, built with Vue.js
44

55
[![Build Status](https://github.com/ActivityWatch/aw-webui/workflows/Build/badge.svg)](https://github.com/ActivityWatch/aw-webui/actions)
66
[![Coverage Status](https://codecov.io/gh/ActivityWatch/aw-webui/branch/master/graph/badge.svg)](https://codecov.io/gh/ActivityWatch/aw-webui)
77
[![Known Vulnerabilities](https://snyk.io/test/github/ActivityWatch/aw-webui/badge.svg)](https://snyk.io/test/github/ActivityWatch/aw-webui)
88

99
## Getting started
1010

11-
```bash
12-
# update submodule
13-
git submodule update --init --recursive
14-
15-
# install aw-client-js and aw-webui
16-
make install
11+
Getting started with setting up the development environment is pretty straight forward:
1712

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:
2018
aw-server --testing
2119

20+
# Install dependencies
21+
npm install
22+
# or, to get exact versions of dependencies:
23+
npm ci
24+
2225
# start aw-webui in dev mode
2326
npm run serve
2427
```
2528

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:
52+
53+
- aw-server-python: `activitywatch/aw-server/aw_server/static/`
54+
- aw-server-rust: `activitywatch/aw-server-rust/static/`
55+
56+
## Tests
57+
58+
Tests can be run with:
59+
60+
```bash
61+
npm test
62+
```
63+
64+
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+
2670
## Development
2771

2872
### CORS
2973

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
3276
configuration file `~/.config/activitywatch/aw-server/aw-server.ini` under the
3377
`server-testing` section.
3478

@@ -37,10 +81,3 @@ configuration file `~/.config/activitywatch/aw-server/aw-server.ini` under the
3781
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).
3882

3983
The main.js file then loads the `src/App.vue` file, which is the root component of the application.
40-
41-
## Building
42-
43-
```bash
44-
# build for production
45-
npm run build
46-
```

0 commit comments

Comments
 (0)