Skip to the content.

Developer Documentation

Welcome to the Enveil developer documentation. This section provides comprehensive technical information for developers who want to understand, modify, or contribute to Enveil.

Overview

Enveil is built with modern web technologies and follows best practices for browser extension development:

Documentation Sections

πŸ—οΈ Architecture

πŸ“š API Reference

βš™οΈ Development Setup

🀝 Contributing Guide

Quick Start for Developers

Prerequisites

# Required
Node.js 18+
Bun (recommended) or npm/yarn

# Optional but recommended
Git
Chrome/Chromium browser
VS Code with TypeScript extension

Development Setup

# Clone repository
git clone https://github.com/formaxcn/enveil.git
cd enveil

# Install dependencies
bun install

# Start development server
bun run dev

# Build for production
bun run build

Project Structure

enveil/
β”œβ”€β”€ components/              # Reusable UI components
β”‚   β”œβ”€β”€ AddSiteModal.tsx    # Site configuration modal
β”‚   β”œβ”€β”€ CloudHighlighter.ts # Cloud highlighting logic
β”‚   └── Switch.tsx          # Toggle switch component
β”œβ”€β”€ entrypoints/            # Browser extension entry points
β”‚   β”œβ”€β”€ background.ts       # Service worker
β”‚   β”œβ”€β”€ content.ts          # Content script
β”‚   β”œβ”€β”€ options/           # Options page
β”‚   └── popup/             # Extension popup
β”œβ”€β”€ utils/                  # Utility functions
β”‚   β”œβ”€β”€ matcher.ts         # URL matching logic
β”‚   β”œβ”€β”€ cloudMatcher.ts    # Cloud-specific matching
β”‚   └── cloudTemplates.ts  # Cloud provider templates
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ public/                 # Static assets
└── wxt.config.ts          # WXT configuration

Key Technologies

WXT Framework

TypeScript

React + Tailwind CSS

Browser Extension APIs

Development Workflow

1. Local Development

# Start development server with hot reload
bun run dev

# The extension will be built to .output/chrome-mv3
# Load this directory as an unpacked extension in Chrome

2. Code Changes

3. Testing

# Type checking
bun run compile

# Build production version
bun run build

# Create distribution package
bun run zip

4. Debugging

Architecture Highlights

Component Communication

Background Script ←→ Content Script ←→ Options Page
       ↓                    ↓              ↓
   Tab Events         UI Injection    Configuration
   URL Matching       Visual Updates   User Interface
   Icon Updates       Shadow DOM       Settings Management

Data Flow

User Configuration β†’ Storage API β†’ Background Script β†’ Content Script β†’ Visual Indicators
                                      ↓
                                 Tab Events β†’ URL Matching β†’ Icon Updates

Security Model

Contributing

We welcome contributions from the community! Here’s how you can help:

Types of Contributions

Getting Started

  1. Fork the repository on GitHub
  2. Create a feature branch from main
  3. Make your changes following our coding standards
  4. Test thoroughly with bun run compile and manual testing
  5. Submit a pull request with clear description

Code Standards

Resources

External Documentation

Community


Ready to contribute? Start with the Development Setup guide or check out our Contributing Guide.