Skip to content

🍬 Full stack for developing web-based data-heavy business apps

License

Notifications You must be signed in to change notification settings

improc2/allegory-sdk

 
 

Repository files navigation

🍬 The Allegory SDK

The Allegory SDK is a self-contained cross-platform programming environment for developing web-based database-driven business apps in LuaJIT and JavaScript.

The server-side stack is written entirely in Lua and contains:

  • a coroutine-based scheduler for epoll and IOCP multiplexing.
  • a programmable web-server-as-a-library.
  • a fully-featured http client and async DNS resolver.
  • OS threads with synchronized queues.
  • async process execution with pipes and shared memory.
  • the fastest libraries for hashing, encryption, compression, image codecs, image resizing, JSON and XML codecs, CSV parsing and XLS generation.
  • async connectors for MySQL and Tarantool.
  • a powerful SQL preprocessor with conditionals and macros.
  • a database schema DSL with automatic schema synchronization.
  • ...and more, see full list of modules below.

The client-side stack is written from scratch in JavaScript and contains:

  • a virtual editable tree-grid widget that can handle 100,000 records at 60fps.
  • a collection of data-bound widgets for data entry, navigation and reporting.
  • layouting widgets for split-pane layouts common in data-dense business applications.
  • a mechanism for web components better than the native one.

Status

Follow the releases to see what's new and the dev branch to see what's cooking for the next release.
Look at the issues to see what's missing, broken or wanted.

Where it's used

Compatibility

  • Operating Systems: Debian 10+, Windows 10
  • Browsers: Desktop Chrome, Firefox, Edge (Safari planned)
  • CPUs: x86-64 with SSE 4.2 (AVX2 used if found).

Binaries

Binaries are included in separate repos for each supported platform and are versioned to follow the main repo.

$  git clone git@github.com:allegory-software/allegory-sdk-bin-debian10  bin/linux
>  git clone git@github.com:allegory-software/allegory-sdk-bin-windows   bin/windows

Building

See our Building Guide which also teaches how create build scripts for new libraries.

Runtime

  • LuaJIT - Custom build of LuaJIT

Modules

  • Standard Library
    • glue - "Assorted lengths of wire" library
    • pp - Pretty printer and serializer
    • coro - Symmetric coroutines for cross-yielding
    • logging - Logging to files and network
    • events - Event system (pub/sub) mixin for any object or class
    • lpeglabel - PEG (Parsing Expression Grammars) parser with labels
    • daemon - Scaffold/boilerplate for writing server apps
    • cmdline - Command-line arg processing
    • pbuffer - Dynamic binary buffer for decoding and encoding
  • Platform APIs
    • fs - Filesystems, pipes, memory mapping
    • proc - Async process execution with I/O redirection
    • path - Path manipulation
    • unixperms - Unix permissons string parser
    • time - Wall clock, monotonic clock, sleep
  • Multi-threading
    • os_thread - High-level threads API based on pthread and luastate
    • luastate - Create Lua interpreters to use with OS threads
    • pthread - Low-level threads
  • Multi-tasking
    • tasks - Task system with process hierarchy, output capturing and scheduling
  • Networking
    • sock - Sockets & async scheduler for sockets & pipes
    • sock_libtls - TLS-encrypted async TCP sockets
    • connpool - Connection pools
    • resolver - Async DNS resolver
    • http_client - Async HTTP(s) 1.1 client for high-volume web scraping
    • http_server - Async HTTP(s) 1.1 server
    • smtp - Async SMTP(s) client
    • url - URL parsing and formatting
    • ipv6 - IPv6 conversion routines
  • Data Exchange
    • base64 - Base64 encoding & decoding
    • json - Fast JSON encoding & decoding
    • msgpack - MessagePack encoding & decoding
    • xml_parse - XML SAX parsing
    • xml - XML formatting
    • csv - CSV parsing
    • xlsxwriter - Excel 2007+ XLSX file generation
    • multipart - Multipart MIME encoding
  • Hashing
  • Compression
  • Databases
    • sqlpp - SQL preprocessor
    • mysql - MySQL async driver
    • tarantool - Tarantool async driver
    • schema - Database schema diff'ing and migrations
    • query - SQL queries with preprocessor on a connection pool
  • Raster Images
  • Templating
  • Data Structures
  • Math
    • ldecnumber - Fixed-precision decimal numbers math
    • rect - 2D rectangle math
  • Support Libs
  • Dev Tools
  • Web / Server side
    • webb - Procedural web framework
    • webb_action - Action-based routing with multi-language URL support
    • webb_auth - Session-based authentication
    • webb_spa - Single-page app support
    • jsmin - JavaScript minification
  • Web / Client side
  • Web / Client side / Support libs

Contributing

The SDK is open to contributions for fixing bugs and improving the existing modules. We also accept new modules but we take the liberty to chose what to include if we are to take resonsibility for maintaining them.

Before issuing a pull request, it might be helpful to read our Programming Guide which contains:

  • The Lua coding style guide,
  • Notes on programming for LuaJIT,
  • Notes on Lua API design.

License

The Allegory SDK is MIT Licensed. 3rd-party libraries have various non-viral free licenses.

FAQ

Q: Why Lua (for web apps)?

A: Because Lua is like modern JavaScript, except it got there 10 years earlier and it didn't keep the baggage while doing so. That being said, we're all engineers here, we don't have language affectations. We're just happy to use a language with stackful coroutines, real closures with full lexical scoping, hash maps, a garbage collector, a better ffi than we could ever ask for, and an overall non-opinionated design that doesn't pretend to know better than its user.

Q: Why not OpenResty?

A: We actually used OpenResty in the past, nothing wrong with it. It's probably even faster. It definitely has more features. Nginx is however quite large, not nearly as hackable as our pure-Lua server, it wants to control the main loop and manage threads all by itself, and its configuration directives are inescapably byzantine and undebuggable by trying to do declaratively what is sometimes better done procedurally.


Allegory SDK (c) 2020 Allegory Software SRL

About

🍬 Full stack for developing web-based data-heavy business apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 62.5%
  • JavaScript 27.6%
  • C 5.6%
  • CSS 2.5%
  • HTML 1.2%
  • Shell 0.6%