Skip to content

husamql3/db-studio

Repository files navigation

DB Studio logo
A modern, universal (pgAdmin alternative) database management studio for any database.


DB Studio screenshot

Tech Stack

  • Frontend: React 19, TanStack React Router, TanStack React Query, TanStack React Table, TanStack React Virtual, shadcn/ui, sonner, react-day-picker, react-hook-form, zustand
  • Backend: Hono with Node, zod-validator, zod
  • Tooling: Bun, Vite, TypeScript, Biome, Vitest, Wrangler (Cloudflare)

Quick Start with npx

No installation required. Just run:

npx db-studio

This runs the latest published version and uses the current directory as the project context. DB Studio looks for a .env file in the current working directory and, if not found, searches parent directories until one is found. It reads DATABASE_URL from that file (or use --var-name <name> for a different variable). If DATABASE_URL is not in the .env file, it is also read from process.env (e.g. when set in the shell or in a package.json script). To point to a specific env file, use --env <path> (e.g. npx db-studio --env .env.local).

Recommended base script (add to package.json)

You can run db-studio from npm/bun scripts. Useful when you want a dedicated script, a different env file, or to pass the connection via the environment:

{
  "scripts": {
    "db:studio": "npx db-studio"
  }
}

Now you can simply run:

npm run db:studio

Customize with flags

Modify the run command (or override in your script) using any of these flags:

Flag Description Example command / override
--env <path> Use a specific .env file npx db-studio --env .env.local
or --env .env.production
--var-name <name> Use a different environment variable name npx db-studio --var-name MY_DB_URL
--port <number> Change the server port (default: 3333) npx db-studio --port 4000
--database-url <url> Provide connection string directly (no .env) npx db-studio --database-url "postgresql://user:pass@localhost:5432/mydb"
--status Only check & show connection status (no UI) npx db-studio --status
--help Show all available options npx db-studio --help

Examples of combined / overridden usage

# Local dev with custom env file
npm run db:studio -- --env .env.local

# Production with custom port
bun run db:studio -- --env .env.production --port 4444

# Direct connection (great for one-off or CI)
npx db-studio --database-url "postgresql://user:pass@host:5432/prod"

# Custom variable name + env file
npm run db:studio -- --env .env.staging --var-name STAGING_DB_URL

# Just verify connection
npm run db:studio -- --status

Tip: When passing flags through npm run or bun run, use -- to separate script args from command flags (as shown above).

For full documentation and more examples: dbstudio.sh

Development Setup

Using the CLI (installed or npx): Run npx db-studio from a directory that contains your .env (or from a subfolder; DB Studio will search upward for .env). Alternatively use --env <path> to specify the env file.

Developing from source:

# Install dependencies (root and workspaces)
bun install

# Initialize the database with required tables and schema
bun run init-db

# Configure your PostgreSQL connection in packages/server/.env (for local dev)
# DATABASE_URL=postgres://user:password@localhost:5432/database

# Start development services through Portless
bun run dev

At your first contribution, you should add your name and email to the AUTHORS file

your-name <your-email>

Development services run through Portless with stable local HTTPS URLs instead of fixed port numbers:

Service URL
Web app https://web.dbstudio.localhost
API server https://api.dbstudio.localhost
AI proxy https://proxy.dbstudio.localhost
Docs/marketing site https://www.dbstudio.localhost

On first run, Portless may ask to trust its local certificate authority. You can also run:

bunx portless trust

Note

Production-style local serving runs through https://db-studio.localhost via the server package start script.

Roadmap

For the latest features, planned updates, and development progress, see the full roadmap here:

📍 roadmap

Contributions that align with roadmap priorities are especially welcome!

Changelog

See what's new, fixed, or improved in each release:

📜 Changelog

Contributing

Extremely welcome! This is early-stage — PRs for new drivers, bug fixes, or even a better logo will be merged lightning-fast. Check out CONTRIBUTING.md and the open issues.

License

LICENSE

About

The modern pgAdmin alternative that works with every database.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors