An open-source data modeling tool to facilitate relational database development
- Run SQL queries against PostgreSQL or MySQL DBs
- Live results + metadata: execution time, query name, timestamp
- Zustand-powered state management
- Input validation and error handling
- Component-level Jest + ReactTestLibrary tests
- Access previously saved queries per user
- Sortable, styled tables with TypeScript typing
- Track query performance across data models
- TailwindCSS redesign: colors, layout, interactions
- Responsive and fully supported dark/light mode
- Logo animation integrated in navbar
- Sidebar and tab layout fixes
- Resolved layout shift bugs
- Optimized backend response handling
- OAuth (GitHub + local login)
- Extend Test Query feature to additional DB types (e.g. Oracle)
- Persist database sessions across routes
- Integrate LLMs to suggest efficient queries and schema improvements
- Add OAuth support for Microsoft accounts
- Add support for NoSQL (MongoDB) and graph databases
- Expand UI testing coverage
- Full widescreen UI with a dropdown menu for more workspace
- Enhanced Save, Load, and Delete features that support filenames for saving schema and data
- Proper deletion of dependent elements across tables
- Algorithm to highlight edges connected to the selected table
- Fixed rendering and deletion issues with elements
- Support for connecting to remote databases (PostgreSQL, MySQL, Microsoft SQL, Oracle SQL)
- Ability to upload SQL files and render ER diagrams for the provided SQL dump
- Interface for modifying tables and creating new ones, with changes reflected in the database via generated queries
- Canvas to create databases and ER diagrams from scratch.
-
Database Uploads: Connect to remote SQL database or upload local SQL files
-
ER Diagram Visuals: Visualize the entity relationship diagram of a database with dynamic handle placement
-
Table Relationship Visuals Relationships of individual tables are easily identified when clicking on a table
-
Schema Modification: Toggle between Schema and Data easily with a click of a button
-
Data/Schema Modification: Easily modify a database's schema or data through a simple UI
-
Guided Database Building: Create a new database from scratch using entity relationship diagrams to ensure the integrity of the database
-
Database Undo/Redo: Provides a history of edits for easier backtracking
-
Query Generator: Query generator generates executable SQL queries
-
User Sessions: Sign up/Log in securely with either Google/Github OAuth or JWTs/Bcrypt
-
Save/Load: Store and reload past database sessions through your user accoun
-
Dark Mode: Visual settings to provide a more comfortable viewing experience in low-light environements
-
Live Querying and Save Queries Test SQL queries and also save them to track and analyze query performance across data models (dbSpy V8.0)
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 with the information below:
# 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>
GOOGLE_OAUTH_CLIENT_ID = <Google Oauth client id>
GOOGLE_OAUTH_CLIENT_SECRET= <Google Oauth client id>
GOOGLE_OAUTH_REDIRECT_URI = 'http://localhost:8080/display'
GITHUB_OAUTH_CLIENT_ID = <Github Oauth client id>
GITHUB_OAUTH_CLIENT_SECRET= <Github Oauth client id>
GITHUB_OAUTH_REDIRECT_URI = 'http://localhost:8080/display'
- Run the following below:
$ npm install
- Execute the following command to populate your mySql database with a users table:
$ npm run seed
- Run the project in development mode:
$ npm run dev
To connect with the SQL database, we must create and configure SSL certificates.
- Install mkcert; you can learn more about mkcert here
npm install -g mkcert
- Run the following script
npm run cert:mac
- Check mkcert is up to date (v1.5.1 as of publishing)
mkcert --version
- Run the following script
npm run cert:linux
- Click on the "Connect Database" button under the Action section on the left side of the page. This will open a sidebar on the right side of the page.
- Select the database type from the dropdown.
- Input your database URI information OR database connection credentials and click on "Connect".
- Once the connection to your database is established, the canvas will render and generate the tables and their relationships.
- OracleSQL requires the download of the OCI - here
- Locate and click on the "Upload SQL File" button under the Action section on the left side of the page. This will open a dialog box for you to select the SQL file you wish to upload.
- Once the file uploads, the canvas will render and generate the tables and their relationships.
- Locate and click on the "Build Database" button under the Action section on the left side of the page. This will render the canvas for you to create your database schema.
- Click on "Add Table" to name the first table and start building your database.
-
To add a new column/row in a table, click on the add/plus icon on the top right of the table node.
-
This will render a new column/row in the table in edit mode.
-
Add in the data you would like in each column/row.
-
Click on the confirm icon to save the column/row.
-
The changes made in DATA table will be updated in your database.
-
Click on the cancel icon to cancel the addition.
- Click on the edit icon of the specific column that you want to edit.
- You can make changes to column fields based on the selections provided.
- Click on the save icon to keep your changes.
- Click on the cancel icon to cancel your changes.
- Click on the delete icon of the specific column that you want to delete.
- Click on the confirm icon to delete the column.
- Click on the cancel icon to cancel the deletion.
- While editing a column, if setting Foreign Key (FK) to "true", the Foreign Key Reference sidebar will appear on the right side of the screen.
- In the Foreign Key Reference sidebar, use the displayed dropdowns to create references between tables.
- Click save or cancel to proceed.
- Click on the save icon to keep your changes or click on the cancel icon to cancel your changes.
- When on the display page, click the 'Add Table' icon after you have either connected to a database or clicked 'Build Database'.
- Fill in the required information about the first column of your table along with a name.
- If you would like to include additional columns, click the 'Add Column' button in the top right corner.
- Click confirm to create your table.
- After you have either connected to a database or started a new database, the 'Delete Table' icon will appear on the left side of the display page
- This will open a pop out with a list of tables from the database.
- Select which table that you would like to have removed, and confirm to have it deleted.
- Located on the bottom left corner of the canvas, you will find the canvas control panel.
- Zoom On [+] - this button zooms into the canvas.
- Zoom Out [-] - this button zooms out of the canvas.
- Fit View [[]] - this button zooms to fit all the tables in focus.
- Toggle Interactivity [lock] - this button toggles on and off all table and column interactivity.
- Screenshot [camera] - this button saves a .png file of the current canvas view.
- If you'd like to contribute, please find a list of possible contributions here
- If you have any requests, please submit an appropriately tagged GitHub issue
- PRs are welcome otherwise
- Yihe Liu • LinkedIn • Github
- Emma Vargas • LinkedIn • Github
- Vicky Yue • LinkedIn • Github
- Roshumba Llewellyn • LinkedIn • Github
- Revathy Venkataraman • LinkedIn • Github
- David Jones • LinkedIn • Github
- John Ruiz • LinkedIn • Github
- Minh Chang • LinkedIn • Github
- Darius Okafor • LinkedIn • Github
- Parwinder Singh • LinkedIn • Github
- Yichung Chiu • LinkedIn • Github
- Joseph Tejeda • LinkedIn • Github
- Stephen Havig • LinkedIn • Github
- Das Kang • LinkedIn • Github
- Alexander Tu • LinkedIn • Github
- Michael Costello • LinkedIn • Github
- Steven Geiger • LinkedIn • Github
- Yufa Li • LinkedIn • Github
- Angel Giron • LinkedIn • Github
- John Paul Adigwu • LinkedIn • Github
- Kevin Park-Lee • LinkedIn • Github
- Tarik Mokhtech • LinkedIn • Github
- Brett Guidry • LinkedIn • Github
- Emil Mebasser• LinkedIn • Github
- Mimi Le • LinkedIn • Github
- Samson Lam • LinkedIn • Github
- Adrian Reczek • LinkedIn • Github
- Anthony Al-Rifai • LinkedIn • Github
- Kevin Wang • LinkedIn • Github
- Kris Magat • LinkedIn • Github
- Santiago Gil Maya • LinkedIn • Github
- Donald Macak • LinkedIn • Github
- Matthew Cummings • LinkedIn • Github
- Stanley Ho • LinkedIn • Github
- Matthew Jones • LinkedIn • Github
dbSpy is developed under the MIT license.