Welcome to the development guide for Sonar Code Editor. This document covers how to set up your local development environment, build the application, and package it for distribution.
Before you begin, ensure you have the following installed:
- Node.js:
v18.xor higher - NPM:
v9.xor higher - Git
-
Clone the repository:
git clone https://github.com/your-username/Sonar-Code-Editor.git cd Sonar-Code-Editor -
Install dependencies:
npm install
-
Configure Environment Variables:
- Create a
.envfile in the root directory. - Configure your Appwrite endpoint, project ID, and other required keys required for authentication and real-time database syncing.
- Create a
To start the application with hot-reloading for both the Vite React renderer and the Electron wrapper:
npm run startThis utilizes concurrently to run the Vite dev server, TypeScript compiler for the main process, and the Electron executable simultaneously.
βββ assets/ # App icons and static graphical assets
βββ build/ # Electron builder output rules and assets
βββ release/ # Compiled executable applications (generated)
βββ src/
β βββ main/ # Electron main process source
β β βββ main.ts # App lifecycle & window management
β β βββ ipcHandlers.ts # Secure IPC communication handlers
β β βββ monitoring.ts # System monitoring & activity tracking
β β βββ ...
β βββ preload/ # Electron context bridge scripts
β β βββ preload.ts
β βββ renderer/ # React frontend source
β β βββ components/ # Reusable UI (Editor, Sidebar, FileTree, AdminPanel)
β β βββ context/ # React Contexts (Auth, Collaboration)
β β βββ hooks/ # Custom Hooks (Network status, Activity)
β β βββ pages/ # Main Views (IDE, Login, Admin Dashboard)
β β βββ services/ # Appwrite, localStore, PDF reporting
β β βββ styles/ # Global CSS definitions
β β βββ types/ # TypeScript declaration files
β β βββ App.tsx
β βββ shared/ # Shared types and constants (main β renderer)
βββ appwrite.config.json # Appwrite Collection schema definitions
βββ package.json # Dependencies & scripts
βββ vite.renderer.config.ts # Vite configuration for the renderer UI
To compile the application for production and package it into distributable executables:
# 1. Build the React renderer, Main process, and Preload scripts
npm run build
# 2. Package for your specific OS
npm run package:win # For Windows (.exe)
npm run package:mac # For macOS (.dmg, .app)
npm run package:linux # For Linux (.AppImage)Compiled artifacts will be located in the release/ directory.