My friend is working on an open sourced web framework that allows for the development of websites using Lua, html, CSS, JavaScript, etc… Seeing that Roblox uses Lua, I can think of many applications Roblox devs can use this framework for. It feels neccesary to add that in its current state, it is not friendly to beginners and needs some love to get going; personally I am in love with the idea of using Lua for websites (Web Developer by trade, game developer by heart) so I felt the need to share this gem with you all to maybe get the ball rolling. Contributing is open, and even I am planning on contributing.
Possible uses: Creating a server admin interface for your game so you manage player data from a web gui? (What I’m working on currently)
Edit: Sincere apologies to all, I avoided uploading documentation because there is a readme file on the github page. However, I will post his readme on how to use it:
![Logo|315x150](upload://azNw9FOXWqq5Klzie0Nkfh8SD3o.png)
Luaflow
A MVC (Model-View-Controller) lua framework for apache2 web servers.
Report bug
·
Request feature
Table of contents
About
Luaflow is a web framework for Lua that revolves around an object orientated building process designed for agile web development. Currently I’m using apache2’s built in module ‘mod_lua’ but there are plans to bring Luaflow to nginx and other webservers. mod_lua allows the server to parse lua files. You can enable this module by adding LoadModule lua_module modules/mod_lua.so
to your httpd.conf
file for apache2.
- XAMPP httpd.conf: xampp/apache/conf/httpd.conf
- Ubuntu: idk
- anything else: idk
For performance add this to the file as well
AddHandler lua-script .lua
LuaScope thread
LuaCodeCache stat
Status
Currnetly a bare bones functionality is implmented.
Get Started
To get started locate your httpd.conf
file for apache, and add LoadModule lua_module modules/mod_lua.so
. I added this text where the other LoadModule’s were located. Clone the entire repo and go into luaflow/config.lua
and change the ‘src_directory’ value to the absolute path to the webpages’ directory (where .htaccess is), also go into luaflow/router.lua
and change package.path = package.path .. ';C:/xampp/htdocs/luaflow/?.lua'
to package.path = package.path .. ';absolute/path/that/is/in/config/?.lua'
. A full documentation guide is coming soon.
Documentation
Documentation revolving Luaflow.
Basic
All Luaflow apps consist of two parts: views, and templates. A view is a page within your app, and the initial index page of your app will be App.lua
.
Each view is a subclass of Luaflow’s core class (luaflow/core.lua) and consists of 3 main variables: ‘core.variables’, ‘core.head’, ‘core.style’. All the variables that are apart of your view will be held in the variables table, the views’ html head contents are set by the head table (title, stylesheets, or etc/other), and all extra styles will be held as a string within the style variable.
The core class will build and render the string returned by the view’s ‘render’ method. The render method will replace all varibles nested within double curly brackets ( ex. {{variable_name}} ) with the variables value.
A template is much like a view, except it can be rendered within views many seperate times.
Todo
Here is what’s on my todo list:
- Websocket state managment
- Database class
- Custom routing
Bugs and feature requests
n/a
Contributing
Contributing is open.
Creators
Creator 1
Copyright and license
Code and documentation copyright 2011-2018 the authors. Code released under the MIT License.
Enjoy