Overview
Zequel is an Electron application built with Vue 3, TypeScript, and Tailwind CSS. The codebase is organized into three main process types:- Main Process - Node.js backend (database connections, IPC handlers)
- Renderer Process - Vue 3 frontend (UI components, state management)
- Preload Scripts - Secure bridge between main and renderer
Directory Structure
Main Process (src/main/)
The main process runs in Node.js and handles database operations, file system access, and native APIs.
Key Files
src/main/index.ts
src/main/index.ts
Main process entry point. Handles:
- App lifecycle (ready, quit, window management)
- Browser window creation
- IPC handler registration
- Auto-updater initialization
- Connection cleanup on quit
src/main/db/manager.ts
src/main/db/manager.ts
Connection pool manager. Manages active database connections:
- Connect/disconnect with connection pooling
- Session ID-based connection tracking
- Automatic reconnection on connection loss
- Cleanup on window close
src/main/ipc/index.ts
src/main/ipc/index.ts
IPC handler registration. Registers all
ipcMain.handle() listeners that the renderer can invoke.Renderer Process (src/renderer/)
The renderer process is a Vue 3 single-page application with TypeScript and Tailwind CSS.
Key Patterns
Components
Components
PascalCase filenames,
<script setup lang="ts"> pattern:Stores (Pinia)
Stores (Pinia)
Composition API pattern with
useXxxStore naming:Composables
Composables
Reusable logic with
useXxx naming:Preload Scripts (src/preload/)
Preload scripts bridge the main and renderer processes using Electron’s contextBridge API.
src/preload/index.ts exposes a type-safe window.api object to the renderer:
window.api.connections.list(), etc.
Tests (src/tests/)
Tests mirror the source structure and are organized by type.
Import Aliases
Zequel uses path aliases to avoid relative imports:| Alias | Path | Used In |
|---|---|---|
@ | src/renderer | Renderer, unit tests |
@main | src/main | Main, preload, all tests |
@e2e | src/tests/e2e | E2E tests |
File Naming Conventions
| Type | Convention | Example |
|---|---|---|
| Components | PascalCase | ConnectionDialog.vue |
| Composables | camelCase, use prefix | useQuery.ts |
| Stores | camelCase, use prefix + Store suffix | useConnectionsStore.ts |
| Constants | UPPER_SNAKE_CASE | MAX_CONNECTIONS |
| Enums | PascalCase | DatabaseType, QueryStatus |
Build Configuration
Key configuration files:- electron.vite.config.ts - Electron Vite build configuration
- tsconfig.json - Base TypeScript config
- tsconfig.node.json - Main process TypeScript config
- tsconfig.web.json - Renderer process TypeScript config
- tsconfig.e2e.json - E2E test TypeScript config
- vitest.config.ts - Vitest test configuration
- playwright.config.ts - Playwright E2E configuration
- package.json - Dependencies and scripts
Next Steps
Architecture
Understand the Electron architecture
Testing
Write and run tests
Database Adapters
Learn how database drivers work