diff --git a/README.md b/README.md index 5ddfeac..317152d 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,19 @@ ![Nebula Logo](assets/images/Logos/Nebula-Logo.svg) -A customizable and privacy-focused web browser built with Electron. +A customizable and privacy-focused web browser built with Electron. Nebula is designed to be a lightweight, secure, and user-friendly browser with a focus on performance and privacy. ## Features * **Privacy Control:** Easily clear your browsing data, including history, cookies, and cache. * **Tab Management:** Open new tabs, and manage them efficiently. * **Bookmarks:** Save your favorite sites. +* **History:** Keeps track of your browsing and search history. +* **Performance Monitoring:** Built-in tools to monitor application performance. +* **GPU Acceleration Control:** Advanced settings to manage GPU acceleration and troubleshoot rendering issues. +* **Cross-Platform:** Runs on Windows, macOS, and Linux. - +[**Learn more about Nebula's features.**](documentation/FEATURES.md) ## Getting Started @@ -28,9 +32,9 @@ A customizable and privacy-focused web browser built with Electron. ```sh cd NebulaBrowser ``` -3. Install Electron: +3. Install dependencies: ```sh - npm install --save-dev electron@latest + npm install ``` ### Running the Application @@ -51,6 +55,30 @@ npm run dist This will create a distributable file in the `dist` directory. +## Project Structure + +An overview of the project's structure. For a more detailed explanation, please see the [Project Structure documentation](documentation/PROJECT_STRUCTURE.md). + +- `main.js`: The main entry point for the Electron application. +- `renderer/`: Contains all the front-end files. +- `preload.js`: Bridges the main and renderer processes. +- `performance-monitor.js`: Module for monitoring performance. +- `gpu-config.js` & `gpu-fallback.js`: Modules for managing GPU settings. +- `assets/`: Contains static assets. +- `documentation/`: Contains additional documentation. + +## Core Concepts + +Nebula is built on several core concepts that are essential to understanding how it works. For a deeper dive, read the [Core Concepts documentation](documentation/CORE_CONCEPTS.md). + +- **Main and Renderer Processes** +- **Inter-Process Communication (IPC)** +- **Performance and GPU Management** + +## Contributing + +Contributions are welcome! Please read our [contributing guidelines](documentation/CONTRIBUTING.md) to get started. + ## Technologies Used * [Electron](https://www.electronjs.org/) @@ -64,4 +92,8 @@ This project is licensed under the MIT License. [Read More](documentation/MIT.md ## Documentation * [MIT Licese](documentation/MIT.md) -* [GPU Fix](documentation/GPU-FIX-README.md) \ No newline at end of file +* [GPU Fix](documentation/GPU-FIX-README.md) +* [Features](documentation/FEATURES.md) +* [Project Structure](documentation/PROJECT_STRUCTURE.md) +* [Core Concepts](documentation/CORE_CONCEPTS.md) +* [Contributing Guide](documentation/CONTRIBUTING.md) diff --git a/documentation/CODE_OF_CONDUCT.md b/documentation/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..b976c63 --- /dev/null +++ b/documentation/CODE_OF_CONDUCT.md @@ -0,0 +1,119 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that are compassionate, direct, and respectful. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards and +will take appropriate and fair corrective action in response to any behavior that +they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interaction in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html diff --git a/documentation/CONTRIBUTING.md b/documentation/CONTRIBUTING.md new file mode 100644 index 0000000..f11c257 --- /dev/null +++ b/documentation/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# Contributing to Nebula + +First off, thank you for considering contributing to Nebula! It's people like you that make open source such a great community. + +## How Can I Contribute? + +### Reporting Bugs + +- Ensure the bug was not already reported by searching on GitHub under [Issues](https://github.com/Bobbybear007/NebulaBrowser/issues). +- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/Bobbybear007/NebulaBrowser/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. + +### Suggesting Enhancements + +- Open a new issue to discuss your enhancement. Please provide a clear description of the enhancement and its potential benefits. + +### Pull Requests + +1. **Fork the repository** to your own GitHub account. +2. **Clone the project** to your machine. +3. **Create a new branch** for your changes: + ```sh + git checkout -b feature/your-feature-name + ``` +4. **Make your changes** and commit them with a clear, descriptive commit message: + ```sh + git commit -m "Add some feature" + ``` +5. **Push your branch** to your fork: + ```sh + git push origin feature/your-feature-name + ``` +6. **Open a pull request** to the `main` branch of the original repository. Provide a clear title and description for your pull request, explaining the changes you've made. + +## Styleguides + +### Git Commit Messages + +- Use the present tense ("Add feature" not "Added feature"). +- Use the imperative mood ("Move cursor to..." not "Moves cursor to..."). +- Limit the first line to 72 characters or less. +- Reference issues and pull requests liberally after the first line. + +### Code of Conduct + +We have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors are expected to follow. Please make sure you are familiar with its contents. + +### JavaScript Styleguide + +- All JavaScript must adhere to [StandardJS](https://standardjs.com/). This helps us maintain a consistent coding style. +- Use soft-tabs with a two-space indent. +- Prefer single quotes `'` over double quotes `"`. +- No semicolons. +- For more details, please refer to the [StandardJS rules](https://standardjs.com/rules.html). + +### CSS Styleguide + +- Follow a BEM-like naming convention for classes (`block__element--modifier`). +- Use soft-tabs with a two-space indent. +- Write selectors and their properties on separate lines. +- Organize properties logically (e.g., positioning, box model, typography, visual). +- Use `rem` for font sizes and `px` for borders. +- Use `===` and `!==` instead of `==` and `!=` for comparisons. +- Always declare variables with `const` or `let` instead of `var`. +- Use arrow functions instead of `function` where appropriate. +- Prefer template literals over string concatenation. diff --git a/documentation/CORE_CONCEPTS.md b/documentation/CORE_CONCEPTS.md new file mode 100644 index 0000000..dae843a --- /dev/null +++ b/documentation/CORE_CONCEPTS.md @@ -0,0 +1,25 @@ +# Core Concepts + +This document explains the core architectural concepts of the Nebula browser. + +### Main and Renderer Processes + +Electron applications have two types of processes: the **main process** and one or more **renderer processes**. + +- **Main Process**: The main process, which runs the `main.js` script, is the entry point of the application. It runs in a Node.js environment, meaning it has access to all Node.js APIs like `fs` for file system access and `ipcMain` for communication. It is responsible for creating and managing `BrowserWindow` instances, which are the application's windows. + +- **Renderer Process**: Each `BrowserWindow` runs its own renderer process. The renderer process is responsible for rendering web content—in Nebula's case, the browser's user interface (UI) built with HTML, CSS, and JavaScript. The renderer process does not have direct access to Node.js APIs for security reasons. + +### Inter-Process Communication (IPC) + +Since the main and renderer processes are separate, they need a way to communicate. This is done through Inter-Process Communication (IPC). + +- **`ipcMain` and `ipcRenderer`**: Electron provides the `ipcMain` and `ipcRenderer` modules for this purpose. The main process can listen for messages from the renderer process using `ipcMain.handle`, and the renderer process can send messages using `ipcRenderer.invoke`. + +- **Context Bridge and Preload Script**: To securely expose APIs from the main process to the renderer process, Electron uses a **preload script** and the **context bridge**. The `preload.js` script runs in a special environment that has access to both the `window` object of the renderer process and Node.js APIs. The `contextBridge` is used to expose specific functions from the preload script to the renderer process, ensuring that the renderer process cannot access powerful Node.js APIs directly. + +### Performance and GPU Management + +- **Performance Monitoring**: The `performance-monitor.js` module helps track the application's performance by monitoring metrics like memory usage and page load times. This is essential for identifying and addressing performance bottlenecks. + +- **GPU Configuration**: The `gpu-config.js` and `gpu-fallback.js` modules manage GPU acceleration. Electron uses the system's GPU to render content, which can significantly improve performance. However, GPU drivers can sometimes be a source of instability. These modules allow Nebula to check the GPU status and apply fallbacks (like disabling hardware acceleration) if issues are detected, ensuring a more stable experience. diff --git a/documentation/FEATURES.md b/documentation/FEATURES.md new file mode 100644 index 0000000..dbf511a --- /dev/null +++ b/documentation/FEATURES.md @@ -0,0 +1,53 @@ +# Features + +This document provides a detailed overview of the features available in Nebula. + +### Privacy Control + +Nebula is designed with your privacy in mind. You have granular control over your browsing data. + +- **Clear Browsing Data:** You can easily clear your browsing history, cookies, cache, and local storage. This can be done from the settings page. +- **No Tracking by Default:** Nebula does not collect any personal data for tracking or advertising purposes. + +### Tab Management + +Efficiently manage your browsing session with Nebula's tab management features. + +- **New Tabs:** Open new tabs to browse multiple websites at once. +- **Tab Controls:** Each tab has standard controls for closing. +- **Open in New Window:** You can pop a tab out into its own separate window. + +### Bookmarks + +Save and access your favorite websites with ease. + +- **Add Bookmarks:** Save the current page to your bookmarks. +- **View Bookmarks:** Access your saved bookmarks from the bookmarks bar or a dedicated page. + +### History + +Nebula keeps a record of your browsing and search history to help you find your way back to previously visited sites. + +- **Site History:** A list of all the websites you have visited. +- **Search History:** A list of all the searches you have made. +- **Clear History:** You can clear your history at any time from the settings page. + +### Performance Monitoring + +Nebula includes built-in tools to help you monitor the browser's performance. + +- **Performance Report:** View a detailed report of performance metrics, including page load times and memory usage. +- **Force Garbage Collection:** Manually trigger garbage collection to free up memory. + +### GPU Acceleration Control + +For advanced users, Nebula provides tools to manage GPU acceleration. + +- **GPU Diagnostics:** View detailed information about your system's GPU and its status. +- **GPU Fallback:** If you experience rendering issues, you can apply a GPU fallback to use a more stable rendering path. This can help resolve visual glitches or crashes. + +### Cross-Platform + +Nebula is built with Electron, allowing it to run on multiple operating systems. + +- **Windows, macOS, and Linux:** Enjoy a consistent browsing experience across different platforms. diff --git a/documentation/PROJECT_STRUCTURE.md b/documentation/PROJECT_STRUCTURE.md new file mode 100644 index 0000000..35a80df --- /dev/null +++ b/documentation/PROJECT_STRUCTURE.md @@ -0,0 +1,36 @@ +# Project Structure + +This document provides an in-depth look at the project's file and directory structure. + +- **`main.js`**: This is the heart of the Electron application. It's the main process script that controls the application's lifecycle, creates browser windows, and handles all interactions with the operating system. + +- **`renderer/`**: This directory contains all the client-side code and assets for the browser's user interface (the renderer process). + - **`index.html`**: The main HTML file that serves as the container for the browser's UI, including the tab bar, address bar, and the webview for displaying web content. + - **`style.css`**: The primary stylesheet for the entire browser interface. + - **`script.js`**: The main JavaScript file for the renderer process. It handles all the user interactions within the browser window, such as creating new tabs, handling navigation, and communicating with the main process. + - **`home.html`**, **`home.css`**, **`home.js`**: These files define the content and behavior of the default home page (new tab page). + - **`settings.html`**, **`settings.css`**, **`settings.js`**: These files create the settings page, allowing users to configure the browser and manage their data. + - **`404.html`**, **`404.css`**: Files for the "page not found" error page. + - **`gpu-diagnostics.html`**: The page for displaying GPU information. + - **`performance.css`**: Styles for the performance monitoring page. + - **`icons.js`**, **`icons.json`**: Files related to managing icons within the UI. + +- **`preload.js`**: This script is a crucial part of Electron's security model. It runs in a privileged context before the renderer process's web page is loaded. It's used to selectively expose APIs from the main process to the renderer process via the `contextBridge`. + +- **`performance-monitor.js`**: A Node.js module that runs in the main process to track application performance metrics like memory usage and page load times. + +- **`gpu-config.js`** & **`gpu-fallback.js`**: These modules are responsible for managing GPU-related settings. `gpu-config.js` checks the system's GPU capabilities, and `gpu-fallback.js` provides mechanisms to disable or reduce GPU acceleration if problems are detected. + +- **`assets/`**: This directory holds all static assets. + - **`images/`**: Contains logos, icons, and other images used in the application. + - **`fonts/`**: Contains font files. + +- **`documentation/`**: Contains all supplementary documentation for the project. + +- **`*.json`**: Configuration and data files. + - **`package.json`**: Defines the project's metadata, dependencies, and scripts. + - **`bookmarks.json`**: Stores the user's bookmarks. + - **`site-history.json`**: Stores the user's browsing history. + - **`search-history.json`**: Stores the user's search history. + +- **`start-gpu-safe.bat`**: A batch script for Windows users to start the application in a GPU-safe mode.