Skip to content

Commit

Permalink
Merge pull request #118 from oslabs-beta/kevin
Browse files Browse the repository at this point in the history
Updated ReadMe with GIFs
  • Loading branch information
choukevin612 committed Feb 7, 2024
2 parents 70f3d1e + fc49447 commit 97dcd7d
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 18 deletions.
17 changes: 10 additions & 7 deletions DEV_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<b>`** v13.0.0 **`</b>

<p>In this version our team focused on refactoring the broken code base from all previous versions. </p>
<p>In this version our team prioritized improving the code base from all prior versions through refactoring. </p>

<p><b> WHAT YOU NEED TO DO FIRST: </b></p>

Expand All @@ -27,7 +27,9 @@ Run npm run dev twice if you do not manually run tsc to compile the files first.

<p><b> WHAT NEEDS TO BE DONE: </b></p>

<p>1. Refractor tableTabBar </p>
<p>1. Refactor tableTabBar Component</p>

- Migrated ERTabling to tableTabBar component to access the ERD because it lacked a parent compartment for prop drilling, hindering the addition of new features. Going forward, a more maintainable solution should be implemented like Redux or Zustand.

<p><b>2. Isolating Database</b> <br> One of the biggest tasks that we tried but <b>did not finish</b> is isolating the concerns of each database type (DBType). The current application has multiple</p>
<code>if (database === DBType.postgres) {}<br>
Expand All @@ -39,22 +41,21 @@ else (database === DBType.sqlite) {}<br>

<img src="./assets/readmeImages/erdArchitecture.png" height=500/>

<p>The road map is finish connecting the siloed pieces for postgres, then moving on to mysql <br><br> <b>***Important*** <br> There is not an entry for this system yet but this file frontend/components/iews/ERTables/ERDisplayWindow.tsx will be the entry</b></p>
<p>The road map is finish connecting the siloed pieces for postgres, then moving on to mysql <br><br> <b>***Important*** <br> There is no entry for this system yet, but this file frontend/components/iews/ERTables/ERDisplayWindow.tsx will be the entry once completed</b></p>

<p><b>3. ERD Logic Update</b><br>Currently, previous wrote the frontend to send back a big bundle of all the operations done in the frontend ERD Table. This ERD table object is divided by add, drop, and alter. All the add operations will execute first then drop, then alter. This is <b>BAD</b>. <br><br> We need to redesign frontend to send back "sequental" operations instead of bundling operations by add, drop, alter because it takes care of multiple edge cases and users in the front can do as many operations they want to ensure <b>SAVE</b> works. I illustrated the problem below. The current backend is written out already. We just need to make sure the frontend is send back the appropriate logic</p>

<img src="./assets/readmeImages/ERD_before_after.png" height=500/>

<br><br> <b>**_Important_** <br> This is wrtten at backend/src/ipcHandlers/dbCRUDHandlerERD.ts and will replace backend/src/ipcHandlers/dbCRUDHandler.ts when this is ready</b>
<br><br> <b>**_Important_** <br> This is written at backend/src/ipcHandlers/dbCRUDHandlerERD.ts and will replace backend/src/ipcHandlers/dbCRUDHandler.ts when this is ready</b>

<p><b>4. Async event emmiters between front/backend</b></p>
<p>Currently, the way the feedback modal works is by handling events that are emitted from both the frontend and the backend. Ideally, this should be refactored to be state dependent rather than event dependent, as it controls the display of the modal. This can be tied into the centralized async event emitter added to frontend/components/app.tsx, in conjunction with migration to reducers from state variables. The goal will be to house modal messages in the store tied to the main app reducer. From there, the async handler can send new messages to the state via main app dispatch, and any other front end feedback can do the same.<br><br>
The main roadblock in the way of finalizing the transfer of event handlers out of the frontend is the way the dblist (list of databases in the sidebar) gets updated. Many event handlers in the backend send a dblist update event out to update the front end. Ideally, this should be handled by returning the new dblist changes out of the handler and using that resolved value to update state whenever an action would cause a dblist change. Right now, app.tsx has a useEffect running that listens for those dblist updates every frame. This is inefficient as a frontend concern.<br><br>
The spinner currently works in a similar way to feedback. Once all async is completely migrated (including dblist update changes), this spinner can simply be tied to the loading property in the main app state.<br><br>
There are still some filesystem read/write calls in the front end. This should be refactored to an async call that requests the backend handle the file system read/write for proper separation of concerns.
</p>
<p>4. </p>
<p>5. </p>


<p><b> WHAT IS BROKEN: </b></p>

Expand All @@ -73,5 +74,7 @@ There are still some filesystem read/write calls in the front end. This should b

<p>5. Foreign and Primary keys.</p>

- Unable to select the primary and/or foreign key of a newly added column until the column is saved onto the database. Once saved onto the database, we can then select the primary and foreign key and save them onto the database.
- Unable to select the primary and/or foreign key of a newly added column until the column is saved onto the database. Once saved onto the database, we can then select the primary and foreign key and save them onto the database.



17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,22 @@ To get started on contributing and editing databases to this project:
- Users can toggle between an 'ER DIAGRAM' view and the 'TABLES' view for each database.

