How arkforgelabs/astra works
Project type and purpose
• Astra is an open-source, high-performance web server runtime written in Rust that embeds a Lua VM (supports Lua 5.1–5.4, Luau, LuaJIT).
• It exposes an HTTP server API to user-provided Lua scripts, plus database drivers, templating, crypto, file I/O, async tasks, and an HTTP client.
File structure
• Top level:
• Cargo.toml, src/main.rs – the Rust binary entrypoint.
• src/components – the modular Rust implementation of HTTP server, HTTP client, database, crypto, file I/O, templating, global functions.
• src/lua – glue code and built-in Lua libraries loaded into the Lua VM.
• examples – sample Lua scripts and templates.
• docs – static site for user documentation (not part of the runtime).
• Workflows and build scripts:
• .github/workflows – CI for publishing crates and building releases.
• astra_build.lua, pack.lua – custom build/packaging scripts for the Lua side.
• Configuration:
• cliff.toml – CLI argument parsing config.
• Tera templates under examples/templates.
README for additional insights
• Core features: HTTP server with request/response model, routing, middleware, database connectivity, templating, async tasks.
• Usage pattern: instantiate Astra.http.server, register Lua callbacks for routes, configure server (port, middleware), run server.
• Deployment: delivered as a cargo-installed or prebuilt binary.
Important elements
• Clear component names matching file paths (e.g. “src/components/http/server”).
• Optional: denote the build pipeline (Cargo → binary) and CI/CD on the side if desired.