Building JSONLTools with Laravel and Livewire

October 7, 2024

projects

I built JSONL Tools to handle a few chores that come up when working with JSON Lines data. Convert a CSV. Check whether each line is valid JSON. Generate some sample records. None of those needs to be a whole project every time you do it.

If you haven't worked with JSONL, the format is pretty simple. Each line is a separate JSON value. You can process records one at a time without treating the whole file as one big JSON array.

That also means a file can look fine at a glance and have one broken record buried in it. The validator checks the individual lines. The CSV converter handles getting tabular data into the format in the first place. There's a generator for sample data too.

Building the tools

Laravel and Livewire handle the application. Tailwind handles the styling. The converters and validator are Livewire components, with Blade views for the inputs and results. The explanatory pages use Laravel Folio.

There's no particularly exotic architecture here. The work happens in the components that take the input, process it, and return something you can copy or use. The same layout serves the different tools.

I also added explanations of the format and JSONL best practices. If someone lands on a converter without knowing why their pipeline wants JSONL, they can get that context without going somewhere else.

For a script or pipeline, tools like jq and Python's jsonlines are still useful. JSONL Tools gives you a web interface when you just want to do the conversion or check a file.

You can use the tools at jsonltools.com.