A desktop application for querying Couchbase databases built with Electron, React, and TypeScript.
Couchbase Studio is a simple yet powerful desktop application that allows you to connect to and query Couchbase databases. Built with modern web technologies and packaged as a desktop application using Electron, it provides a user-friendly interface for database management and query execution.
- Database Connection: Connect to Couchbase servers with custom credentials
- Query Execution: Execute multiple queries simultaneously with separate tabs
- JSON View: View query results in a formatted JSON viewer
- Configuration Management: Save and load connection configurations
- Cross-platform: Works on Windows, macOS, and Linux
- Frontend: React 18 with TypeScript
- UI Framework: Material-UI (MUI)
- Desktop Framework: Electron
- Database: Couchbase SDK
- Build Tool: Vite
- Package Manager: npm
- Node.js (Tested with v20.8.1)
- npm (comes with Node.js)
- A Couchbase server instance
-
Clone the repository
git clone <repository-url> cd couchbase-studio
-
Install dependencies
npm install
-
Set up configuration
Create a
configs.json
file in your Documents folder:- Windows:
%USERPROFILE%\Documents\CouchbaseStudio\configs.json
- macOS:
~/Documents/CouchbaseStudio/configs.json
- Linux:
~/Documents/CouchbaseStudio/configs.json
Use the provided
configs_example.json
as a template:{ "serverUrl": "server-url", "username": "your-username", "password": "your-password", "bucketName": "your-bucket", "scopeName": "your-scope" }
NOTE: serverUrl for capella server will be in the format of
https://cb.xxxx.cloud.couchbase.com:18093
and for self hosted one it will in the format ofhttp://xxx:8093
- Windows:
-
Start the development server
npm run dev
This will start both the Vite development server and the Electron application.
- Connect to Database: Use the connection form to enter your Couchbase server details
- Execute Queries: Use the query tabs to write and execute N1QL queries
- View Results: Query results will be displayed in a formatted JSON viewer
For testing the application in development mode:
npm run dev
To create a distributable application:
-
Build the application
npm run build
This command will:
- Compile TypeScript files
- Build the React application with Vite
- Package the application with Electron Builder
-
Find the built application
The built application will be available in the
dist
folder:- Windows:
release/Couchbase Studio Setup.exe
- macOS:
release/Couchbase Studio.dmg
- Linux:
release/Couchbase Studio.AppImage
- Windows:
The build process is configured in electron-builder.json5
and uses the following scripts from package.json
:
dev
: Starts the development serverbuild
: Compiles TypeScript, builds the React app, and packages with Electron Builderpreview
: Previews the built applicationlint
: Runs ESLint for code quality checks
couchbase-studio/
├── electron/ # Electron main process
│ ├── main.ts # Main process entry point
│ ├── preload.ts # Preload script
│ └── services/ # Backend services
│ └── CouchbaseConnector.ts
├── src/ # React application
│ ├── components/ # React components
│ ├── App.tsx # Main React component
│ └── main.tsx # React entry point
├── public/ # Static assets
├── package.json # Project configuration
├── electron-builder.json5 # Electron Builder configuration
└── vite.config.ts # Vite configuration
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run lint
- Run ESLint
This project is licensed under the MIT License - see the LICENSE file for details.
- Developer: Lasitha Bandara
- Email: lybandara@gmail.com