@@ -6,34 +6,32 @@ Awesome Redis GUI written in Electron, NodeJS and React
6
6
7
7
## Directory Structure
8
8
9
- - ` redisinsight/ui ` - Contains the frontend code.
10
- - ` redisinsight/api ` - Contains the backend code.
9
+ - ` redisinsight/ui ` - Contains the frontend code
10
+ - ` redisinsight/api ` - Contains the backend code
11
11
- ` scripts ` - Build scripts and other build-related files
12
12
- ` configs ` - Webpack configuration files and other build-related files
13
- - ` tests ` - Contains the e2e and integration tests.
13
+ - ` tests ` - Contains the e2e
14
14
15
- ## Development Workflow
15
+ ## Prerequisites
16
16
17
- ### Installation
17
+ Make sure you have installed following packages:
18
+ * [ Node] ( https://nodejs.org/en/download/ ) >=14.x and <16
19
+ * [ yarn] ( https://www.npmjs.com/package/yarn ) >=1.21.3
20
+
21
+ ## Installation
22
+
23
+ Before development or build you have to install required dependencies
18
24
19
25
``` bash
20
26
$ yarn install
21
27
$ yarn --cwd redisinsight/api/
22
28
```
23
29
24
- ### Packaging the desktop app
30
+ ## Development
25
31
26
- After you have installed all dependencies you can package the app.
27
- Run ` yarn package:prod ` to package app for the local platform:
32
+ There are 2 ways to develop:
28
33
29
- ``` bash
30
- # Production
31
- $ yarn package:prod
32
- ```
33
-
34
- And packaged installer will be in the folder _ release_
35
-
36
- ### Running the desktop app
34
+ ### Developing using electron app
37
35
38
36
After you have installed all dependencies you can now run the app.
39
37
Run ` yarn start ` to start an electron application that will watch and build for you.
@@ -43,32 +41,51 @@ Run `yarn start` to start an electron application that will watch and build for
43
41
$ yarn start
44
42
```
45
43
46
- ### Running frontend part of the app
44
+ ### Developing using web
47
45
48
- After you have installed all dependencies you can now run the app.
49
- Run ` yarn start:web ` to start a local server that will watch and build for you.
46
+ #### Running backend part of the app
47
+
48
+ Run ` yarn --cwd redisinsight/api/ start:dev ` to start a local API at ` localhost:5000 ` .
50
49
51
50
``` bash
52
51
# Development
53
- $ yarn start:web
52
+ $ yarn --cwd redisinsight/api/ start:dev
54
53
```
55
54
56
- ### Running backend part of the app
55
+ While the API is running, open your browser and navigate to http://localhost:5000/api/docs . You should see the Swagger UI.
56
+
57
+ #### Running frontend part of the app
57
58
58
- After you have installed all dependencies run ` yarn --cwd redisinsight/api/ start:dev ` to start a local API at ` localhost:5000 ` .
59
+ Run ` yarn start:web ` to start a local server for UI .
59
60
60
61
``` bash
61
62
# Development
62
- $ yarn --cwd redisinsight/api/ start:dev
63
+ $ yarn start:web
63
64
```
64
65
65
- While the API is running, open your browser and navigate to http://localhost:5000/api/docs . You should see the Swagger UI.
66
+ Web interface will be available at http://localhost:8080
66
67
67
- ### Building frontend part of the app
68
+ Now servers will watch for changes and automatically build for you
68
69
69
- Run ` yarn build:web ` to build fronted to ` /redisinsight/ui/dist/ ` .
70
+ ## Build
71
+
72
+ ### Packaging the desktop app
70
73
71
- ## Docker
74
+ #### Building statics for enablement area and default plugins
75
+
76
+ Run ` yarn build:statics ` or ` yarn build:statics:win ` for Windows
77
+
78
+ After you have installed all dependencies you can package the app.
79
+ Run ` yarn package:prod ` to package app for the local platform:
80
+
81
+ ``` bash
82
+ # Production
83
+ $ yarn package:prod
84
+ ```
85
+
86
+ And packaged installer will be in the folder _ ./release_
87
+
88
+ ### Create docker image
72
89
73
90
There are 2 different docker images available
74
91
@@ -97,7 +114,7 @@ Example:
97
114
docker run -p 5000:5000 -d --cap-add ipc_lock redisinsight
98
115
```
99
116
100
- Then api docs and main ui should be available on http://localhost/api/docs and http://localhost
117
+ Then api docs and main ui should be available on http://localhost:5000 /api/docs and http://localhost:5000
101
118
102
119
#### Build Docker with API only
103
120
@@ -115,16 +132,95 @@ Example:
115
132
docker run -p 5000:5000 -d --cap-add ipc_lock api.redisinsight
116
133
```
117
134
118
- Then api docs and main ui should be available on http://localhost/api/docs
135
+ Then api docs and main ui should be available on http://localhost:5000/api/docs
136
+
137
+ ## Tests
119
138
120
- ## Continuous Integration
139
+ ### Running frontend tests
121
140
122
- ## Related Repositories
141
+ #### Run UI unit tests
123
142
124
- ## Running e2e tests in root tests/e2e
143
+ ``` bash
144
+ yarn test
145
+ ```
146
+
147
+ ### Running backend tests
148
+
149
+ #### Run backend unit tests
150
+
151
+ ``` bash
152
+ # Plain tests
153
+ yarn --cwd redisinsight/api test
154
+
155
+ # Tests with coverage
156
+ yarn --cwd redisinsight/api test:cov
157
+ ```
158
+
159
+ ### Run backend integration tests (using local server)
160
+
161
+ ``` bash
162
+ # Plain tests
163
+ yarn --cwd redisinsight/api test:api
164
+
165
+ # Tests with coverage
166
+ yarn --cwd redisinsight/api test:api:cov
167
+ ```
168
+
169
+ > ** _ NOTE_ ** : Using ` yarn test:api* ` scripts you should have redis server up and running.
170
+ By default tests will look on ` localhost:6379 ` without any auth
171
+ To customize tests configs you should run test with proper environment variables
172
+
173
+ Example:
174
+
175
+ If you have redis server running on a different host or port ` somehost:7777 ` with default user pass ` somepass `
176
+
177
+ You should run test commands with such environment variables
178
+
179
+ ``` bash
180
+ # Plain tests
181
+ TEST_REDIS_HOST=somehost \
182
+ TEST_REDIS_PORT=7777 \
183
+ TEST_REDIS_PASSWORD-somepass \
184
+ yarn --cwd redisinsight/api test:api
185
+ ```
186
+
187
+ You can find all possible environment variable available in the [ constants.ts] ( redisinsight/api/test/helpers/constants.ts ) file
188
+
189
+ ### Run backend integration tests (using docker)
190
+
191
+ Here you should not care about tests and local redis database configuration
192
+
193
+ We will spin up server inside docker container and run tests over it
194
+
195
+ ``` bash
196
+ # run this this command
197
+ ./redisinsight/api/test/test-runs/start-test-run.sh -r oss-st-6
198
+ ```
199
+ - -r - is the Redis Test Environment name
200
+
201
+ We are supporting several test environments to run tests on various Redis databases:
202
+ - ** oss-st-5** - _ OSS Standalone v5_
203
+ - ** oss-st-5-pass** - _ OSS Standalone v5 with admin pass required_
204
+ - ** oss-st-6** - _ OSS Standalone v6 and all modules_
205
+ - ** oss-st-6-tls** - _ OSS Standalone v6 with TLS enabled_
206
+ - ** oss-st-6-tls-auth** - _ OSS Standalone v6 with TLS auth required_
207
+ - ** oss-clu** - _ OSS Cluster_
208
+ - ** oss-clu-tls** - _ OSS Cluster with TLS enabled_
209
+ - ** oss-sent** - _ OSS Sentinel_
210
+ - ** re-st** - _ Redis Enterprise with Standalone inside_
211
+ - ** re-clu** - _ Redis Enterprise with Cluster inside_
212
+
213
+
214
+ ### Running E2E tests
215
+
216
+ Install E2E tests deps
217
+
218
+ ``` bash
219
+ yarn --cwd tests/e2e
220
+ ```
125
221
126
- - To run E2E tests run command:
222
+ Run E2E tests
127
223
128
224
``` bash
129
- yarn test- chrome
225
+ yarn --cwd tests/e2e test: chrome
130
226
```
0 commit comments