Skip to content

Repository files navigation

⚡ Env Diff

Env Diff is a modern, fast, and secure web application designed to compare, analyze, and merge two .env files or JSON configuration objects.

This application runs 100% locally in your browser. No data is sent to any server, keeping your credentials, access tokens, and API keys completely safe and private.


✨ Features

  • 🔒 100% Private & Secure: All file parsing and processing are performed entirely in-memory within your browser (client-side).
  • 🔄 Smart Comparison:
    • Identical: Highlights variables that share the exact same key and value on both sides.
    • Mismatch: Detects variables with matching keys but different values.
    • Only Base / Only Compare: Highlights unique variables that only exist in one environment file.
  • 🔍 Character-Level Highlights (Inline LCS Diffing): Clearly displays added or removed characters on mismatched values using the Longest Common Subsequence (LCS) algorithm.
  • ⚡ Interactive Conflict Resolution:
    • Resolve mismatches instantly with Keep Base or Keep Compare.
    • Exclude unique variables from the merged export with Remove, or put them back with Restore.
    • Toggle masking to hide or show sensitive secrets/passwords.
  • 📋 Live Export Preview: Inspect the fully merged environment output in real-time and copy it to your clipboard with a single click.
  • 💾 Multi-Format Export: Download your resolved environment configuration directly as a .env or .json file.
  • 📂 Drag & Drop Upload: Drag .env or .json files directly onto either input area to compare them immediately.

🛠️ Getting Started

Prerequisites

  • Node.js (version 24 or higher recommended)
  • npm (version 11 or higher recommended)

Installation

Install the project dependencies:

npm install

Development

Run the local development server with Hot Module Replacement (HMR):

npm run dev

Open http://localhost:5173 in your browser.

Production Build

Compile and bundle the application for production:

npm run build

🚀 Deployment & Containerization

Cloudflare Workers

This application is configured for deployment on Cloudflare Workers. You can deploy it instantly using Wrangler:

# Build and deploy to Cloudflare
npm run deploy

Docker

You can also run the application containerized using Docker. A multi-stage Dockerfile is provided in the repository root.

  1. Build the image:

    docker build -t env-diff .
  2. Run the container:

    docker run -p 3000:3000 env-diff

    The application will be accessible at http://localhost:3000.


🏗️ Project Structure

This application is built with a modular architecture:

app/
├── routes/              # Route endpoints and route-level components
├── pages/               # Main workspace layout, inputs, toolbar, and diff table
├── widgets/             # Standalone UI widgets (e.g., alert banners, confirmation dialogs)
├── entities/            # Parsing logic and core diffing algorithms
└── shared/              # Generic reusable UI primitives (e.g., Button, Badge, TextArea)

Built with ❤️ to simplify environment configuration management for developers.

About

⚡ A secure, 100% local and private tool to compare, resolve conflicts, and merge .env files or JSON configurations side-by-side directly in your browser. Built using React Router & Feature-Sliced Design (FSD).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages