Skip to content

A Content Management System built with Lapis & OpenResty

License

Notifications You must be signed in to change notification settings

kafkiano/lua-cms

Repository files navigation

Lua-CMS: A Content Management System built with Lapis & OpenResty

Core Architectural Philosophy

1. Synchronous Simplicity with Asynchronous Power

This project is built on Lapis, a web framework for Lua and OpenResty. Its core strength is allowing you to write straightforward, synchronous-looking code while OpenResty handles thousands of concurrent connections efficiently using Lua coroutines and Nginx's event loop.

Just write local post = Posts:find(id) without callbacks or await, and the system automatically points at I/O points. This eliminates the complex control flow and debugging overhead typical of async/await patterns in other ecosystems. The proof of concept is the working i18n integration with deepl auto translation features.

2. "Architectural Concurrency"

A key insight driving this project is that concurrency is a systems-level concern, not an application-level one. OpenResty (Nginx + LuaJIT) manages connections and I/O scheduling at the platform layer. Your application logic remains linear, predictable, and simple. This is the "best of both worlds" we achieved in our setup.

3. A Stable Foundation

Dependencies are minimal and mature:

  • OpenResty: A full-featured web platform based on Nginx.
  • Lua: A lightweight, embeddable scripting language.
  • Lapis: The web framework that glues everything together, providing URL routing, HTML templating, CSRF protection, session support, and a database ORM.

This stack is chosen for its long-term stability and freedom from the rapid evolving javascript hell...

Technology Decisions

  • Database: PostgreSQL
  • Template Strategy:
    • Lua widgets: For reusable, self-contained components

Project Overview

  • FRAMEWORK: Lua with Lapis web framework (Lapis v1.17.0)
  • DATABASE: PostgreSQL via Lapis models
  • PHILOSOPY: Unix principles applied to web development
  • GOAL: Maintainable, simple, elegant and efficient code
  • LUAROCKS: Rocks installed for Lua 5.1:
    • alt-getopt
    • ansicolors
    • argparse
    • date
    • etlua
    • lapis
    • loadkit
    • lpeg
    • lua-cjson
    • luafilesystem
    • luaossl
    • luasocket
    • moonscript
    • pgmoon

Resources

About

A Content Management System built with Lapis & OpenResty

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published