Creating a CRUD Application

Now that you understand the basics of creating an htmx-based web application, you’re ready to step it up a bit.

Let’s create a project that performs the basic CRUD operations: Create, Retrieve (or Read), Update, and Delete. Actually, we’ll hold off on the Update part for now and address that later because we can implement that functionality in a couple of ways.

This app can maintain a collection of any sort of data. Let’s maintain a list of dogs. Feel free to change this to cats if that’s more your style. For each dog, we’ll store their name and breed.

To keep things simple, the data will just be held in memory on the server. Bun makes it very easy to interact with SQLite databases and persist the data so it isn’t ...

Get Server-Driven Web Apps with htmx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.