Skip to content

🧩 JSON Diff Viewer β€” A lightweight React + TypeScript tool to visually compare two JSON files side-by-side with color-coded differences, live updates, dark/light mode, and zero UI libraries.

Notifications You must be signed in to change notification settings

DhanashriPatil11/json-diff-viewer

Repository files navigation

πŸ” JSON Diff Viewer β€” React + TypeScript + Vite

This project is a powerful and user-friendly JSON Diff Viewer built with React, TypeScript, and Vite. It allows users to easily compare two JSON objects side-by-side and view the differences in a clean, syntax-highlighted, color-coded format. The tool is especially useful for developers, testers, and data analysts who need to analyze structural or data changes between JSON payloads.

πŸš€ Features

  • 🧠 Smart JSON Comparison β€” Detects and highlights additions, deletions, and changes.
  • 🌈 Color Coded Output β€”
    • 🟩 Added keys/values
    • πŸŸ₯ Removed keys/values
    • 🟨 Modified values
  • πŸŒ“ Dark/Light Mode Toggle β€” Seamlessly switch themes to reduce eye strain.
  • 🧾 Syntax Highlighting β€” Powered by react-syntax-highlighter.
  • 🧩 Side-by-Side Diff Layout β€” Enhanced visual clarity of changes.
  • ♻️ Live Updates β€” Re-renders diff on input change in real-time.
  • πŸ’‘ No Tailwind or UI Libraries β€” Styled using clean, custom CSS.

🌍 Deployment Ready

You can deploy this project across multiple platforms with CI/CD integration:

  • Vercel β€” Connect your GitHub repo and deploy instantly with zero config.
  • Cloudflare Pages β€” Edge-deployed for super-fast delivery.
  • GitHub Pages β€” Great for hosting fallback or demo versions.

πŸ“₯ Getting Started

Follow the steps below to clone and run this project locally:

1. Clone the Repository

git clone https://github.com/your-username/json-diff-viewer.git cd json-diff-viewer ### 2. Install Dependencies ```bash npm install  ### 3. Run the Development Server npm run dev  ### The app will be available at http://localhost:5173.  ### 4. Build for Production npm run build  ### 5. Preview the Production Build npm run preview   πŸ“¦ Future Improvements πŸ” Side-by-side visual diff layout β€” Enhanced comparison for better readability.  🌐 Multilingual support for accessibility β€” Reach a wider global audience.  πŸ’‘ AI-based suggestion for JSON improvement β€” Smart hints to improve data quality and structure.   # React + TypeScript + Vite  This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.  Currently, two official plugins are available:  - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh  ## Expanding the ESLint configuration  If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:  ```js export default tseslint.config({ extends: [ // Remove ...tseslint.configs.recommended and replace with this ...tseslint.configs.recommendedTypeChecked, // Alternatively, use this for stricter rules ...tseslint.configs.strictTypeChecked, // Optionally, add this for stylistic rules ...tseslint.configs.stylisticTypeChecked, ], languageOptions: { // other options... parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, }, })

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js import reactX from 'eslint-plugin-react-x' import reactDom from 'eslint-plugin-react-dom' export default tseslint.config({ plugins: { // Add the react-x and react-dom plugins 'react-x': reactX, 'react-dom': reactDom, }, rules: { // other rules... // Enable its recommended typescript rules ...reactX.configs['recommended-typescript'].rules, ...reactDom.configs.recommended.rules, }, })

πŸš€ Live Demo

πŸ”— Click here to view the deployed app on Vercel

πŸ§‘β€πŸŽ“ Author Made with ❀️ by Dhanashri Patil

πŸ“§ Email: patil.dhanashrik@gmail.com

πŸ‘©β€πŸ’» Connect with Me

LinkedIn

About

🧩 JSON Diff Viewer β€” A lightweight React + TypeScript tool to visually compare two JSON files side-by-side with color-coded differences, live updates, dark/light mode, and zero UI libraries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published