Skip to content

Commit 7a327a6

Browse files
authored
Merge pull request #94 from open-source-labs/4.1
Patch update v4.0.1
2 parents 0db37e8 + 01c1c27 commit 7a327a6

40 files changed

+14003
-902
lines changed

.github/workflows/node.js.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,43 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches:
9-
- "main"
10-
# 4.1 included temporarily to test out github workflow
11-
- "4.1"
8+
branches: ['main']
129
pull_request:
13-
branches: [ "main" ]
10+
branches: ['main']
1411

1512
jobs:
1613
build:
17-
1814
runs-on: ubuntu-latest
19-
2015
strategy:
2116
matrix:
2217
node-version: [16.x, 18.x]
2318
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2419

2520
steps:
26-
- uses: actions/checkout@v3
27-
- name: Use Node.js ${{ matrix.node-version }}
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: ${{ matrix.node-version }}
31-
cache: 'npm'
32-
- run: npm ci
33-
- run: npm run build --if-present
34-
- run: npm test
21+
- uses: actions/checkout@v3
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
- run: npm ci
28+
- run: npm run build --if-present
29+
- name: Start server
30+
env:
31+
USER_DB_USER: ${{secrets.USER_DB_USER}}
32+
USER_DB_PW: ${{secrets.USER_DB_PW}}
33+
USER_DB_URL: ${{secrets.USER_DB_URL}}
34+
SSL_KEY: ${{secrets.SSL_KEY}}
35+
SSL_CERT: ${{secrets.SSL_CERT}}
36+
run: npm run start:test
37+
- name: Run test suites
38+
env:
39+
MYSQL_TEST_URL: ${{secrets.MYSQL_TEST_URL}}
40+
MYSQL_TEST_USERNAME: ${{secrets.MYSQL_TEST_USERNAME}}
41+
MYSQL_TEST_PW: ${{secrets.MYSQL_TEST_PW}}
42+
PG_TEST_URL: ${{secrets.PG_TEST_URL}}
43+
PG_TEST_USERNAME: ${{secrets.PG_TEST_USERNAME}}
44+
PG_TEST_PW: ${{secrets.PG_TEST_PW}}
45+
TEST_USER_EMAIL: ${{secrets.TEST_USER_EMAIL}}
46+
TEST_USER_PW: ${{secrets.TEST_USER_PW}}
47+
run: npm test

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ package-lock.json
1616
#EBStalk
1717
.elasticbeanstalk/
1818

19+
# Environment Variables
1920
.env
21+
cypress.env.json
22+
23+
# Log
24+
serverLog.txt
25+
2026
# Elastic Beanstalk Files
2127
.elasticbeanstalk/*
2228
!.elasticbeanstalk/*.cfg.yml

Contributors.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,16 @@
22

33
Below is a list of features and improvements to which you can contribute. If you have any additional ideas, please raise an issue or implement them as well!
44

5-
- Delete Table
5+
- Delete Table
66
- Add a command to delete a table from the canvas, making sure to implement checks to maintain data integrity
77
- Logging needs a default settings list and direct reimport into live database.
88
- The SQL code to import has been placed into the DB_Schemas folder along with SQL Schema dumps. Also, log setting functionality is currently limited to Postgres databases and the code needs to be expanded to query and display log setting info from MySQL databases.
99
- Db-schemas
1010
- The schemas are saved under db_schemas and is saved in the server. Have a way to delete the schemas on the server from the front end. It would also be convenient to add these schemas to a list of existing schemas and be able to pull these schemas to display for the user to avoid having to make a new connection to the same database multiple times.
1111
- Expand compatibility with other SQL database such as Oracle SQL, Microsoft SQL, IBM Db2, etc.
1212
- Add additional themes and graphical options to canvas and tables
13-
- Clean up unused dependencies from pre-4.0
14-
- Connecting to PostgreSQL database
15-
- When connecting to PostgreSQL to grab the data from the database, it takes a really long time to load (approximately 2 minutes); further investigate pg_dump alternatives for faster loading.
16-
- Integration and End-to-End testing for the codebase.
1713
- Live query feedback so users can see what their changes to the canvas look like as queries.
1814

1915
Known bugs/issues
2016

21-
- Table connection (handle) does not automatically render after a foreign key is added and the column data is saved.
22-
- In production, remote postgres database connections do not work. We suspect this is due to container environment (nodeJS) not having access to pg_dump command.
23-
- In development, WSL/Ubuntu users may have trouble running pg_dump due to version mismatch. Run `sudo apt-get --purge remove postgresql` to clear configuration files and zombie directories before installing postgresql fresh.
24-
- Undo function will not regress the state of the canvas to the point where it is empty. Whether this is a design choice or an issue is up to you.
25-
26-
17+
- Undo function will not revert the state of the canvas to the point where it is empty.

README.md

Lines changed: 55 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
1. **Database Uploads:** Connect to remote SQL database or upload local SQL files
3636

37-
2. **ER Diagram Visuals:** Visualize the entity relationship diagram of a database with dynamic handle placement
37+
2. **ER Diagram Visuals:** Visualize the entity relationship diagram of a database with dynamic handle placement
3838

3939
3. **Table Relationship Visuals** Relationships of individual tables are easily identified when clicking on a table.
4040

@@ -52,34 +52,37 @@
5252

5353
10. **Dark Mode:** Visual settings to provide a more comfortable viewing experience in low-light environements
5454

55-
<img src="images/Darkmode.png">
56-
---
55+
## <img src="images/Darkmode.png">
5756

5857
### Getting started
59-
You will need your own mySQL and redis databases for backend functions, and Google Cloud project for OAuth.
58+
59+
You will need your own MySQL database for backend functions.
60+
6061
- Fork and clone this repo
6162
- Add a db_schemas folder in server directory
62-
- Add a .env file to the root directory
63-
- Go to the Google Cloud Platform Console
64-
- Set up OAuth 2.0 credentials as laid out in <a href="https://support.google.com/cloud/answer/6158849?hl=en">here</a>. Make sure
65-
your authorized redirect URI in the credentials you create matches the GOOGLE_AUTH_CALLBACK variable below.
66-
- Populate the .env file with the newly created code below:
63+
- Add a .env file to the root directory with the information below:
6764

6865
```bash
69-
GOOGLE_AUTH_CALLBACK = ''
70-
DATABASE_URL = [mysql url for storing user data]
71-
DEV_SERVER_ENDPOINT = 'http://localhost:3000'
72-
DEV_CLIENT_ENDPOINT = 'http://localhost:8080'
73-
CLIENT_ENDPOINT = 'http://localhost:3000'
74-
GOOGLE_AUTH_CALLBACK = 'http://localhost:3000/api/oauth/google'
75-
GOOGLE_AUTH_CLIENT_ID = [google auth client id]
76-
GOOGLE_AUTH_CLIENT_SECRET = [google auth client secret]
77-
REDIS_URL = [redis url]
78-
REDIS_PORT = [redis port]
79-
REDIS_PASSWORD = [redis password]
80-
REDIS_SECRET = [redis secret]
81-
ENVIRONMENT = "development"
82-
TOKEN_KEY = [any string]
66+
# production environment variables
67+
USER_DB_URL = <MySQL url for storing user data>
68+
USER_DB_USER = <user string from USER_DB_URL>
69+
USER_DB_PW = <password string from USER_DB_URL>
70+
TOKEN_KEY = <any string>
71+
72+
# testing environment variables
73+
## encoded SSL data required for GitHub Actions
74+
SSL_KEY = <base64 encoded SSL key (see SSL Configuration)>
75+
SSL_CERT = <base64 encoded SSL cert>
76+
## MySQL and Postgres databases to test remote connection functionality
77+
MYSQL_TEST_URL = <MySQL url for a test database>
78+
MYSQL_TEST_USERNAME = <user string from MYSQL_TEST_URL>
79+
MYSQL_TEST_PW = <password string from MYSQL_TEST_URL>
80+
PG_TEST_URL = <PostgreSQL url for a test database>
81+
PG_TEST_USERNAME = <user string from PG_TEST_URL>
82+
PG_TEST_PW = <password string from PG_TEST_URL>
83+
## test user with saved schema to test save/load functionality
84+
TEST_USER_EMAIL = <email string>
85+
TEST_USER_PW = <password string>
8386
```
8487

8588
- Run the following below:
@@ -89,6 +92,7 @@ $ npm install
8992
```
9093

9194
- Execute the following command to populate your mySql database with a users table:
95+
9296
```bash
9397
$ npm run seed
9498
```
@@ -101,19 +105,38 @@ $ npm run dev
101105

102106
---
103107

104-
### Connecting with remote MySQL
108+
### SSL Configuration
109+
110+
To connect with the SQL database, we must create and configure SSL certificates.
105111

106-
- To connect with the SQL database, we must create and configure SSL certificates.
112+
### Mac
107113

108114
1. Install mkcert; you can learn more about mkcert [here](https://github.com/FiloSottile/mkcert)
115+
109116
```bash
110117
npm install -g mkcert
111118
```
112-
2. Run the following script
119+
120+
2. Run the following script
121+
113122
```bash
114123
npm run cert
115124
```
116125

126+
### Linux
127+
128+
1. Check mkcert is up to date (v1.5.1 as of publishing)
129+
130+
```bash
131+
mkcert --version
132+
```
133+
134+
2. Run the following script
135+
136+
```bash
137+
npm run cert:linux
138+
```
139+
117140
---
118141

119142
# How to Use
@@ -142,7 +165,7 @@ npm run cert
142165
## Adding column(s) to a table
143166

144167
1. To add a new column in a table, click on the add icon on the top right of the table node. This will render a new column in the table in edit mode.
145-
<img src="images/Create%20tables.png">
168+
<img src="images/Create%20tables.png">
146169

147170
### Editing an existing column in a table
148171

@@ -185,6 +208,10 @@ npm run cert
185208

186209
### Credits/Contributors
187210

211+
- Alexander Tu • [LinkedIn](https://www.linkedin.com/in/atu816/)[Github](http://github.com/atu816)
212+
- Michael Costello • [LinkedIn](https://www.linkedin.com/in/mcostello-swe/)[Github](https://github.com/neighbor-peace)
213+
- Steven Geiger • [LinkedIn](https://www.linkedin.com/in/sgeiger9/)[Github](https://github.com/geistnine)
214+
- Yufa Li • [LinkedIn](https://www.linkedin.com/in/yufa-li/)[Github](https://github.com/01001101CK)
188215
- Angel Giron • [LinkedIn](https://www.linkedin.com/in/acgiron/)[Github](https://github.com/g94angel)
189216
- John Paul Adigwu • [LinkedIn](https://www.linkedin.com/in/johnpaul-adigwu/)[Github](https://github.com/engineerous)
190217
- Kevin Park-Lee • [LinkedIn](https://www.linkedin.com/in/kevin38424/)[Github](https://github.com/kevin38424)
@@ -198,13 +225,9 @@ npm run cert
198225
- Kevin Wang • [LinkedIn](https://www.linkedin.com/in/kevin-w-b841b13/)[Github](https://github.com/kwang929)
199226
- Kris Magat • [LinkedIn](https://www.linkedin.com/in/kmag/)[Github](https://github.com/KrisMagat)
200227
- Santiago Gil Maya • [LinkedIn](https://www.linkedin.com/in/santiago-gil-929721121/)[Github](https://github.com/santiago-gil)
201-
- Alexander Tu • [LinkedIn](https://www.linkedin.com/in/atu816/)[Github](http://github.com/atu816)
202-
- Michael Costello • [LinkedIn](https://www.linkedin.com/in/mcostello-swe/)[Github](https://github.com/neighbor-peace)
203-
- Steven Geiger • [LinkedIn](https://www.linkedin.com/in/sgeiger9/)[Github](https://github.com/geistnine)
204-
- Yufa Li • [LinkedIn](https://www.linkedin.com/in/yufa-li/)[Github](https://github.com/01001101CK)
205228

206229
---
207230

208231
### License
209232

210-
dbSpy is developed under the MIT license.
233+
dbSpy is developed under the MIT license.

0 commit comments

Comments
 (0)