Architecture
Architecture
ZepraBrowser - Complete Architecture
Integration with Existing Project Structure
Current Project Location
~/Documents/zeprabrowser/šÆ Architecture Overview
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ZepraBrowser Application ā
ā ā
ā āāāāāāāāāāāāāā āāāāāāāāāāāāāā āāāāāāāāāāāāāā āāāāāāāāāāāā ā
ā ā Tabs/UI ā ā DevTools ā ā Extensions ā ā Settings ā ā
ā ā Manager ā ā Native UI ā ā Manager ā ā Panel ā ā
ā āāāāāāā¬āāāāāāā āāāāāāā¬āāāāāāā āāāāāāā¬āāāāāāā āāāāāā¬āāāāāā ā
ā ā ā ā ā ā
āāāāāāāāāā¼āāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāā¼āāāāāāāāā
ā ā ā ā
āāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāā
ā Browser Engine (Zepra) ā
ā ⢠Rendering Engine ā
ā ⢠JavaScript Engine (ZebraScript) ā
ā ⢠Networking Stack ā
ā ⢠Storage/Cache ā
āāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāā
ā Platform Layer ā
ā ⢠OS Integration ā
ā ⢠GPU Acceleration ā
ā ⢠Process Sandboxing ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāš Integrated Project Structure
zeprabrowser/
āāā CMakeLists.txt # ROOT BUILD
āāā Architecture.md # Architecture docs
āāā README.md
ā
āāā source/ # === NEW ARCHITECTURE ===
ā ā
ā āāā ThirdParty/ # External dependencies
ā āāā aiEngine/ # AI integration & LLM APIs
ā āāā bin/ # Built executables
ā āāā devtools/ # Developer tools, debugger GUI
ā āāā extensions/ # Extension system & sandbox
ā āāā integration/ # Service integrations
ā āāā main.cpp # Application Entry
ā āāā media/ # Audio/Video processing
ā āāā networking/ # Network stack, sockets
ā āāā nxbase/ # NeolyxOS Base components
ā āāā nxcrypto/ # Cryptography, TLS/SSL
ā āāā nxhttp/ # HTTP/HTTP2 parser & client
ā āāā nxjson/ # JSON parsing & generation
ā āāā nxrender-cpp/ # Core rendering logic (C++)
ā āāā nxsvg_wrapper.cpp # SVG Rendering Support
ā āāā nxxml/ # XML/DOM parsing
ā āāā platform/ # Cross-platform abstractions
ā āāā privacy/ # Privacy & tracking protection
ā āāā sandbox/ # IPC sandboxing model
ā āāā storage/ # LocalStorage, IndexedDB, Cache
ā āāā webCore/ # Core layout and rendering
ā āāā webGpu/ # WebGL & WebGPU implementation
ā āāā webapp/ # Progressive Web PWA
ā āāā zepraEngine/ # Browser shell & core UI
ā āāā zepraScript/ # ā ļø JavaScript Engine Core
ā
āāā config/ # Configuration files
āāā docs/ # Documentation
āāā tools/ # Dev tools
āāā zepra.ketivee.com/ # Branding assetsšļø Component Architecture
1. Browser Core Stack
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Application Layer ā
ā ⢠Tab Management ā
ā ⢠Window Management ā
ā ⢠User Interface ā
ā ⢠Settings & Preferences ā
āāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā
ā Browser Engine Layer ā
ā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāā ā
ā ā Rendering ā ā JavaScript ā ā
ā ā Engine āāā⤠Engine ā ā
ā ā (WebCore) ā ā (ZebraScript) ā ā
ā āāāāāāāā¬āāāāāāāā āāāāāāāāāāāāāāāāāā ā
ā ā ā
ā āāāāāāāā¼āāāāāāāā āāāāāāāāāāāāāāāāāā ā
ā ā Layout ā ā Networking ā ā
ā ā Engine ā ā Stack ā ā
ā āāāāāāāā¬āāāāāāāā āāāāāāāāāāāāāāāāāā ā
ā ā ā
ā āāāāāāāā¼āāāāāāāā āāāāāāāāāāāāāāāāāā ā
ā ā Paint ā ā Storage ā ā
ā ā & Graphics ā ā System ā ā
ā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā
ā Platform Layer ā
ā ⢠OS Integration ā
ā ⢠GPU Acceleration (WebGPU) ā
ā ⢠Process Sandboxing ā
ā ⢠IPC (Inter-Process Communication) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā2. Page Loading Pipeline
User Types URL
ā
Navigation Controller
ā
DNS Resolution
ā
HTTP Request ā HTTP Response
ā
HTML Parser ā DOM Tree
ā
CSS Parser ā CSSOM Tree
ā
JavaScript Execution (ZebraScript)
ā
DOM + CSSOM ā Render Tree
ā
Layout Engine ā Layout Tree
ā
Paint Engine ā Display List
ā
Compositing ā GPU Layers
ā
Screen Display3. Multi-Process Architecture
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Browser Process ā
ā ⢠Main UI ā
ā ⢠Tab Management ā
ā ⢠Network Service ā
ā ⢠Storage Service ā
āāāāā¬āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāā
ā ā ā
ā IPC ā IPC ā IPC
ā ā ā
āāāāā¼āāāāāāāāāāā āāāāā¼āāāāāāāāāāā āāāā¼āāāāāāāāāāāāāāā
ā Renderer ā ā Renderer ā ā GPU Process ā
ā Process 1 ā ā Process 2 ā ā ā
ā (Tab 1) ā ā (Tab 2) ā ā ⢠Compositing ā
ā ā ā ā ā ⢠Rendering ā
ā ⢠WebCore ā ā ⢠WebCore ā ā ⢠3D Graphics ā
ā ⢠JS Engine ā ā ⢠JS Engine ā ā ā
āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāš Integration Points
ZebraScript ā WebCore Integration
cpp
// source/webCore/src/dom/document.cpp
#include "zeprascript/runtime/vm.hpp"
#include "zeprascript/browser/window.hpp"
namespace WebCore {
class Document {
private:
// JavaScript VM instance
std::unique_ptr<Zepra::Runtime::VM> js_vm_;
public:
void initializeJavaScript() {
js_vm_ = Zepra::Runtime::VM::create();
// Expose DOM to JavaScript
auto* window = js_vm_->getGlobalObject();
window->setProperty("document", this);
}
void executeScript(const std::string& code) {
js_vm_->execute(code);
}
};
} // namespace WebCoreWebCore ā Platform Integration
cpp
// source/platform/include/platform/window_system.hpp
namespace Platform {
class WindowSystem {
public:
virtual void createWindow() = 0;
virtual void destroyWindow() = 0;
virtual void setTitle(const std::string& title) = 0;
virtual void resize(int width, int height) = 0;
};
// Platform-specific implementations
#ifdef _WIN32
class WindowSystemWin : public WindowSystem { /* ... */ };
#elif defined(__linux__)
class WindowSystemLinux : public WindowSystem { /* ... */ };
#elif defined(__APPLE__)
class WindowSystemMacOS : public WindowSystem { /* ... */ };
#endif
} // namespace Platformš Root CMakeLists.txt Integration
cmake
cmake_minimum_required(VERSION 3.20)
project(ZepraBrowser VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Options
option(ZEPRA_BUILD_TESTS "Build tests" ON)
option(ZEPRA_BUILD_DEVTOOLS "Build DevTools" ON)
option(ZEPRA_ENABLE_GPU "Enable GPU acceleration" ON)
option(ZEPRA_ENABLE_EXTENSIONS "Enable extension support" ON)
# Browser Components (in source/)
add_subdirectory(source/zepraScript) # JavaScript Engine
add_subdirectory(source/webCore) # Rendering Engine
add_subdirectory(source/webGpu) # GPU Acceleration
add_subdirectory(source/zepraEngine) # Browser Window/UI
add_subdirectory(source/networking) # Network Stack
add_subdirectory(source/storage) # Storage System
add_subdirectory(source/platform) # Platform Layer
add_subdirectory(source/sandbox) # Sandboxing
add_subdirectory(source/extensions) # Extensions
add_subdirectory(source/media) # Media Support
add_subdirectory(source/devtools) # DevTools
# Legacy Components (in src/ and include/)
add_subdirectory(src/auth)
add_subdirectory(src/config)
add_subdirectory(src/search)
# Main Browser Application
add_executable(ZepraBrowser
src/main.cpp
src/core/zepra_core.cpp
src/ui/window.cpp
src/ui/tab_manager.cpp
# ... other sources
)
target_link_libraries(ZepraBrowser
PRIVATE
zepra-script # JavaScript Engine
web-core # Rendering Engine
zepra-engine # Browser Window
networking # HTTP/WebSocket
storage # LocalStorage/IndexedDB
platform # OS Integration
sandbox # Security
extensions # Extension System
media # Audio/Video
devtools # Developer Tools
)
# Tests
if(ZEPRA_BUILD_TESTS)
add_subdirectory(tests)
endif()š§ Build Instructions
Prerequisites
bash
# Ubuntu/Debian
sudo apt install cmake ninja-build libsdl2-dev libcurl4-openssl-dev \
libjson-c-dev libssl-dev libsqlite3-dev
# macOS
brew install cmake ninja sdl2 curl openssl sqliteBuild Commands
bash
# Configure
cmake -B build -G Ninja \
-DZEPRA_BUILD_TESTS=ON \
-DZEPRA_ENABLE_GPU=ON
# Build
cmake --build build -j$(nproc)
# Run
./build/bin/ZepraBrowserComponent-Only Builds
bash
# Build only ZepraScript
cmake --build build --target zepra-script
# Build only Browser Window Demo
cmake --build build --target zepra-browserš File Summary
Click on the component names below to view the detailed file tree, internal architecture, and API documentation for each subsystem.
| Component / Documentation | Location | Files | Status |
|---|---|---|---|
| ZepraScript | source/zepraScript/ | 1392 | ā Complete |
| WebCore | source/webCore/ | 10 | ā Implemented |
| ZepraEngine | source/zepraEngine/ | 31 | ā Implemented |
| Browser Headers | include/ | 30 | ā Complete |
| Browser Sources | src/ | 25 | ā Complete |
| Tests | test/zeprascript/ | 72 | ā Complete |
| TOTAL | ~1500 | ā |
š Current Status
ā Completed
- ZepraScript JavaScript Engine (full implementation)
- WebCore Rendering Engine (DOM, CSS, Layout)
- Browser Window Demo (NXRENDER native X11/OpenGL)
- DevTools Protocol (Chrome CDP)
- Authentication System (Ketivee SSO)
- Zepra Stack Libraries:
- NxBase - Buffer, string, memory utilities
- NxJSON - JSON parser/serializer
- NxHTTP - HTTP client (replaces libcurl)
- NxXML - XML/HTML parser
- NxCrypto - TLS/crypto abstraction
- ZepraWebView Developer Tools:
- Console tab with real ZepraScript logs
- Network tab with request monitoring
- Security tab with CORS/TLS info
- ConsoleLog, NetworkMonitor, SecurityChecker modules
š In Progress
- GPU Acceleration (WebGPU + NxGfx)
- NXRender widget integration
- HTML content rendering in viewport
- NXAudio browser integration
š Planned
- Service Workers
- WebRTC
- PWA Support
- Extensions System
- WebAssembly execution
š Notes
- DO NOT MODIFY
source/zepraScript/without careful consideration - Browser tests require ZepraScript to be built first
- Use
FILETREE.mdfor quick reference of all files - See
docs/for detailed API documentation - USE_ZEPRA_STACK=ON to build with custom libraries
- USE_NXRENDER=ON for native X11/OpenGL rendering
Last Updated: 2025-12-14
Version: 1.1.0
Maintainer: Swanaya