{"id":19858493,"url":"https://github.com/matjam/lunar","last_synced_at":"2026-05-14T03:36:57.146Z","repository":{"id":247006068,"uuid":"824741609","full_name":"matjam/lunar","owner":"matjam","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-06T02:20:18.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T23:57:43.770Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/matjam.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-07-05T20:40:42.000Z","updated_at":"2024-07-06T02:20:21.000Z","dependencies_parsed_at":"2024-07-06T04:49:05.091Z","dependency_job_id":"643eac8e-9c39-4e4b-b413-ddd4389b5597","html_url":"https://github.com/matjam/lunar","commit_stats":null,"previous_names":["matjam/lunar"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matjam/lunar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Flunar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Flunar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Flunar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Flunar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matjam","download_url":"https://codeload.github.com/matjam/lunar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matjam%2Flunar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33009763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":[],"created_at":"2024-11-12T14:23:43.865Z","updated_at":"2026-05-14T03:36:57.098Z","avatar_url":"https://github.com/matjam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is Lunar?\n\nLunar is an API service for storing and retriving data or \"Entities\". An Entity is a collection of arbitrary key-value\npairs, that conform to a schema defined by the user.\n\nEntities are organized into \"Collections\", which are essentially like a table in a database. Each collection has a unique\nname, and defines \"EntityTypes\" which are the schemas that entities in that collection must conform to.\n\nEntitySchemas are defined with a standard JSON schema format that is used to validate the data that is stored in the\ncollection. Each Collection defines a set of EntityTypes, and these EntityTypes can have different schemas and be related\nto other EntityTypes in the collection in arbitrary ways.\n\nEntityTypes are themselves defined with a JSON schema and provide a way to extend the built-in JSON schema format to allow\nfor more complex data structures and relationships between entities. For example, an EntityType can define a field that\nextends the Object type to allow for nested entities, or a field that extends the Array type to allow for a list of\nentities.\n\nLunar also has a concept of \"EntityStates\" which can be used to define versions of an Entity that have different values\nfor the same fields. This allows for an Entity to be modified in one state without affecting the values of the fields in\nother states. For example, an Entity could have a \"draft\" state that is used for editing, and a \"published\" state that is\nused for displaying the data to users. APIs are provided to manage the state of an Entity or a set of Entities, and to\nquery for Entities based on their state.\n\nCollections of Entities are indexed in OpenSearch, which provides a fast and efficient way to search for Entities based on\ntheir field values, as well as searching based on their State or EntityType. The search engine is distributed and can be\nsharded across multiple nodes to provide fast and efficient search.\n\n## What is Lunar used for?\n\nLunar is intended to be used as a backend service for applications that need to store and retrieve data in a flexible and\nperformant way. Often when building applications, the data model is not known ahead of time, and the ability to store\narbitrary data is required. Lunar provides a way to store this data in a structured way, while still allowing for\nflexibility in the schema.\n\nExample use cases for Lunar include:\n\n- product data for an e-commerce website\n- content for a content management system\n- user data for a social media platform\n- sensor data for an IoT application\n\nA single Lunar instance can be used to store data for multiple applications, each with its own set of collections and\nentity types. This allows for a high degree of flexibility in how data is stored and organized, while still providing a\nconsistent API for interacting with the data.\n\n## Why would I not use a traditional database directly?\n\nTraditional databases like MySQL, PostgreSQL, or MongoDB are great for storing structured data, but they can be limiting\nwhen it comes to storing arbitrary data. For example, if you have an e-commerce website and you want to store product data,\nadding a new field to the product schema can be difficult and require a migration of the database schema.\n\nLunar is designed around the concept of storing data with dynamically defined schemas, along with automatic validation and\nmigration of the data. This makes it easy to add new fields to the schema, or change the schema entirely, without having to\nperform a database schema migration to the underlying database.\n\n## Permissions Model\n\nLunar has a flexible permissions model that allows for fine-grained control over who can access and modify data in a\ncollection. Permissions are defined at both the collection level and the entity level, and can be set to allow or deny\naccess to specific operations. These permissions are dynamically defined and can be changed at any time, allowing for\nflexible access control based on the needs of the application.\n\n# Example Application\n\nTo demonstrate how Lunar can be used in a real-world application, we will build a simple content management system (CMS)\nthat allows users to create, edit, and publish articles. The CMS will have the following features:\n\n- Users can create articles with a title, body, and author\n- Users can edit articles and save them as drafts\n- Users can publish articles to make them visible to other users\n- Users can search for articles based on their title, author, or content\n\nThe CMS will use Lunar to store the articles and provide an API for interacting with the data. The Lunar instance will\nhave a single collection called \"articles\" that defines an EntityType for articles. The EntityType will have fields for the\ntitle, body, author, and state of the article, as well as a field for the creation date.\n\nThe CMS will use the Lunar API to create, edit, publish, and search for articles, as well as manage the state of the\narticles. The Lunar API will provide endpoints for these operations, as well as endpoints for managing the permissions of\nthe collection.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatjam%2Flunar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatjam%2Flunar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatjam%2Flunar/lists"}