Skip to content

Latest commit

Β 

History

History
80 lines (64 loc) Β· 3.22 KB

File metadata and controls

80 lines (64 loc) Β· 3.22 KB

πŸ› οΈ Development & Setup Guide

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.

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: v18.x or higher
  • NPM: v9.x or higher
  • Git

πŸš€ Local Setup

  1. Clone the repository:

    git clone https://github.com/your-username/Sonar-Code-Editor.git
    cd Sonar-Code-Editor
  2. Install dependencies:

    npm install
  3. Configure Environment Variables:

    • Create a .env file in the root directory.
    • Configure your Appwrite endpoint, project ID, and other required keys required for authentication and real-time database syncing.

πŸ’» Running in Development

To start the application with hot-reloading for both the Vite React renderer and the Electron wrapper:

npm run start

This utilizes concurrently to run the Vite dev server, TypeScript compiler for the main process, and the Electron executable simultaneously.

πŸ“‚ Project Structure

β”œβ”€β”€ 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

πŸ“¦ Building & Packaging

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.