DB manager 2
September 6, 2021 · View on GitHub
The idea
SaaS platform to design database schema and relations and manage data graphically. Use your db in your application as a web component (web-elements, react components, svelte components).
Example
import {TableList, TableForm} from 'db-manager-react';
export default () => <>
<TableList id="users" multiple onSelectChange={trackMyRows}>
</TableList>
<TableForm id="users" onComplete={} onCancel={}>
</TableForm>
</>
Functionalities
- Db schemas designed graphically (New tables, new fields, drag fields on form/list)
- Table views and manage (list/form/massive assignment)
- Columns filter-able, sort-able, group-able
- Cascade copy (dependencies tables)
- Table relations (1-n field-table)
- Table interactions (sub-tables, relation tables)
- Validators/transfomations (injectable JS scripts for validate insert/update/delete, list/form adjusts, virtual sources, filters with authorizations)
- Authorizations (permission rules for roles, readonly, create/update, crud, single tables)
- Embeddable svelte components (table from id, method, mode, multi selection )
- Swagger dynamic crud apis
MVP boundaries
- SAAS designer (section to design schemas)
- SAAS manager (section to manage data)
- List/Forms Web components
Frontend Stack
- Sveltekit
- Carbon IBM (for speed up the MVP)
- Tailwindcss (For layout and advanced components)
Backend Stack
- NestJS
- Knexjs (For manage db queries)
- Sqlite/Postgres (Sqlite to speed up the local development, postgres for prod)
- Swagger generator (To test NestJS integration)
- Backend-side JS injection (or V8 binding for Golang backend)
Schema
- Table
- Field
- List
- Form
- Functions
- Roles
- Users
Rest APIs
Design namespace allow you to define the shape of tables. Manage namespace allow you to CRUD data of specified tables.
Design (section to design schemas)
- [GET]
/design/tablesList of all table - [POST]
/design/tablesCreate a new table (payload json) - [GET]
/design/tables/:table_idGet current table - [PATCH]
/design/tables/:table_idUpdate current table - [DELETE]
/design/tables/:table_idDelete current table - [GET]
/design/tables/:table_id/fieldsList of all fields - [POST]
/design/tables/:table_id/fieldsCreate a new field (payload json) - [PATCH]
/design/tables/:table_id/fields/:field_idUpdate a field (payload json) - [DELETE]
/design/tables/:table_id/fields/:field_idDelete a field (payload json) - [GET]
/design/tables/:table_id/listList of all lists - [POST]
/design/tables/:table_id/listCreate a new list (payload json) - [PATCH]
/design/tables/:table_id/list/:list_idUpdate a list (payload json) - [DELETE]
/design/tables/:table_id/list/:list_idDelete a list (payload json) - [GET]
/design/tables/:table_id/list:list_id/fieldsList of all list fields - [POST]
/design/tables/:table_id/list/:list_id/fieldsCreate a new list field (payload json) - [PATCH]
/design/tables/:table_id/list/:list_id/fields/:list_field_idUpdate a list field (payload json) - [DELETE]
/design/tables/:table_id/list/:list_id/fields/:list_field_idDelete a list field (payload json)
Manage (section to manage data)
- [GET]
/manage/tablesList of all table names - [GET]
/manage/tables/:table_idGet current table definition - [GET]
/manage/tables/:table_id/list?[FILTER_1]=a&[FILTER_2]=bget list data of specified table - [GET]
/manage/tables/:table_id/row?[KEY_1]=a&[KEY_2]=bget row data for specific table - [POST]
/manage/tables/:table_id/rowcreate new row (payload json) - [PATCH]
/manage/tables/:table_id/row?[KEY_1]=a&[KEY_2]=bupdate current row (payload json) - [DELETE]
/manage/tables/:table_id/row?[KEY_1]=a&[KEY_2]=bdelete current row
GTD (Getting Things Done)
- Minimal frontend setup
- Minimal backend setup
- DB connection
- Basic schema definition/creation with migrations
- First rest APIs (see above)
- Basic UI components and rest calls
- JS editor and injection
- SSO integration
- UI polish
- Launch OSS (Project Hunter, DEV.to, Twitter)
Next step
- Swagger api
- table id or alias support
- Theming
Ideas references
- Table + filters https://www.airtable.com/templates/featured/exp3FNmOkdHZvprXB/content-calendar
- https://nocodelist.co/?search=database
- UX - https://www.jotform.com/products/tables/?ref=nocodelist
Developer steps
- Clone the repo
- Open in VSCODE
- Install Yarn (Installation | Yarn)
- Install Recommended Extensions
CTRL + P>'Extensions: Show Recommended Extensions' - Install dependencies
cd client && yarncd server && yarn - Migrate and seed db
cd server && yarn knex-rebuild - Launch backend
cd server && start:dev
Highlighted scripts
Server
yarn run start:dev- Run the server in watch modeyarn run knex-rebuild- Create db and seed datayarn run test- Run server testsyarn run test:cov- Run test coverage
Client
yarn run dev- Run the clientyarn run check- Verify typescript warning/errors on all project