Skip to content
mohamedashaibiPublic

About

CoreNode: web database manager for MySQL, MariaDB, PostgreSQL, SQL Server, SQLite and MongoDB, with SQL editor, visual query builder and schema editor. Laravel + Vue 3.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DB Manager

A full-featured database management web application for connecting to, querying, and administering multiple database servers. Built with Laravel and Vue.js, it supports MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, and MongoDB with a modern UI, query builder, schema editor, and optional SaaS billing.


Author

Mohamed Ashaibi
🌐 ashaibi.com


Features

Connection management

  • Saved connections — Store connection credentials (host, port, database, username, password) with optional encryption. Limits per user based on subscription plan.
  • Local connections — Connect without saving: add connection details in the UI and use them in the session (stored in browser localStorage). Ideal for quick access or shared machines.
  • Multiple drivers — MySQL, MariaDB, PostgreSQL, SQLite, SQL Server, MongoDB. Each connection uses the appropriate driver and syntax (identifiers, LIMIT vs TOP, etc.).
  • Connection test — Verify connectivity before opening a connection.

Query & data

  • SQL editor — Run arbitrary SQL (or MongoDB-style JSON) with syntax placeholder, Ctrl+Enter to run, and result grid.
  • Query builder — Visual builder for SELECT queries: choose table(s), columns, WHERE conditions (including IN, LIKE, IS NULL), ORDER BY, LIMIT. Supports JOINs (INNER, LEFT, RIGHT) with ON conditions. Generates driver-correct SQL and can insert into the editor or run directly.
  • AI query generator — Optional OpenAI integration: describe what you want in natural language and get a suggested SQL query (requires OPENAI_API_KEY).
  • Query history — Recent queries in the session for quick re-run.
  • Saved queries — (Saved connections only) Save named queries per connection; limits per plan.
  • Data tab — Browse table rows with pagination. Inline edit (double-click), add row, delete row when the table has a primary key. Export to CSV. Truncate table with optional “ignore foreign keys” for MySQL/MariaDB.
  • Foreign key links — Click a cell that references another table to jump to the referenced row.

Schema & structure

  • Schema browser — List tables (and collections for MongoDB) in a sidebar; click to load data or structure.
  • Table editor — Rename table, change collation (MySQL/MariaDB), engine, comment. Drop table (with confirmation).
  • Column editor — Add, edit, or drop columns. Driver-specific data types. For ENUM and SET (MySQL/MariaDB), a dedicated enum values editor (add/remove/list). For BOOLEAN/BIT, a default value dropdown (None / True / False). Optional collation and comment per column.
  • ER diagram — Visualize tables and relationships; export to JSON or PDF.

Database settings (per connection)

  • Database options — View and change default charset and collation (MySQL/MariaDB, PostgreSQL, SQL Server). Charsets and collations loaded from the server for dropdowns.
  • Users & privileges (MySQL/MariaDB) — List users with access to the current database; add user (username, host, password, privileges); drop user; grantable privileges include SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, and others.

Backup & restore

  • Backup — Download full database or single table as SQL (or JSON for MongoDB).
  • Restore — Upload a .sql file or paste SQL; execution feedback and error count.

Application features

  • Authentication — Laravel Breeze (login, register, email verification).
  • Subscriptions & billing — Optional plans with limits (e.g. max connections, max saved queries). Stripe-ready subscription flow, coupons, wallet, and vouchers.
  • Admin panel — User management, subscriptions, coupons, wallets, vouchers (for SaaS use).
  • Localization — English and Arabic (UI and RTL support).
  • Theme — Light/dark mode with system preference detection.

Tech stack

Layer Technology
Backend PHP 8.2+, Laravel 12, Inertia.js (server)
Frontend Vue 3, Inertia.js (client), Vite 7
Styling Tailwind CSS 3
Database (app) SQLite / MySQL / PostgreSQL (Laravel DB)
External OpenAI API (optional, for AI query generator), MongoDB PHP driver
Desktop (optional) Electron app in electron-app/

