Skip to content

jliocsar/lua-htmx

Repository files navigation

lua-htmx

Lua + MongoDB + HTMX + Tailwind

HTTP server built on top of luv.

This repository is above all a Lua learning exercise. Do not use this in production by any means.

  • File-system routing for easy definition of new routes;
  • Responses compressed with zlib;
  • APIs for common use cases (HTTP, HTMX, routing, path resolving, plugins and such).

👷‍♂️ Work in progress!

Structure

  • config/: Contains .lua files with app-related configurations, such as the port number etc;
  • lib/: Has all dependencies to build & bootstrap an HTTP server with routes, plugins and such. This folder is and should be separated of all the server business logic; It is a framework per se;
  • public/: The folder server as the static directory from the HTTP server by default;
  • server/: The application itself;
  • install: Installs all dependencies to run the server (rocks, tailwindcss/cli etc);
  • build: Builds the app styles with Tailwind's CLI;
  • start: Starts the HTTP server;
  • watch: Starts the HTTP server in watch mode;
  • dev: Runs both build in watch mode and watch.

Requirements

Instructions

Installing dependencies

./install

Starting the HTTP server

./start [port] # defaults to `39179`

Development

This command will start the tailwindcss build in --watch mode; it'll also run the HTTP server in watch mode, meaning it'll restart on every file change detected.

./dev [port]

To do

  • Add websocket support
  • Would sqlite be better?

About

🌔 Simple Lua HTTP server for HTMX + Tailwind pages.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages