Skip to content

Commit c941ad2

Browse files
authored
Merge pull request #4 from AnechaS/develop
Update documents and Fix version dependencies
2 parents c30bcff + 9bd672b commit c941ad2

File tree

8 files changed

+13759
-85
lines changed

8 files changed

+13759
-85
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.vscode
33
node_modules
44
dist
5-
package-lock.json
65
yarn-error.log
76
yarn.lock
87
build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
12.22

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
#Gateway Database
1+
# Database Gateway
22

3-
เป็นระบบช่วยแก้ปัญหาเมื่อคุณไม่สามารถเชื่อมต่อฐานข้อมูลภายนอกด้วย VPN หรือวิธีอื่นๆได้ (ฐานข้อมูลไม่ได้เปิดเป็น Public) โดยระบบนี้จะใช้ความสามารถของ [TCP protocal](https://en.wikipedia.org/wiki/Transmission_Control_Protocol) ในการเข้าถึงฐานข้อมูลที่เชื่อมต่อกับโปรแกรมฝั่งเซิร์ฟเวอร์ที่เราพัฒนา (โปรแกรมฝั่ง Client) ซึ่งหลักการทำงานคือ ผู้ใช้ส่ง Request คำสั่ง SQL ไปทาง API จากนั้น Server ก็จะไปควบคุมโปรแกรมผั่ง Client ที่เชื่อมต่ออยู่กับฐานข้อมูล ให้รันคำสั่ง SQL และนำผลลัพกลับไป
3+
This system is designed to solve the problem of being unable to connect to an external database through VPN or other methods (where the database is not open to the public). It utilizes the TCP protocol to access the database connected to the client-side program that we have developed (the client program). The basic concept is that the user sends a SQL command request through the API, and then the server controls the client-side program connected to the database to execute the SQL command and return the results.
44

5-
This system will help solve the problem. When you are unable to connect to an external server using VPN or other methods, using the [TCP protocol] capability to access the database connected to the client-side program.
5+
> *เป็นระบบช่วยแก้ปัญหาเมื่อคุณไม่สามารถเชื่อมต่อฐานข้อมูลภายนอกด้วย VPN หรือวิธีอื่นๆได้ (ฐานข้อมูลไม่ได้เปิดเป็น Public) โดยระบบนี้จะใช้ความสามารถของ TCP protocal ในการเข้าถึงฐานข้อมูลที่เชื่อมต่อกับโปรแกรมฝั่งเซิร์ฟเวอร์ที่เราพัฒนา (โปรแกรมฝั่ง Client) ซึ่งหลักการทำงานคือ ผู้ใช้ส่ง Request คำสั่ง SQL ไปทาง API จากนั้น Server ก็จะไปควบคุมโปรแกรมผั่ง Client ที่เชื่อมต่ออยู่กับฐานข้อมูล ให้รันคำสั่ง SQL และนำผลลัพกลับไป*
66

7-
## Command
8-
9-
### Install
7+
## Installation
108

119
```bash
12-
git clone https://github.com/Anechasun/api-gateway-database.git
13-
cd api-gateway-database
10+
git clone https://github.com/Anechasun/database-gateway.git
11+
cd database-gateway
1412

1513
npm install
1614
```
1715

18-
### Run API Server
16+
## Server
1917

2018
```bash
2119
npm run start-server
2220
```
2321

24-
### Start Client app for develop
22+
## Client
2523

2624
```bash
2725
npm start
2826
```
2927

30-
### Build Client app to file install
28+
### Create installable app file
3129

3230
```bash
3331
npm run build
3432
```
3533

36-
3734
## Usage
3835

39-
#### 1. Run API Server
36+
#### 1. Start Server.
37+
38+
#### 2. Start Client app.
4039

41-
#### 2. Open the Client app and Configure the database.
40+
#### 3. Set up database in Client app.
4241

4342
**`Driver`**: Database types (postgresql, mysql, microsoft-sql-server)
4443

@@ -48,21 +47,21 @@ npm run build
4847

4948
**`Username`**: Username used to establish the connection.
5049

51-
**`Password`**: Password used to establish the connection.
50+
**`Password`**: Password used to establish the connection.
5251

5352
**`Database`**: Database name.
5453

5554
**`Code`**: Client unique id.
5655

5756
<img src="resources/screen-connect.png" width="400" height="500" />
5857

59-
#### 3. Send request to server
58+
#### 4. Retrieve data in the database.
6059

61-
this example api [see](https://github.com/Anechasun/gateway-database/blob/master/server/index.js#L21)
60+
This is just a demo API. You can customize it as needed, as shown in this example code [server/index.js](https://github.com/Anechasun/database-gateway/blob/master/server/index.js#L21).
6261

6362
```bash
6463
curl -X GET \
6564
'http://localhost:3000/query?sql=SELECT * FROM users'
6665
```
67-
<img src="resources/screen-data.jpg" width="400" height="500" />
6866

67+
<img src="resources/screen-data.jpg" width="400" height="500" />

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports.APP_NAME = 'Gateway Database';
1+
exports.APP_NAME = 'Database Gateway';
22
exports.APP_URL = 'http://localhost:3000';
33
exports.APP_WS_URL = 'ws://localhost:3000';
44
exports.DEVELOPMENT_MODE = Boolean(process.env.ELECTRON_DEVELOP);

docker-compose.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,12 @@ services:
66
restart: unless-stopped
77
ports:
88
- 3306:3306
9-
# volumes:
10-
# - "mysql_data:/var/lib/mysql"
119
environment:
1210
MYSQL_ROOT_PASSWORD: 123456
1311
container_name: mysql
1412
tty: true
1513
networks:
1614
- net
17-
phpmyadmin:
18-
image: phpmyadmin
19-
restart: unless-stopped
20-
ports:
21-
- 8888:80
22-
environment:
23-
- PMA_ARBITRARY=1
24-
container_name: phpmyadmin
25-
networks:
26-
- net
27-
28-
# volumes:
29-
# mysql_data:
30-
# driver: local
3115

3216
networks:
3317
net:

0 commit comments

Comments
 (0)