{"id":13514908,"url":"https://github.com/yahoo/elide","last_synced_at":"2025-05-14T04:08:25.743Z","repository":{"id":39459535,"uuid":"44124366","full_name":"yahoo/elide","owner":"yahoo","description":"Elide is a Java library that lets you stand up a GraphQL/JSON-API web service with minimal effort.","archived":false,"fork":false,"pushed_at":"2025-04-21T02:23:13.000Z","size":19579,"stargazers_count":1008,"open_issues_count":87,"forks_count":230,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-21T02:46:29.246Z","etag":null,"topics":["analytics","api","api-framework","api-rest","elide","graphql","hacktoberfest","hibernate","hibernate-jpa","java","java-library","jpa","json-api","mobile","orm","web"],"latest_commit_sha":null,"homepage":"https://elide.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yahoo.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"Code-Of-Conduct.md","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,"zenodo":null}},"created_at":"2015-10-12T17:55:01.000Z","updated_at":"2025-04-21T02:23:17.000Z","dependencies_parsed_at":"2023-10-16T14:28:47.342Z","dependency_job_id":"820d42d2-5e93-4d29-9ddd-2176352e89c9","html_url":"https://github.com/yahoo/elide","commit_stats":{"total_commits":3157,"total_committers":85,"mean_commits":"37.141176470588235","dds":0.8004434589800443,"last_synced_commit":"a832ab2b332df1e06d7ac239ce10dbe3668c3841"},"previous_names":[],"tags_count":275,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Felide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Felide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Felide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yahoo%2Felide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yahoo","download_url":"https://codeload.github.com/yahoo/elide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069708,"owners_count":22009558,"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":["analytics","api","api-framework","api-rest","elide","graphql","hacktoberfest","hibernate","hibernate-jpa","java","java-library","jpa","json-api","mobile","orm","web"],"created_at":"2024-08-01T05:01:03.559Z","updated_at":"2025-05-14T04:08:20.714Z","avatar_url":"https://github.com/yahoo.png","language":"Java","readme":"# Elide\n\n\u003e _Opinionated APIs for web \u0026 mobile applications._\n\n![Elide Logo](elide-logo.svg)\n\n[![Discord](https://img.shields.io/discord/869678398241398854)](https://discord.com/widget?id=869678398241398854\u0026theme=dark)\n[![Build Status](https://cd.screwdriver.cd/pipelines/6103/badge)](https://cd.screwdriver.cd/pipelines/6103)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.yahoo.elide/elide-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.yahoo.elide/elide-core)\n[![Coverage Status](https://coveralls.io/repos/github/yahoo/elide/badge.svg?branch=master)](https://coveralls.io/github/yahoo/elide?branch=master)\n[![Mentioned in Awesome Java](https://awesome.re/mentioned-badge.svg)](https://github.com/akullpp/awesome-java)\n[![Mentioned in Awesome GraphQL](https://awesome.re/mentioned-badge.svg)](https://github.com/chentsulin/awesome-graphql)\n\n*Read this in other languages: [中文](translations/zh/README.md).*\n\n## Table of Contents\n\n- [Background](#background)\n- [Documentation](#documentation)\n- [Install](#install)\n- [Usage](#usage)\n- [Security](#security)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Background\n\n[Elide](https://elide.io/) is a Java library that lets you setup model driven [GraphQL](http://graphql.org) or [JSON API](http://jsonapi.org) web service with minimal effort.  Elide supports two variants of APIs:\n\n1. A CRUD (Create, Read, Update, Delete) API for reading and manipulating models.\n2. An analytic API for aggregating measures over zero or more model attributes.\n\nElide supports a number of features:\n\n### Security Comes Standard\nControl access to fields and entities through a declarative, intuitive permission syntax.\n\n### Mobile Friendly APIs\nJSON-API \u0026 GraphQL lets developers fetch entire object graphs in a single round trip. Only requested elements of the data model are returned.\nOur opinionated approach for mutations addresses common application scenarios:\n* Create a new object and add it to an existing collection in the same operation.\n* Create a set of related, composite objects (a subgraph) and connect it to an existing, persisted graph.\n* Differentiate between deleting an object vs disassociating an object from a relationship (but not deleting it).\n* Change the composition of a relationship to something different.\n* Reference a newly created object inside other mutation operations.\n\nFiltering, sorting, pagination, and text search are supported out of the box.\n\n### Atomicity For Complex Writes\nElide supports multiple data model mutations in a single request in either JSON-API or GraphQL. Create objects, add them to relationships, modify or delete together in a single atomic request.\n\n## Analytic Query Support\nElide supports analytic queries against models crafted with its powerful semantic layer.  Elide APIs work natively with [Yavin](https://github.com/yahoo/yavin) to visualize, explore, and report on your data.\n\n### Schema Introspection\nExplore, understand, and compose queries against your Elide API through generated Swagger documentation or GraphQL schema.\n\n### Customize\nCustomize the behavior of data model operations with computed attributes, data validation annotations, and request lifecycle hooks.\n\n### Storage Agnostic\nElide is agnostic to your particular persistence strategy. Use an ORM or provide your own implementation of a data store.\n\n## Documentation\n\nMore information about Elide can be found at [elide.io](https://elide.io/).\n\n## Install\n\nTo try out an Elide example service, check out the [elide-spring-boot-example](https://github.com/yahoo/elide-spring-boot-example) project.\n\nAlternatively, use the [elide-standalone-example](https://github.com/yahoo/elide-standalone-example) project which allows you to quickly setup a local instance of Elide running inside an embedded Jetty application.\n\n## Usage \n\n### For CRUD APIs\n\nThe simplest way to use Elide is by leveraging [JPA](https://en.wikipedia.org/wiki/Java_Persistence_API) to map your Elide models to persistence:\n\nThe models should represent the domain model of your web service:\n\n```java\n@Entity\npublic class Book {\n\n    @Id\n    private Integer id;\n\n    private String title;\n\n    @ManyToMany(mappedBy = \"books\")\n    private Set\u003cAuthor\u003e authors;\n}\n```\n\nAdd Elide annotations to both expose your models through the web service and define security policies for access:\n\n```java\n@Entity\n@Include(rootLevel = true)\n@ReadPermission(\"Everyone\")\n@CreatePermission(\"Admin OR Publisher\")\n@DeletePermission(\"None\")\n@UpdatePermission(\"None\")\npublic class Book {\n\n    @Id\n    private Integer id;\n\n    @UpdatePermission(\"Admin OR Publisher\")\n    private String title;\n\n    @ManyToMany(mappedBy = \"books\")\n    private Set\u003cAuthor\u003e authors;\n}\n```\n\nAdd Lifecycle hooks to your models to embed custom business logic that execute inline with CRUD operations through the web service:\n\n```java\n@Entity\n@Include(rootLevel = true)\n@ReadPermission(\"Everyone\")\n@CreatePermission(\"Admin OR Publisher\")\n@DeletePermission(\"None\")\n@UpdatePermission(\"None\")\n@LifeCycleHookBinding(operation = UPDATE, hook = BookCreationHook.class, phase = PRECOMMIT)\npublic class Book {\n\n    @Id\n    private Integer id;\n\n    @UpdatePermission(\"Admin OR Publisher\")\n    private String title;\n\n    @ManyToMany(mappedBy = \"books\")\n    private Set\u003cAuthor\u003e authors;\n}\n\npublic class BookCreationHook implements LifeCycleHook\u003cBook\u003e {\n    @Override\n    public void execute(LifeCycleHookBinding.Operation operation,\n                        LifeCycleHookBinding.TransactionPhase phase,\n                        Book book,\n                        RequestScope requestScope,\n                        Optional\u003cChangeSpec\u003e changes) {\n       //Do something\n    }\n}\n\n```\n\nMap expressions to security functions or predicates that get pushed to the persistence layer:\n\n```java\n@SecurityCheck(\"Admin\")\npublic static class IsAdminUser extends UserCheck {\n    @Override\n    public boolean ok(User user) {\n        return isUserInRole(user, UserRole.admin);\n    }\n}\n```\n\nTo expose and query these models, follow the steps documented in [the getting started guide](https://elide.io/pages/guide/v7/01-start.html).\n\nFor example API calls, look at:\n1. [*JSON-API*](https://elide.io/pages/guide/v7/10-jsonapi.html) \n2. [*GraphQL*](https://elide.io/pages/guide/v7/11-graphql.html)\n\n### For Analytic APIs\n\nAnalytic models including tables, measures, dimensions, and joins can be created either as POJOs or with a friendly HJSON configuration language:\n\n```hjson\n{\n  tables: [\n    {\n      name: Orders\n      table: order_details\n      measures: [\n        {\n          name: orderTotal\n          type: DECIMAL\n          definition: 'SUM({{$order_total}})'\n        }\n      ]\n      dimensions: [\n        {\n          name: orderId\n          type: TEXT\n          definition: '{{$order_id}}'\n        }\n      ]\n    }\n  ]\n}\n```\n\nMore information on configuring or querying analytic models can be found [here](https://elide.io/pages/guide/v7/04-analytics.html).\n\n## Security\n\nSecurity is documented in depth [here](https://elide.io/pages/guide/v7/03-security.html).\n\n## Contribute\nPlease refer to the [contributing.md](CONTRIBUTING.md) file for information about how to get involved. We welcome issues, questions, and pull requests.\n\nIf you are contributing to Elide using an IDE, such as IntelliJ, make sure to install the [Lombok](https://projectlombok.org/) plugin.\n\nCommunity chat is now on [discord](https://discord.com/widget?id=869678398241398854\u0026theme=dark).  Join by clicking [here](https://discord.gg/3vh8ac57cc).\n\n## License\nThis project is licensed under the terms of the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) open source license.\nPlease refer to [LICENSE](LICENSE.txt) for the full terms.\n\n## Articles\nIntro to Elide video\n\n[![Intro to Elide](http://img.youtube.com/vi/WeFzseAKbzs/0.jpg)](http://www.youtube.com/watch?v=WeFzseAKbzs \"Intro to Elide\")\n\n[Create a JSON API REST Service With Spring Boot and Elide](https://dzone.com/articles/create-a-json-api-rest-service-with-spring-boot-an)\n\n[Custom Security With a Spring Boot/Elide Json API Server](https://dzone.com/articles/custom-security-with-a-spring-bootelide-json-api-s)\n\n[Logging Into a Spring Boot/Elide JSON API Server](https://dzone.com/articles/logging-into-a-spring-bootelide-json-api-server)\n\n[Securing a JSON API REST Service With Spring Boot and Elide](https://dzone.com/articles/securing-a-json-api-rest-service-with-spring-boot)\n\n[Creating Entities in a Spring Boot/Elide JSON API Server](https://dzone.com/articles/creating-entities-in-a-spring-bootelide-json-api-s)\n\n[Updating and Deleting with a Spring Boot/Elide JSON API Server](https://dzone.com/articles/updating-and-deleting-with-a-spring-bootelide-json)\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoo%2Felide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyahoo%2Felide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyahoo%2Felide/lists"}