Requirements

  • PHP ≥ 8.2 with extensions: pdo, mbstring, openssl, tokenizer, xml, ctype, json, bcmath, fileinfo
  • For MySQL/MariaDB: pdo_mysql
  • For PostgreSQL: pdo_pgsql
  • For SQL Server: pdo_sqlsrv (and driver)
  • For MongoDB: mongodb (PHP extension)
  • Node.js ≥ 18 (for frontend build)
  • Composer and npm (or pnpm/yarn)

Installation

1. Clone and install PHP dependencies

git clone <repository-url> db-manager
cd db-manager
composer install

2. Environment and app key

cp .env.example .env
php artisan key:generate

3. Configure environment

Edit .env:

  • Application

    • APP_NAME, APP_URL, APP_DEBUG as needed.
  • Application database (Laravel’s own DB: auth, sessions, subscriptions, etc.)

    • Default: SQLite.
    • Or set DB_CONNECTION=mysql (or pgsql) and set DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD.
  • Sessions / cache / queue

    • Defaults use database; ensure migrations are run (step 4).
  • OpenAI (optional)

    • For the AI query generator: set OPENAI_API_KEY=sk-....

4. Migrate and seed (optional)

php artisan migrate
php artisan db:seed   # optional: plans, admin user, etc.

5. Frontend

npm install
npm run build

For development with hot reload:

npm run dev

6. Run the app

php artisan serve

Open http://localhost:8000 (or the URL shown). Register or log in, then use Connections to add a saved or local connection and start managing databases.


Configuration summary

Variable Purpose
APP_NAME Application name
APP_URL Base URL (e.g. http://localhost:8000)
DB_* Laravel app database (not the DBs you manage)
SESSION_DRIVER database or file
OPENAI_API_KEY Optional; for AI query generator

User-managed database connections (MySQL, PostgreSQL, etc.) are stored in the app DB and/or in the browser (local connections); they are not configured in .env.


Project structure (high level)

app/
  Http/Controllers/
    DatabaseConnectionController.php   # CRUD for saved connections
    DatabaseQueryController.php       # Query, schema, data, backup, DB options, users
    LocalConnectionController.php     # Same operations for local (connection in body)
  Models/
    DatabaseConnection.php            # Connection config + all DB operations (schema, query, backup, users, etc.)
    Plan.php, Subscription.php, User.php, SavedQuery.php, ...
resources/
  js/
    Pages/Connections/
      Show.vue        # Main connection view: Query, Data, Structure, ER, Settings
      Index.vue       # List connections (saved or local)
      Create.vue, Edit.vue, LocalEdit.vue
    composables/
      useConnectionApi.js   # API helpers for query, schema, table, columns, backup, DB options, users
  lang/   (or lang/)       # en.php, ar.php
routes/
  web.php             # Auth, dashboard, connections, local connections, admin, billing

The query builder, schema editor, database settings, and user/privilege features are implemented in Show.vue and the controllers above; identifier quoting and driver differences are handled in DatabaseConnection.php and in the Vue query builder.


Usage overview

  1. Connections

    • Saved: Create a connection (name, driver, host, port, database, user, password). Open it to reach the main view (Query / Data / Structure / ER / Settings).
    • Local: Add a connection in the UI (stored in browser). Open “Local” to use it the same way without saving to the server.
  2. Query

    • Write SQL in the editor and run (Ctrl+Enter). Or open the Query builder, pick table(s), add JOINs, columns, WHERE, ORDER BY, LIMIT, then “Insert SQL” or “Run”. Use AI query generator if configured.
  3. Data

    • Select a table in the schema; view and edit rows (if PK exists), add row, delete row, export CSV, truncate.
  4. Structure

    • Table options (rename, collation, engine, comment), add/edit/drop columns (with ENUM/SET and boolean editors), drop table.
  5. Settings

    • Database charset/collation; MySQL/MariaDB users and privileges.
  6. Backup / Restore

    • Backup from the connection header; restore via the dedicated modal (upload or paste SQL).

License

This project is open-sourced under the MIT License.


Author

Mohamed Ashaibi
https://ashaibi.com

About

CoreNode: web database manager for MySQL, MariaDB, PostgreSQL, SQL Server, SQLite and MongoDB, with SQL editor, visual query builder and schema editor. Laravel + Vue 3.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages