Oh, this project? Yeah, it was totally born from a bout of severe boredom and probably too much caffeine. I mean, who doesn't randomly decide to build a text comparison tool just for kicks?
So here’s what it does: you throw in two chunks of text, and it highlights every little nitpicky difference between them. Like, maybe you added an extra “and” or a sneaky typo—it’s catching it! It's powered by Go and WebAssembly because, you know, why not make it really zippy and let it run right in your browser?
Warning: You may find yourself endlessly comparing things like your grocery list to a random Shakespeare sonnet just because it’s that fun...
To build and deploy the project, follow these steps:
-
Clone the repository:
git clone https://github.com/achu-1612/fmt.git cd fmt
-
Build the WebAssembly binary:
make build
-
Build the Docker image:
make docker
-
Run the Docker container:
make run
The application will be available at http://localhost:3000
.
- Open the application – In your web browser, not in your toaster, and preferably before you get too emotionally attached to either piece of text.
- Type your masterpiece – Drop your first text in the left box. Think of it as your magnum opus, even if it’s just a grocery list.
- Type in the second piece – Enter the second text in the right box. Maybe it's a revised version, or maybe you’re just curious how Shakespeare stacks up against your shopping list.
- Pick a battle style – Choose your comparison mode. Are you ready to go Character by Character or brave the intensity of a Word-by-Word face-off?
- Press “Compare” – Brace yourself as the app reveals every difference, typo, and sneaky “the the” you somehow missed.
- Click “Clear” or “Swap” – The "Clear" button erases everything for a fresh start, and the "Swap" button... you guessed it, swaps the texts. For those moments when you just have to see it from the other side.
- The WebAssembly binary? Oh yeah, it’s built with the Go compiler (using GOOS=js and GOARCH=wasm), because why keep things simple?
- The app is served by an Apache HTTP server via a Dockerfile, making this tool only slightly easier to run than a spaceship.
- Dark Mode – Because, of course, we have a dark mode. It’s 2024; you deserve to compare texts without straining your eyes.
Need more details? Check out the code and comments (non existent) in the repo... if you’re up for it.