{"id":13548461,"url":"https://github.com/digitalbazaar/monarch","last_synced_at":"2025-05-05T18:26:37.374Z","repository":{"id":66015271,"uuid":"436866","full_name":"digitalbazaar/monarch","owner":"digitalbazaar","description":"The Modular Networking Architecture - high-performance libraries for creating REST-based, JSON Web Services","archived":false,"fork":false,"pushed_at":"2012-05-22T18:57:41.000Z","size":13273,"stargazers_count":44,"open_issues_count":1,"forks_count":7,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-19T10:28:44.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://digitalbazaar.com/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalbazaar.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-12-14T18:02:49.000Z","updated_at":"2024-07-23T04:12:01.000Z","dependencies_parsed_at":"2023-02-19T21:15:49.809Z","dependency_job_id":null,"html_url":"https://github.com/digitalbazaar/monarch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fmonarch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fmonarch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fmonarch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fmonarch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/monarch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252552113,"owners_count":21766641,"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","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":[],"created_at":"2024-08-01T12:01:10.678Z","updated_at":"2025-05-05T18:26:37.355Z","avatar_url":"https://github.com/digitalbazaar.png","language":"C++","funding_links":[],"categories":["C++","others"],"sub_categories":[],"readme":"Introduction\n------------\n\nMonarch is a set of libraries and tools for creating high-performance\nREST-based, native JSON Web Services. Monarch is best suited for sites\nthat rely on lots and lots of AJAX calls to provide their core\nfunctionality.\n\nFeatures\n--------\n\n* Native and cross-platform - works on Windows, Mac OS X and Linux.\n* Scalability - designed to scale easily with multi-cpu/multi-core systems.\n* Efficient - small executable size and very high-performance.\n* Modular - use as much or as little as is required for your software.\n* Crypto - complete cryptography stack supporting SSL and TLS.\n* Network-centric - everything necessary to create a high-performance AJAX\n                    backend including light-weight, high-performance, \n                    multi-threaded HTTP server.\n* Streaming - Built to stream all input and output, thus saving on memory\n              and disk usage. Capable of in-line encryption, steganography\n              and decryption of audio and video data.\n* Integration - integrates with other network services like SMTP, UPnP, and\n                MySQL.\n* Micro-kernel - Microkernel architecture that allows hundreds of thousands\n                 of simultaneous micro-processes (fibers) to operate without\n                 operating system intervention.\n* Validation - Ensures validity of incoming or outgoing JSON data to AJAX\n               front-end services.\n\nThis product includes software developed by the OpenSSL Project for use in\nthe OpenSSL Toolkit (http://www.openssl.org/).\n\nGetting Started\n---------------\n\nTo compile and run on Linux, Intel Mac OS X, or other similar *NIX systems:\n\n   $ ./build-setup\n   $ make\n\nTo compile for Windows XP, Vista, 7:\n* You must have the mingw32 compiler toolchain - the easiest way to get\nthis working is to use Linux and cross-compile for Windows:\n\n  $ ./build-setup -s\n  $ ./configure --host=windows\n  $ make\n\nTo run configure with custom build options:\n\n   $ ./build-setup -s\n   $ ./configure --help\n   $ ./configure [options...]\n   $ make\n\nTo specify a custom build target, use the --host option. Monarch has custom\nbuild target aliases \"linux\", \"macos\", and \"windows\". Any other standard\nconfigure host alias is also acceptable. See autoconf documentation for host\nalias help. Note that non-MacOS and Windows targets will currently build as if\nin Linux mode.\n\nTo test the various subsystems in Linux and Mac OS X:\n\n   $ make test\n\nTo run the ping/pong test:\n\n   $ ./monarch-run pong -t pong --log-level=d\n\nIn a separate console, try the following:\n\n   $ curl http://localhost:19500/pong\n\nYou should see the following text in the response from the server:\n\n   Pong!\n\nIf you see the text above, your Monarch server is operating correctly.\n\nSystem Details\n--------------\n\nThe Monarch project was originally created as a set of support libraries\nthat form the foundation for Bitmunk and similar projects. It needed to\nprovide APIs for robust, small, and fast cross-platform network-dependent\napplications. An overview of each subsystem library is provided below:\n\nmoapp\n-----\nA generic framework for quickly setting up applications that use Monarch's\nconfiguration system and logging capabilities and have the ability to\nspecify and parse command line options.\n\nmocompress\n----------\nProvides APIs for using gzip and DEFLATE compression and decompression\nand for creating ZIP archives.\n\nmoconfig\n--------\nProvides a versatile configuration system with \"tiered\"\nsupport. Configuration objects can be created and arranged in an arbitrary\nhierarchical order that allows for easy setting and overriding of default\noptions at various levels. For example, an application may be configured\nsuch that it has system defaults, system user defaults, and application\nuser defaults as well as having custom user options. Configuration\nobjects can be serialized and deserialized in JSON format. Configuration\nobjects can also be spread across multiple files and include multiple\nconfiguration files if desired.\n\nmocrypto\n--------\nProvides APIs for encryption, decryption, digital signatures, secure\nasymmetic and symmetric key generation, X.509 certificates, crypto hash\nfunctions, and arbitrary precision big integer and big decimal support.\n\nmodata\n------\nProvides APIs for JSON and XML serialization and deserialization. This\nincludes serializing and deserializing DynamicObjects. Other APIs include\nsupport for inspecting data for file formats and data structures for\nparsing file formats such as MPEG, AVI, RIFF, and ID3v2. A simple template\nparser that can search and replace template variables with other values\nis also available.\n\nmoevent\n-------\nProvides APIs for a complete event monitoring system. Events can be\nregistered, scheduled, and received in a multithreaded environment. Event\ntaps may be created that allow events of different types to be grouped\ntogether so that event observers can more easily monitor similar\nevents. Observers may also specify filters on event data to limit the\nevents they receive. Objects that can wait to proceed until particular\nevents have been received can easily be created. Event daemons can be\ncreated to periodically schedule certain events.\n\nmohttp\n------\nProvides APIs that support the basics of HTTP/1.1. This includes the\nability to read and write HTTP headers and entity bodies with or without\nchunked transfer-encoding, the ability to specify HTTP trailers, service\nHTTP connections and handle HTTP requests (including keep-alive support),\nand the ability to read and write cookies. Also included is a simple\nHTTP client.\n\nmoio\n----\nProvides APIs for input and output. This includes the ability to read and\nwrite from files and to create an arbitrary chain of input and output\nstreams. Also included is a stream mutation API for quickly writing or\nreusing objects that alter data as it is read or written, with applicable\nuses including encryption/decryption, compression/decompression, and\ndata encoding/decoding. APIs for dynamic bit streams and byte buffers\nand a File object for performing simple file system operations like\ncreating and deleting files and directories and manipulating paths\nis provided. Future work will include APIs for easily working with\nhighly-scalable, asynchronous, event-based IO.\n\nmologging\n---------\nProvides APIs for logging arbitrary information to an arbitrary location,\nwith built-in support for writing to log files, including file rotation\nsupport. The APIs include printf-style macros that allow for more compact\nlogging calls.\n\nmomail\n------\nProvides APIs for a Simple Mail Transfer Protocol client. Included is\na mail template parser for easily sending generic/bulk emails and  mail\nspool for when mail fails to be sent.\n\nmonet\n-----\nProvides APIs for quickly and easily setting up cross-platform network\ncommunication in an application. This includes a fast and small generic\nserver that uses abstract port services that perform duties as specified\nby a developer. Built-in port services include a simple datagram service\nfor handling generic UDP traffic, and a simple connection service for\nhandling generic TCP traffic. The http library builds on top of this\nlibrary to provide HTTP connection and request services that can be\neasily customized. Included is a simple Socket API and the ability to\nspecify data presentation layers along with port services. Built-in data\npresentation layers include SSL (and TLS) support. The library abstracts\naway socket data presentation layers such that multiple layers can be\nsupported on a single port service, allowing, for instance, SSL and\nnon-SSL traffic to be handled on a single port. Also included is the\nability to cache and reuse SSL sessions, parse and resolve internet\naddresses (IPv4 and IPv6), bandwidth throttling and URL parsing.\n\nmort\n----\nProvides APIs for cross-platform dynamic objects, threads, thread\npools, atomic instructions, exclusive and shared locks, semaphores,\nhazard pointers, a lock-free hash table, getting and manipulating\nsystem time, reference-counted smart pointers, runnable interfaces and\nrunnable delegates for wrapping functions or class members as runnables\nfor threads, and a generic job dispatcher for efficiently queuing and\nhandling work in a multithreaded environment.\n\nmomodest\n--------\nProvides APIs for a microkernel that provides an engine for scheduling,\nmonitoring, and performing generic jobs and an infrastructure for\nextending that kernel with modules that can utilize that engine,\nshare access to running operations. Also available is a shared state\nmachine that can be used to help determine when to schedule and/or cancel\nparticular operations. Each operation that is scheduled with the engine\ncan provide an operation guard that can synchronously check the shared\nstate machine (or other arbitrary location) for a particular set of\ncircumstances before allowing the operation to be run. Operations may\nalso mutate the state of the machine in ways that can affect all other\noperations in the system. Extending modules can provide their own unique\ninterfaces so that other modules can take advantage of the features\nthey provide. All operations that run on any given module are unified\nvia the microkernel's engine, giving a developer the ability to limit\nthe number of threads used and the ability to interrupt and terminate\nall operations or a group of operations as necessary. Operations can be\nwaited on for completion or queried for completion or cancelation.\n\nmofiber\n-------\nProvides APIs that build on top of the modest microkernel to provide\ncooperative multitasking fibers. Each fiber can specify its maximum stack\nsize and will run developer supplied code. Each fiber can be yielded or\nput to sleep as necessary to allow other fibers to run. Switching contexts\nis done is user space. The fiber scheduler can run on multiple operations\n(multiple threads) using modest's engine, allowing for maximum scalability\nand utilization of multiple-core machines. Any fiber can be scheduled\nto run on any thread. Writing code for a fiber is seamless because the\nyield() or sleep() calls swap out the current fiber stack for another\none, returning to exactly where the fiber left once the yield or sleep is\ncomplete. Messaging fibers can be created that can send messages to one\nanother to control more complex behavior. Future work will include the\nability to seamlessly incorporate asynchronous IO with fibers so that when\nreads and writes need to occur a fiber will sleep until data is ready,\nsparing the use of a waiting thread and allowing for greater scalability.\n\nmosql\n-----\nProvides unified APIs for accessing databases. Database connections\nand statements use abstracted interfaces that hide the underlying\ndatabase format and protocol from the developer for maximum reuse and\nreplacability. The ability to prepare and execute arbitrary SQL statements\nis provided. A connection pool is also available to obtain better\nperformance for network-based databases such as mysql. Also included\nis an abstract database client that provides an simpler programming\ninterface with functions like insert(), update(), and select().\n\nmosqlite3\n---------\nProvides an sqlite3 implementation for the monarch sql library.\n\nmomysql\n-------\nProvides a mysql implementation for the monarch sql library.\n\nmosphinx\n--------\nProvides a client for performing searches and working with a sphinx\nserver.\n\nmotest\n------\nProvides APIs for a unit test architecture.\n\nmoupnp\n------\nProvides APIs for working with UPnP devices to forward ports, etc.\n\nmoutil\n------\nProvides APIs for getting random numbers, averaging transfer rates, doing\nbase64 encoding and decoding, getting CRC-16s, creating timers, getting\nand manipulating dates, and handling strings and regular expressions.\n\nmovalidation\n------------\nProvides APIs for validating data. Validators can ensure that data is of\na particular type, ie a string, integer, regular expression, or is a map\nor array. Validators can also ensure that data contains particular values.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fmonarch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Fmonarch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fmonarch/lists"}