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
Copy file name to clipboardExpand all lines: docs/local_development/local_development.md
+32-21Lines changed: 32 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,9 @@
2
2
3
3
This instruction tells how to set up local development.
4
4
5
-
Backends (Apihub and Custom service) could be started from IDE/cmd.
5
+
Backend could be started from IDE/cmd.
6
6
7
-
DB and frontend components in docker are required to run full Apihub application except the agent functionality.
7
+
DB and UI components in docker are required to run full APIHUB application (except the agent functionality).
8
8
There's no way for start agent in docker since k8s API is required.
9
9
10
10
## Prerequisites
@@ -16,26 +16,24 @@ Install necessary software if it was not installed earlie. For more info please
16
16
### DB
17
17
18
18
Run corresponding docker-compose file from /docker-compose/DB folder.
19
-
It will start Postgres DB in docker container with predefined credentials and database. So it's ready to connect from Apihub BE.
20
-
21
-
At this moment there's no procedure to create NC service DB in one command, so you have to create DB `apihub_nc` manually.
19
+
It will start Postgres DB in docker container with predefined credentials and database. So it's ready to connect from APIHUB BE.
20
+
User `apihub` with password `apihub` and database `apihub` will be created automatically.
22
21
If you use DBeaver you need to connect to PostgreSQL DB first using parameters:
23
22
```
24
23
Host=localhost
25
-
Username=apihub
26
-
Password=APIhub1234
24
+
Username=postgres
25
+
Password=postgres
27
26
Port=5432
28
27
```
29
28
Don't forget to check 'Show all databases' to see all DBs.
30
-
Then open postgres->Databases and create `apihub_nc` DB with owner 'apihub' (all other params leave as default).
31
29
32
30
* To create a corresponding docker image you need to issue a command:
33
31
34
32
```bash
35
33
docker-compose -f docs/local_development/docker-compose/DB/docker-compose.yml up
36
34
```
37
35
38
-
If you have another docker image (usually another DB container from another project) which could intersect with this one then you need to change PostgreSQL port settings and image port mapping in [`DB/docker-compose.yml`](/docs/local_development/docker-compose/DB/docker-compose.yml). Please add two arguments into **command** section ("\-p" and "\<new port number\>") and update port mapping in the **ports** section. Default port number for PostgreSQL is **5433**.
36
+
If you have another docker image (usually another DB container from another project) which could intersect with this one then you need to change PostgreSQL port settings and image port mapping in [`DB/docker-compose.yml`](/docs/local_development/docker-compose/DB/docker-compose.yml). Please add two arguments into **command** section ("\-p" and "\<new port number\>") and update port mapping in the **ports** section. Default port number for PostgreSQL is **5432**.
39
37
40
38
* To run the image please issue a command below:
41
39
@@ -59,20 +57,33 @@ Apihub contains built-in identity provider and it requires RSA private key as a
59
57
60
58
Run [`generate_jwt_pkey.sh`](generate_jwt_pkey.sh), it will generate file jwt_private_key in the current directory. Paste the value to Apihub BE environment. Please mind that the key must be non-empty.
61
59
62
-
#### API hub BE environment
60
+
#### APIHUB BE environment
63
61
64
62
The following environment variables are required to start Apihub application:
65
63
64
+
ENV format
66
65
```INI
67
66
LISTEN_ADDRESS=127.0.0.1:8090;
68
67
APIHUB_POSTGRESQL_DB_NAME=apihub;
69
68
APIHUB_POSTGRESQL_USERNAME=apihub;
70
-
APIHUB_POSTGRESQL_PASSWORD=APIhub1234;
69
+
APIHUB_POSTGRESQL_PASSWORD=apihub;
71
70
APIHUB_POSTGRESQL_PORT=5432;
72
71
PRODUCTION_MODE=false;
73
72
JWT_PRIVATE_KEY={use generated key here}
74
73
```
75
74
75
+
JSON format
76
+
```JSON
77
+
"LISTEN_ADDRESS": "127.0.0.1:8090",
78
+
"APIHUB_POSTGRESQL_DB_NAME": "apihub",
79
+
"APIHUB_POSTGRESQL_USERNAME": "apihub",
80
+
"APIHUB_POSTGRESQL_PASSWORD": "apihub",
81
+
"APIHUB_POSTGRESQL_PORT": "5432",
82
+
"PRODUCTION_MODE": "false",
83
+
"JWT_PRIVATE_KEY": "USE GENERATED KEY HERE"
84
+
```
85
+
86
+
76
87
Set these variables to build configuration.
77
88
78
89
#### Run API hub
@@ -89,7 +100,7 @@ Since you will run non-production environment you do not have any valid identity
89
100
90
101
You can use any of test tools approved by company to send REST API requests. The best request collection can be found in the [`apihub-postman-collections repository`](https://<git_group_link>/apihub-postman-collections). And the command above, collection and environment for local development are also included.
91
102
92
-
You can use NC-newman-desktop or Bruno app to run REST API requests.
103
+
You can use Postman or Bruno app to run REST API requests.
APIHUB_ACCESS_TOKEN={use generated token value here};
115
126
```
116
127
117
-
## FE
128
+
## UI
118
129
119
130
120
-
### Run frontend
131
+
### Run UI service
121
132
122
-
Run corresponding docker-compose file from `/docker-compose/FE` folder.
123
-
It will start FE container providing you a kind of GUI on localhost:8080 that will connect to Apihub BE on :8090 and NC service on :8091.
133
+
Run corresponding docker-compose file from `/docker-compose/UI` folder.
134
+
It will start FE container providing you a kind of GUI on localhost:8081 that will connect to Apihub BE on :8090 and Custom service on :8091.
124
135
125
136
To create a corresponding Docker image you need to issue a command:
126
137
127
138
```bash
128
-
docker compose -f docs/local_development/docker-compose/FE/docker-compose.yml up
139
+
docker compose -f docs/local_development/docker-compose/UI/docker-compose.yml up
129
140
```
130
141
131
142
If default port (8080) was already taken by another application or Docker image you have configure another one in the **ports** section an re-create image with the command above. See [`FE/docker-compose.yml`](/docs/local_development/docker-compose/FE/docker-compose.yml)
132
143
133
144
To run the image please issue a command below:
134
145
135
146
```bash
136
-
docker compose -f docs/local_development/docker-compose/FE/docker-compose.yml run apihub-ui
147
+
docker compose -f docs/local_development/docker-compose/UI/docker-compose.yml run qubership-apihub-ui
137
148
```
138
149
139
150
Of course, you can perform the actions above with your favorite IDE.
@@ -150,7 +161,7 @@ Open NC-newman-desktop or Bruno app and run `POST /api/internal/users` at APIHUB
150
161
}`
151
162
152
163
#### Open web view
153
-
Go to http://localhost:8080 (use other port if you change it) and enter created above credentials.
164
+
Go to http://localhost:8081 (use other port if you change it) and enter created above credentials.
0 commit comments