Skip to content

fiqihbadrian/ZxwDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

zxwdb - Visual Database Designer

🎨 Professional visual database designer for MySQL/MariaDB with modern Mac Terminal-inspired interface.

npm version GitHub


πŸš€ Quick Start

Installation

npm install -g @fiqihbadrian/zxwdb

Run

zxwdb

That's it! The server will start automatically and your browser will open.


πŸ“– How to Use

1. Start the Application

zxwdb

Interactive Menu:

  • β˜† Open in Browser
  • β˜† View Server Info
  • β˜† View Documentation
  • β˜† Restart Server
  • β˜† Stop & Exit

2. Access the Web Interface

Local Access:

http://localhost:3001

Network Access (from other devices):

http://[your-ip]:3001

3. Connect to Database

  1. Click "Connect to Database"
  2. Enter your database credentials:
    • Host (e.g., localhost)
    • Port (e.g., 3306)
    • Username
    • Password
  3. Click "Connect"

4. Select or Create Database

  • Browse existing databases - Select from dropdown
  • Create new database - Click "Create Database"

5. Design Your Database

Import Existing Schema:

  • Click "Import Schema" to load tables from your database
  • Relationships are auto-detected from foreign keys

Create New Tables:

  • Click "+ New Table" or press Cmd/Ctrl+N
  • Define columns, primary keys, data types
  • Save directly to database

Visual Relationships:

  • Drag from one column to another to create relationships
  • Choose "Visual Only" or "Create FK Constraint"
  • Delete relationships by dragging to empty space

Edit Tables:

  • Double-click any table to edit structure
  • Add/remove/modify columns
  • Changes save automatically to database

Browse Data:

  • Click "Browse Data" or press Cmd/Ctrl+B
  • View, insert, edit, delete records
  • Run queries and test relationships

⌨️ Keyboard Shortcuts

Shortcut Action
Cmd/Ctrl + N New Table
Cmd/Ctrl + B Browse Data
Cmd/Ctrl + P Preview SQL
Cmd/Ctrl + K Quick Search
Cmd/Ctrl + Z Undo
Cmd/Ctrl + Shift + Z Redo
F Fit View
Delete Delete Selected
ESC Close/Cancel
Hold Cmd/Ctrl Show All Shortcuts

✨ Features

Visual Database Design

  • 🎨 Drag-and-drop table designer
  • πŸ”„ Auto-detect relationships from foreign keys
  • πŸ“Š ERD (Entity Relationship Diagram) view
  • πŸ”— Column-level relationship connections
  • ⚑ Real-time schema updates

Database Operations

  • πŸ’Ύ Auto-save to database (no manual save needed)
  • πŸ” Browse and edit table data
  • πŸ“ Run SQL queries
  • πŸ” Foreign key constraint management
  • πŸ“Š View relationship cardinality

Modern UX

  • 🎯 Mac Terminal color scheme (dark mode)
  • ⌨️ Professional keyboard shortcuts
  • πŸ”” Toast notifications for all operations
  • ↩️ Undo/Redo support
  • πŸ” Quick table search

CLI Features

  • πŸš€ Auto-start server
  • πŸŽ›οΈ Interactive menu
  • 🌐 Network accessible
  • πŸ”„ Restart without exit
  • πŸ“š Built-in documentation

πŸ”§ Configuration

Port Configuration

By default, zxwdb uses port 3001. If the port is already in use, it will automatically find the next available port.

Custom Port:

PORT=3002 zxwdb

Database Connection

Connections are session-based and cleared when you close the browser tab (for security).


πŸ› οΈ Troubleshooting

Port Already in Use

zxwdb automatically detects and uses an available port. If you see a warning:

⚠️  Port 3001 in use, using port 3002 instead

This is normal! Just use the displayed port number.

Can't Connect to Database

  1. Check database is running:

    mysql -u root -p
  2. Verify credentials (host, port, username, password)

  3. Ensure MySQL/MariaDB allows remote connections if accessing from network

Server Won't Start

  1. Check Node.js version:

    node --version  # Should be >= 14.0.0
  2. Reinstall package:

    npm uninstall -g @fiqihbadrian/zxwdb
    npm install -g @fiqihbadrian/zxwdb

πŸ“¦ Update

Check for updates:

npm outdated -g

Update to latest version:

npm update -g @fiqihbadrian/zxwdb

Or reinstall:

npm install -g @fiqihbadrian/zxwdb@latest

πŸ“‹ Requirements

  • Node.js >= 14.0.0
  • MySQL >= 5.7 or MariaDB >= 10.2
  • Modern web browser (Chrome, Firefox, Safari, Edge)

🌟 Use Cases

  • Database Design - Visual schema planning
  • Reverse Engineering - Import and visualize existing databases
  • Documentation - Generate ERD diagrams
  • Development - Quick database prototyping
  • Learning - Understand database relationships
  • Data Management - Browse and edit data

πŸ” Security

  • Connections are session-based (auto-logout on tab close)
  • Database credentials not stored permanently
  • Local-first design (your data stays on your machine)
  • Network binding optional (access from other devices)

πŸ“„ License

MIT Β© Fiqih Badrian


πŸ› Report Issues

Found a bug or have a feature request?

GitHub Issues: https://github.com/fiqihbadrian/zxwdb/issues


πŸ’¬ Support

Need help? Have questions?

  • πŸ“– Run zxwdb β†’ Choose "View Documentation"
  • πŸ› Report issues on GitHub
  • πŸ“§ Contact: [your-email@example.com]

πŸŽ‰ Quick Example

# 1. Install
npm install -g @fiqihbadrian/zxwdb

# 2. Run
zxwdb

# 3. Browser opens automatically
# 4. Connect to your MySQL/MariaDB database
# 5. Start designing!

Made with ❀️ by Fiqih Badrian

Enjoy designing databases visually! πŸš€

About

Design and visualize MySQL/MariaDB databases effortlessly - Visual ERD tool with auto-detect relationships and modern interface

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors