{"id":15010688,"url":"https://github.com/cyppan/grape","last_synced_at":"2025-04-09T18:34:32.302Z","repository":{"id":53168645,"uuid":"58740733","full_name":"cyppan/grape","owner":"cyppan","description":"An opinionated, data-first, graphy Clojure library to build HTTP APIs","archived":false,"fork":false,"pushed_at":"2021-04-02T22:34:39.000Z","size":177,"stargazers_count":14,"open_issues_count":15,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T20:37:14.884Z","etag":null,"topics":["api","clojure","graphql","mongodb","rest"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyppan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-05-13T12:57:58.000Z","updated_at":"2024-11-05T00:16:12.000Z","dependencies_parsed_at":"2022-09-12T17:30:48.305Z","dependency_job_id":null,"html_url":"https://github.com/cyppan/grape","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyppan%2Fgrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyppan%2Fgrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyppan%2Fgrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyppan%2Fgrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyppan","download_url":"https://codeload.github.com/cyppan/grape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088264,"owners_count":21045671,"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":["api","clojure","graphql","mongodb","rest"],"created_at":"2024-09-24T19:35:23.529Z","updated_at":"2025-04-09T18:34:32.280Z","avatar_url":"https://github.com/cyppan.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grape\n\n[![Clojars Project](https://img.shields.io/clojars/v/grape.svg)](https://clojars.org/grape)\n[![CircleCI](https://circleci.com/gh/cyppan/grape.svg?style=shield)](https://circleci.com/gh/cyppan/grape)\n[![codecov](https://codecov.io/gh/cyppan/grape/branch/master/graph/badge.svg)](https://codecov.io/gh/cyppan/grape)\n[![Dependencies Status](https://jarkeeper.com/cyppan/grape/status.svg)](https://jarkeeper.com/cyppan/grape)\n\nA Clojure library designed to build data-first APIs.\nThis library is a work in progress, stay tuned ;)\n\n## Features\n\nEverything is built around the concept of **resources**\nYou can see a resource as a super-powered collection of document with graph capabilities.\n\nA resource corresponds generally to a MongoDB collection, it's a dictionary\n configuration to expose your collection safely to the external world, providing:\n* One or more Rest endpoint for your resource with a JSON DSL for fetching\n* Authorization\n* Soft Delete\n* Function Hooks\n* Relations (automatic fetching of related resources)\n* Schema validations (using the powerful Prismatic Schema lib)\n\nThis library is highly functional and you can easily add features around your resources\nusing hooks on:\n* pre-read: to map the query\n* post-read: to modify the fetched documents\n* pre-create-pre-validate: the payload has been parsed, but occurs before the validation\n* pre-create-post-validate: the payload has been parsed and the document validated and coerced\n* post-create: after being inserted into the database, synchronous (you can map the result)\n* post-create-async: after being inserted into the database, asynchronous (used to feed the oplog for example)\n* pre-update-pre-validate: either for update or partial update\n* pre-update-post-validate\n* post-update\n* post-update-async\n* pre-delete\n* post-delete\n* post-delete-async\n\n**Hooks use cases:** \n* Synchronize a secondary database (like an Elastic Search)\n* Increment counters (that comment has n like)\n* Denormalize your data (Maintain an array of the 3 last replies for a comment to ensure efficient comments fetching)\n* Map the users fetched to inject a Facebook graph url for their avatar\n* Perform complex validation involving multiple fields / collections\n* ...\n\nFrom that resources configurations Grape will expose on demand: \n* A fully functional REST API (Done)\n* A Relay-compliant GraphQL Server (Nearly Done)\n* A Falcor backend (TODO)\n* A real time subscription end-point as a websocket (TODO)\n\n**Examples:**\n\nYou'll find in the `examples` folder Grape showcases for:\n\n* A comment thread with users, comments and likes\n* The same project implemented with Component (lifecycle management)\n\n\n## What's Implemented for the moment\n\n* Full REST Support\n* GraphQL + Relay READ layer\n* MongoDB backend\n\n\n## Roadmap\n\n* Support different datasources by resource\n* Real time subscriptions (probably using MongoDB tailable cursors + core.async channels with websocket)\n* GraphQL + Relay write support\n* Falcor support\n\n\n## License\n\nDistributed under the Eclipse Public License 1.0 (EPL-1.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyppan%2Fgrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyppan%2Fgrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyppan%2Fgrape/lists"}