{"id":16165991,"url":"https://github.com/duckonaut/reluax","last_synced_at":"2025-08-16T07:07:28.935Z","repository":{"id":216667926,"uuid":"741988764","full_name":"Duckonaut/reluax","owner":"Duckonaut","description":"A web framework based on a custom dialect of Lua","archived":false,"fork":false,"pushed_at":"2024-01-29T16:08:10.000Z","size":129,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-12T16:53:35.177Z","etag":null,"topics":["lua","rust","server"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Duckonaut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-11T14:29:50.000Z","updated_at":"2025-07-18T01:11:24.000Z","dependencies_parsed_at":"2024-01-29T18:06:34.006Z","dependency_job_id":"98ba78ad-1c15-419c-bbab-490a5747f80b","html_url":"https://github.com/Duckonaut/reluax","commit_stats":null,"previous_names":["duckonaut/reluax"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Duckonaut/reluax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duckonaut%2Freluax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duckonaut%2Freluax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duckonaut%2Freluax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duckonaut%2Freluax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Duckonaut","download_url":"https://codeload.github.com/Duckonaut/reluax/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Duckonaut%2Freluax/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270213891,"owners_count":24546296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","rust","server"],"created_at":"2024-10-10T02:52:50.900Z","updated_at":"2025-08-16T07:07:28.912Z","avatar_url":"https://github.com/Duckonaut.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"assets/logo.svg\" /\u003e\u003c/p\u003e\n\n# Reluax\n\n![Crates.io Version](https://img.shields.io/crates/v/reluax)\n\n`reluax` lets you easily create dynamic websites in a custom dialect of Lua,\ninspired by JSX. The service has been written in Rust, and uses `luajit` as\nits Lua runtime for performance and ease of integration of other libraries.\n\n## Requirements\n- `luajit`\n\n## Installation\nCurrently, the project is only supported on Linux and MacOS.\n\nReluax is available through GitHub releases as a prebuilt binary, or\nfrom `crates.io` through `cargo install reluax`, if you have the Rust\ntoolchain installed. Alternatively, it is packaged as a Nix flake:\nif you have Nix installed, you can `nix run github:Duckonaut/reluax`.\n\n## Usage\n```\nCommands:\n  serve  Serve a directory of LuaX files in production mode\n  build  Build a directory of LuaX files\n  dev    Serve a directory of LuaX files in development mode\n  new    Create a new project\n  init   Initialize a new project in the current directory\n  help   Print this message or the help of the given subcommand(s)\n\nOptions:\n  -h, --help  Print help\n\nExamples:\n  reluax serve\n  reluax serve --port 4000\n  reluax dev -P public/ -C luax/\n```\n\nTo create an example project, run `reluax new my-first-project`.\n\n## Inspiration\nThe project was heavily inspired by Ben Visness' blog post,\n[I made JSX for Lua (because I hate static sites)](https://bvisness.me/luax/),\nwhich I highly recommend reading.\n\n## API\nA Reluax project is very simple. Reluax expects to run a directory of files,\nwith the entry point being `reluax.luax` or `reluax.lua`. This module needs\nto return a table containing the member function `route`, and optionally a\nproject name under the key `name`. For code examples, check the\n[examples](https://github.com/Duckonaut/reluax/tree/main/example) directory.\n\nThe `route` function will be called with the path and, optionally, method and\nbody of a request, and can return a variety of responses, by returning two\nvalues: the status code, and the response body.\n\nThe response body will usually be a table, and by default will be treated as a HTML\npage (see `example/basic/`). It can be optionally wrapped using the functions\n`reluax.html` or `reluax.json`, the first of which will make sure the HTML is returned\nas is, without a `\u003c!DOCTYPE html\u003e` tag, and the second returning the table as a JSON\nobject.\n\nWith this you can build a rather powerful backend, handling templating, routing, and\nanything else through LuaX code.\n\nThe `reluax` global table contains several utility functions, described below:\n- `reluax.json`: wrap the table to be interpreted as a JSON response,\n- `reluax.html_page`: wrap the table to be interpreted as a full HTML page (default behavior),\n- `reluax.html`: wrap the table to be interpreted as a HTML excerpt (for e.g. use with\n  [htmx](https://htmx.org)),\n- `reluax.path_matches`: check if a path string matches the template,\n- `reluax.path_extract`: extract named path parameters from the path.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckonaut%2Freluax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduckonaut%2Freluax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduckonaut%2Freluax/lists"}