# leafo/lapis

A web framework for Lua and OpenResty written in MoonScript

Repository: https://github.com/leafo/lapis
Canonical: https://ross.abutalabs.com/products/lapis
Homepage: http://leafo.net/lapis/
Language: MoonScript
License: MIT
License Family: permissive
Topics: moonscript, lapis, lua, openresty
Last push: 2026-08-26T01:27:41+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 73, longevity 100
- inputs: {"age_days": 5082, "days_push": 8, "days_rel": 20, "gap_med": 136.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3338, forks 243 (observed 2026-08-28T04:07:56.822086+00:00)

## What it is
Lapis is a web framework for Lua and MoonScript that primarily targets OpenResty (Lua embedded in Nginx), with support for other server environments like lua-http. It provides URL routing, HTML templating, sessions, CSRF protection, and database models with schema migrations for PostgreSQL, MySQL, and SQLite.

## Use cases
- build a web application in Lua or MoonScript
- create a high-performance website on OpenResty/Nginx
- build REST APIs with Lua and PostgreSQL
- write asynchronous web apps using Lua coroutines without callbacks
- manage database schema migrations for a Lua web app
- build a full-stack site with server-rendered HTML templates

## When to choose
- you want to write web apps in Lua/MoonScript with high throughput on Nginx
- you need a batteries-included Lua framework with ORM, routing, and templating
- you're deploying on OpenResty and want Lua running inside Nginx workers
- you value coroutine-based async code that reads synchronously

## When to avoid
- your team primarily works in JavaScript, Python, or another mainstream web ecosystem
- you need a large ecosystem of third-party web libraries and middleware
- you're not comfortable with Lua or MoonScript syntax
- you need a framework with extensive modern tooling like hot reload and TypeScript-style typing

## Facets
- artifact type: framework
- maturity: stable
- function: web-framework, orm, routing, templating, http-server, database
- domain: web-development, backend, apis
- platform: lua, windows
- tags: moonscript, lua, openresty, nginx, postgresql, mysql, sqlite, luarocks, coroutines, full-stack, linux, macos

## Member repositories
- leafo/lapis (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:56.822086+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:41:06.060652+00:00, confidence not recorded.
  - readme: https://github.com/leafo/lapis (fetched 2026-08-28T04:07:56.822086+00:00, sha 3556c8b3bd73)
  - homepage: http://leafo.net/lapis/ (fetched 2026-08-29T09:34:23.240044+00:00, sha 8d360a17c85f)
  - site_page: https://leafo.net/lapis/changelog.html (fetched 2026-08-29T09:34:23.245533+00:00, sha 1780536b75d0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
