Skip to content

Commit

Permalink
Merge pull request #94 from open-source-labs/4.1
Browse files Browse the repository at this point in the history
Patch update v4.0.1
  • Loading branch information
atu816 authored Feb 28, 2023
2 parents 0db37e8 + 01c1c27 commit 7a327a6
Show file tree
Hide file tree
Showing 40 changed files with 14,003 additions and 902 deletions.
45 changes: 29 additions & 16 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,43 @@ name: Node.js CI

on:
push:
branches:
- "main"
# 4.1 included temporarily to test out github workflow
- "4.1"
branches: ['main']
pull_request:
branches: [ "main" ]
branches: ['main']

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- name: Start server
env:
USER_DB_USER: ${{secrets.USER_DB_USER}}
USER_DB_PW: ${{secrets.USER_DB_PW}}
USER_DB_URL: ${{secrets.USER_DB_URL}}
SSL_KEY: ${{secrets.SSL_KEY}}
SSL_CERT: ${{secrets.SSL_CERT}}
run: npm run start:test
- name: Run test suites
env:
MYSQL_TEST_URL: ${{secrets.MYSQL_TEST_URL}}
MYSQL_TEST_USERNAME: ${{secrets.MYSQL_TEST_USERNAME}}
MYSQL_TEST_PW: ${{secrets.MYSQL_TEST_PW}}
PG_TEST_URL: ${{secrets.PG_TEST_URL}}
PG_TEST_USERNAME: ${{secrets.PG_TEST_USERNAME}}
PG_TEST_PW: ${{secrets.PG_TEST_PW}}
TEST_USER_EMAIL: ${{secrets.TEST_USER_EMAIL}}
TEST_USER_PW: ${{secrets.TEST_USER_PW}}
run: npm test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ package-lock.json
#EBStalk
.elasticbeanstalk/

# Environment Variables
.env
cypress.env.json

# Log
serverLog.txt

# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
Expand Down
13 changes: 2 additions & 11 deletions Contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@

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!

- Delete Table
- Delete Table
- Add a command to delete a table from the canvas, making sure to implement checks to maintain data integrity
- Logging needs a default settings list and direct reimport into live database.
- 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.
- Db-schemas
- 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.
- Expand compatibility with other SQL database such as Oracle SQL, Microsoft SQL, IBM Db2, etc.
- Add additional themes and graphical options to canvas and tables
- Clean up unused dependencies from pre-4.0
- Connecting to PostgreSQL database
- 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.
- Integration and End-to-End testing for the codebase.
- Live query feedback so users can see what their changes to the canvas look like as queries.

Known bugs/issues

- Table connection (handle) does not automatically render after a foreign key is added and the column data is saved.
- 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.
- 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.
- 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.


- Undo function will not revert the state of the canvas to the point where it is empty.
87 changes: 55 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

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

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

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

Expand All @@ -52,34 +52,37 @@

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

<img src="images/Darkmode.png">
---
## <img src="images/Darkmode.png">

### Getting started
You will need your own mySQL and redis databases for backend functions, and Google Cloud project for OAuth.

You will need your own MySQL database for backend functions.

- Fork and clone this repo
- Add a db_schemas folder in server directory
- Add a .env file to the root directory
- Go to the Google Cloud Platform Console
- 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
your authorized redirect URI in the credentials you create matches the GOOGLE_AUTH_CALLBACK variable below.
- Populate the .env file with the newly created code below:
- Add a .env file to the root directory with the information below:

```bash
GOOGLE_AUTH_CALLBACK = ''
DATABASE_URL = [mysql url for storing user data]
DEV_SERVER_ENDPOINT = 'http://localhost:3000'
DEV_CLIENT_ENDPOINT = 'http://localhost:8080'
CLIENT_ENDPOINT = 'http://localhost:3000'
GOOGLE_AUTH_CALLBACK = 'http://localhost:3000/api/oauth/google'
GOOGLE_AUTH_CLIENT_ID = [google auth client id]
GOOGLE_AUTH_CLIENT_SECRET = [google auth client secret]
REDIS_URL = [redis url]
REDIS_PORT = [redis port]
REDIS_PASSWORD = [redis password]
REDIS_SECRET = [redis secret]
ENVIRONMENT = "development"
TOKEN_KEY = [any string]
# production environment variables
USER_DB_URL = <MySQL url for storing user data>
USER_DB_USER = <user string from USER_DB_URL>
USER_DB_PW = <password string from USER_DB_URL>
TOKEN_KEY = <any string>

# testing environment variables
## encoded SSL data required for GitHub Actions
SSL_KEY = <base64 encoded SSL key (see SSL Configuration)>
SSL_CERT = <base64 encoded SSL cert>
## MySQL and Postgres databases to test remote connection functionality
MYSQL_TEST_URL = <MySQL url for a test database>
MYSQL_TEST_USERNAME = <user string from MYSQL_TEST_URL>
MYSQL_TEST_PW = <password string from MYSQL_TEST_URL>
PG_TEST_URL = <PostgreSQL url for a test database>
PG_TEST_USERNAME = <user string from PG_TEST_URL>
PG_TEST_PW = <password string from PG_TEST_URL>
## test user with saved schema to test save/load functionality
TEST_USER_EMAIL = <email string>
TEST_USER_PW = <password string>
```

- Run the following below:
Expand All @@ -89,6 +92,7 @@ $ npm install
```

- Execute the following command to populate your mySql database with a users table:

```bash
$ npm run seed
```
Expand All @@ -101,19 +105,38 @@ $ npm run dev

---

### Connecting with remote MySQL
### SSL Configuration

To connect with the SQL database, we must create and configure SSL certificates.

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

1. Install mkcert; you can learn more about mkcert [here](https://github.com/FiloSottile/mkcert)

```bash
npm install -g mkcert
```
2. Run the following script

2. Run the following script

```bash
npm run cert
```

### Linux

1. Check mkcert is up to date (v1.5.1 as of publishing)

```bash
mkcert --version
```

2. Run the following script

```bash
npm run cert:linux
```

---

# How to Use
Expand Down Expand Up @@ -142,7 +165,7 @@ npm run cert
## Adding column(s) to a table

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.
<img src="images/Create%20tables.png">
<img src="images/Create%20tables.png">

### Editing an existing column in a table

Expand Down Expand Up @@ -185,6 +208,10 @@ npm run cert

### Credits/Contributors

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

---

### License

dbSpy is developed under the MIT license.
dbSpy is developed under the MIT license.
Loading

0 comments on commit 7a327a6

Please sign in to comment.