Skip to content

Simple todo app built with NestJS + Server-Side TSX (KitaJS) and Zod validation + Drizzle ORM + SQLite, and HTMX + AlpineJS + TailwindCSS

License

Notifications You must be signed in to change notification settings

mbenedettini/nestjs-tsx-htmx-todo-app

Repository files navigation

NestJS + Server-Side TSX + HTMX Todo App

This is a simple todo app built with NestJS, server-side TSX, and HTMX that works as an example or boilerplate for building full stack web apps using TypeScript with all the ease of JSX to reutilize components on server side and the mentioned HTMX + AlpineJS on the frontend.

Features a modal dialog to show the todo form elegantly resolved with AlpineJS events.

Kapture 2024-10-23 at 18 45 39 ii

Features

Backend:

Frontend:

Others:

  • Linting and Formatting with Biome

Usage

  1. Clone this repo and use your favorite tool (NVM or whichever else) to have ready Node >= 20 and PNPM >= 9.

If you feel enthusiastic about Nix, you can install it following instructions here and then run nix develop to enter a shell with the right Node version and PNPM.

  1. Run pnpm install to install the dependencies.

  2. Run pnpm run migrations:migrate to run migrations and create the database.

  3. Run pnpm run start:dev to start the development server and go to http://localhost:3100.

Build the Docker image

Cross platform building is not easy on Nix. If you are on MacOS or don't want to install Nix, it's just easier to run nix build inside a Linux container:

docker run --platform linux/amd64 -v .:/src -ti nixos/nix:2.24.9 bash -c "cd /src && nix build --extra-experimental-features nix-command --extra-experimental-features flakes --no-filter-syscalls --impure .#docker-image && rm todo-app.tar.gz && cp -L result todo-app.tar.gz" && docker load < todo-app.tar.gz

Then just run the image:

docker run --init -e PORT=3200 -p 3200:3200 todo-app:latest

and head to http://localhost:3200.

If you are on Linux, you can just run nix build .#docker-image and then docker load -i result and then docker run --init -e PORT=3200 -p 3200:3200 todo-app:latest.

License

MIT

About

Simple todo app built with NestJS + Server-Side TSX (KitaJS) and Zod validation + Drizzle ORM + SQLite, and HTMX + AlpineJS + TailwindCSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published