<div align="center">
<img src="./assets/readmeImages/config_demo2.gif" width=800/>
<img src="./assets/readmeImages/gifs/quick_start.gif" width=800/>
<img src="./assets/readmeImages/gifs/login.gif" width=800/>
<!-- <img src="./assets/readmeImages/gifs/quick_start.gif" width=800/> -->
</div>

- Databases

- In the 'DATABASES' view, an interactive Entity Relationship Diagram (`ER DIAGRAM`) is displayed for the selected database.
- Users can now save table layout in version 13.

<br>
<div align="center">
<img src="./assets/readmeImages/gifs/save_db_layout.gif" width=800/>
</div>
<br>


- Users can select `TABLE` to see selected database in tabular form.

- Users can select a table from a list of all the tables in the schema of the currently selected database.
Expand All @@ -94,7 +101,7 @@ To get started on contributing and editing databases to this project:

<br>
<div align="center">
<img src="./assets/readmeImages/gifs/dummy_data.gif" width=800/>
<img src="./assets/readmeImages/gifs/dataTypeChange.gif" width=800/>
</div>
<br>

Expand Down Expand Up @@ -128,7 +135,7 @@ To get started on contributing and editing databases to this project:

<br>
<div align="center">
<img src="./assets/readmeImages/gifs/create_db3.gif" width=800/>
<img src="./assets/readmeImages/gifs/importCreateDB.gif" width=800/>
<img src="./assets/readmeImages/gifs/modify_db.gif" width=800/>
</div>

Expand All @@ -144,7 +151,7 @@ To get started on contributing and editing databases to this project:
</br>
<br>
<div align="center">
<img src="./assets/readmeImages/gifs/query.gif" width=800/>
<img src="./assets/readmeImages/gifs/querySearch.gif" width=800/>
</div>
<br />

Expand Down
Binary file removed assets/readmeImages/gifs/Manual_Create_DB.gif
Binary file not shown.
Binary file removed assets/readmeImages/gifs/create_db3.gif
Binary file not shown.
Binary file added assets/readmeImages/gifs/dataTypeChange.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/readmeImages/gifs/importCreateDB.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/readmeImages/gifs/login.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/readmeImages/gifs/query.gif
Binary file not shown.
Binary file added assets/readmeImages/gifs/querySearch.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/readmeImages/gifs/save_db_layout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion backend/src/models/configModel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// import path from 'path';
import os from 'os'
import fs from 'fs';
import { DBType, LogType } from '../../../shared/types/dbTypes';
import logger from '../utils/logging/masterlog';
Expand All @@ -8,7 +9,7 @@ import { DocConfigFile } from '../../BE_types';

const home = process.cwd();
const configFile = 'config.json';
const configPath = `${home}/${configFile}`;
const configPath = `${os.homedir()}/Documents/SeeQR/${configFile}`;

// ideally, we want to keep this config in a seperate file as well
export const defaultFile: DocConfigFile = {
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql_options":{"user":"root","password":"","port":"3306"},"pg_options":{"user":"postgres","password":"Skittle5$s","port":"5434"},"rds_mysql_options":{"user":"","password":"","port":"","host":""},"rds_pg_options":{"user":"","password":"","port":"","host":""},"sqlite_options":{"filename":""},"directPGURI_options":{"connectionString":""}}
{"mysql_options":{"user":"root","password":"","port":"3306"},"pg_options":{"user":"postgres","password":"","port":"5434"},"rds_mysql_options":{"user":"","password":"","port":"","host":""},"rds_pg_options":{"user":"","password":"","port":"","host":""},"sqlite_options":{"filename":""},"directPGURI_options":{"connectionString":""}}
15 changes: 11 additions & 4 deletions roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- General

- Refactor codebase to elimiate prop-drilling allowing for future iterability.
- Refactor codebase to elimiate <strong>prop-drilling</strong> allowing for future iterability.

- Update ui of the initial landing page of application with cloud database instructions

Expand Down Expand Up @@ -36,11 +36,13 @@

- Queries page

- fix query execution plan table view, likely broke while updating frontend dependencies
- Fix query execution plan table view, likely broke while updating frontend dependencies
- Fix query execution plan table view, likely broke while updating frontend dependencies

- add colors back to special words in query view
- Utilize local storage to save query history. Currently the history disappears when we reload application.

- work on explain function for mysql and sqlite, may have different metadata from existing postgres implementation, display whatever you can get
- Work on explain function for mysql and sqlite, may have different metadata from existing postgres implementation, display whatever you can get
- Work on explain function for mysql and sqlite, may have different metadata from existing postgres implementation, display whatever you can get


- 2D visualization / ER tables:
Expand Down Expand Up @@ -83,3 +85,8 @@
- Implement ER table functions

- Add VR functionality?

- Mac vs Windows:

- In the '../backend/src/models/configModel.ts' on line 9 - 11 specifies where the configFile will be downloaded. The 'home' variable will be different for Mac and Windows users. Utilize an if conditional statement here to prevent the need for maintaining two branches (main and devosx) for windows and mac.

0 comments on commit 97dcd7d

Please sign in to comment.