|
1 | | -# code-differentiator |
| 1 | +# DiffTool |
| 2 | + |
| 3 | +A fast, fully **client-side** code and text diff tool. Paste snippets or upload files, pick a view, and compare — nothing leaves your browser. |
| 4 | + |
| 5 | +**Live app → [ananttripathi.github.io/code-differentiator](https://ananttripathi.github.io/code-differentiator/)** |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Screenshots |
| 10 | + |
| 11 | +### Light mode |
| 12 | + |
| 13 | + |
| 14 | +### Dark mode |
| 15 | + |
| 16 | + |
| 17 | +### Char Diff view |
| 18 | + |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Features |
| 23 | + |
| 24 | +- **Three diff views** |
| 25 | + - **Side by Side** — classic two-column diff |
| 26 | + - **Unified** — single-column unified patch view |
| 27 | + - **Char Diff** — shows every line; changed characters highlighted inline |
| 28 | +- **Paste or upload** — each pane has a paste tab and a drag-and-drop upload tab, independently |
| 29 | +- **Jupyter notebook support** — `.ipynb` files are parsed into readable cell blocks before diffing |
| 30 | +- **Swap sides** — one click to flip left ↔ right |
| 31 | +- **Live stats badge** — shows `+N / -N` lines changed after each compare |
| 32 | +- **Dark / light mode** — toggle in the header, zero flash |
| 33 | +- **Zero backend** — runs entirely in the browser; no data is sent anywhere |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +## Tech stack |
| 38 | + |
| 39 | +| Tool | Version | Purpose | |
| 40 | +|---|---|---| |
| 41 | +| React | 18 | UI | |
| 42 | +| Vite | 5 | Build tool | |
| 43 | +| [diff (jsdiff)](https://github.com/kpdecker/jsdiff) | 5 | Line & character diff engine | |
| 44 | +| [diff2html](https://diff2html.xyz) | 3 | Renders unified/side-by-side diff HTML | |
| 45 | + |
| 46 | +No CSS framework, no router, no state management library. |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Local development |
| 51 | + |
| 52 | +```bash |
| 53 | +git clone https://github.com/ananttripathi/code-differentiator.git |
| 54 | +cd code-differentiator |
| 55 | +npm install |
| 56 | +npm run dev |
| 57 | +``` |
| 58 | + |
| 59 | +Open [http://localhost:5173](http://localhost:5173). |
| 60 | + |
| 61 | +```bash |
| 62 | +npm run build # production build → dist/ |
| 63 | +npm run preview # preview the production build locally |
| 64 | +``` |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +## Deployment |
| 69 | + |
| 70 | +The app auto-deploys to GitHub Pages on every push to `main` via GitHub Actions. |
| 71 | + |
| 72 | +To enable on a fresh fork: |
| 73 | +**Repo → Settings → Pages → Build and deployment → Source → GitHub Actions** |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +MIT |
0 commit comments