|
2 | 2 |
|
3 | 3 | This repository hosts the implementation of QuestDB user interface and surrounding tooling. |
4 | 4 |
|
5 | | -## Local development setup |
| 5 | +## Prerequisites |
6 | 6 |
|
7 | | -In order to start working with this repo, you first need to clone and bootstrap it. |
| 7 | +- **Node.js** >= 18.18.0 (check with `node -v`) |
| 8 | +- **Yarn** 4.1.1+ (check with `yarn -v`) |
8 | 9 |
|
9 | | -It is a simple process! Follow these steps: |
10 | | - |
11 | | -1. Clone the repository |
12 | | -2. Bootstrap dependencies |
13 | | -3. Run command |
14 | | -4. Hack! |
15 | | - |
16 | | -Each step is described in below. |
17 | | - |
18 | | -### 1. Clone the repository |
19 | | - |
20 | | -There are few ways to clone a repository. Check [Github docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) if you need help. |
21 | | - |
22 | | -- Clone this repository using SSH: |
23 | | - |
24 | | - ``` |
25 | | - git clone git@github.com:questdb/ui.git |
26 | | - ``` |
27 | | - |
28 | | -- or HTTPS: |
29 | | - |
30 | | - ``` |
31 | | - git clone https://github.com/questdb/ui.git |
32 | | - ``` |
33 | | - |
34 | | -- or with [Github CLI](https://cli.github.com/): |
35 | | - ``` |
36 | | - gh repo clone questdb/ui |
37 | | - ``` |
38 | | - |
39 | | -### 2. Bootstrap dependencies |
40 | | - |
41 | | -#### `node` and `yarn` |
42 | | - |
43 | | -First make sure you have `node` and `yarn` and that their versions are compatible with this project. |
44 | | -This is a common source of issues, best not to skip this step: |
45 | | - |
46 | | -- `node -v` should return a version compatible with what's in [.nvmrc](../.nvmrc)\ |
47 | | - If it doesn't, you can use [fnm](https://fnm.vercel.app) or [nvm](https://github.com/nvm-sh/nvm) to manage node versions on your machine.\ |
48 | | - Then run `fnm use` or `nvm use` to set correct version. |
49 | | - |
50 | | -- If `yarn -v` returns `command not found`, enable `yarn` by running `corepack enable`.\ |
51 | | - Follow [official installation guide](https://yarnpkg.com/getting-started/install) if you have trouble. |
52 | | - |
53 | | -#### Bootstrap |
54 | | - |
55 | | -Simply run `yarn` to bootstrap. |
56 | | - |
57 | | -### 3. Run command of a package |
58 | | - |
59 | | -Congrats, the setup is done! You're ready to start working on web console. |
60 | | - |
61 | | -``` |
62 | | -yarn $script |
| 10 | +If your Node.js version doesn't match, use [fnm](https://fnm.vercel.app) or [nvm](https://github.com/nvm-sh/nvm) to switch versions: |
| 11 | +```bash |
| 12 | +fnm use # or nvm use |
63 | 13 | ``` |
64 | 14 |
|
65 | | -where `$script` is one of the scripts defined in `package.json` file. |
66 | | - |
67 | | -- You can start web console development server with: |
68 | | - |
69 | | -``` |
70 | | -yarn start |
| 15 | +If Yarn is not installed, enable it with: |
| 16 | +```bash |
| 17 | +corepack enable |
71 | 18 | ``` |
72 | 19 |
|
73 | | -[localhost:9999](http://localhost:9999) should display the web console. |
| 20 | +## Quick Start |
74 | 21 |
|
75 | | -- You can run unit tests using: |
| 22 | +1. Clone the repository: |
| 23 | + ```bash |
| 24 | + git clone git@github.com:questdb/ui.git |
| 25 | + cd ui |
| 26 | + ``` |
76 | 27 |
|
77 | | -``` |
78 | | -yarn test:unit |
79 | | -``` |
| 28 | +2. Install dependencies: |
| 29 | + ```bash |
| 30 | + yarn |
| 31 | + ``` |
80 | 32 |
|
| 33 | +3. Start the development server: |
| 34 | + ```bash |
| 35 | + yarn start |
| 36 | + ``` |
81 | 37 |
|
82 | | -- You can run e2e tests using: |
| 38 | +4. Open [http://localhost:9999](http://localhost:9999) in your browser. Note that for Web Console to work properly, [QuestDB server](https://github.com/questdb/questdb) should be up and running. |
83 | 39 |
|
84 | | -``` |
85 | | -yarn test:e2e |
86 | | -``` |
| 40 | +## Available Scripts |
87 | 41 |
|
88 | | -Note that you need to run QuestDB server for testing web console. |
89 | | -There are useful scripts |
| 42 | +- `yarn start` - Start development server (Vite) |
| 43 | +- `yarn build` - Build for production |
| 44 | +- `yarn preview` - Preview production build locally |
| 45 | +- `yarn test:unit` - Run unit tests (Vitest) |
| 46 | +- `yarn test:e2e` - Run end-to-end tests (Cypress) |
| 47 | +- `yarn test:e2e:auth` - Run auth-specific e2e tests |
| 48 | +- `yarn test:e2e:enterprise` - Run enterprise e2e tests |
| 49 | +- `yarn typecheck` - Run TypeScript type checking |
| 50 | +- `yarn lint` - Lint source code (ESLint) |
| 51 | +- `yarn lint:fix` - Fix linting issues automatically |
90 | 52 |
|
91 | | -### 4. Hack! |
| 53 | +## Development Notes |
92 | 54 |
|
93 | | -The setup is done! |
| 55 | +### Running E2E Tests |
94 | 56 |
|
95 | | -If you need help, here are some useful links: |
| 57 | +E2E tests require a running QuestDB server. The tests connect to `localhost:9000` by default. |
96 | 58 |
|
97 | | -- [GitHub issues](https://github.com/questdb/ui/issues), might already have an answer to your question |
98 | | -- [QuestDB Documentation](https://questdb.com/docs/) includes a lot of useful information |
99 | | -- [QuestDB Slack Channel](https://slack.questdb.io/) and [QuestDB Community Forum](https://community.questdb.io/): join our helpful community! |
| 59 | +### Working with Context Path |
100 | 60 |
|
| 61 | +To test with a custom context path: |
| 62 | +```bash |
| 63 | +QDB_HTTP_CONTEXT_WEB_CONSOLE=/context yarn preview |
| 64 | +``` |
101 | 65 |
|
102 | 66 | ## Contributing |
103 | 67 |
|
104 | 68 | We always welcome contributions from the community! |
105 | 69 |
|
106 | | -Please, read our [local development setup](./docs/local-development-setup.md) document to learn how to get started. |
| 70 | +If you need help, here are some useful links: |
| 71 | + |
| 72 | +- Check [GitHub issues](https://github.com/questdb/ui/issues) for existing discussions |
| 73 | +- Read the [QuestDB Documentation](https://questdb.com/docs/) |
| 74 | +- Join our [Slack Channel](https://slack.questdb.io/) or [Community Forum](https://community.questdb.io/) |
0 commit comments