{"id":13514912,"url":"https://github.com/crnk-project/crnk-framework","last_synced_at":"2025-04-12T15:36:39.311Z","repository":{"id":21044705,"uuid":"91683656","full_name":"crnk-project/crnk-framework","owner":"crnk-project","description":"JSON API library for Java","archived":false,"fork":false,"pushed_at":"2023-10-19T19:21:14.000Z","size":9415,"stargazers_count":287,"open_issues_count":242,"forks_count":156,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-29T17:39:34.020Z","etag":null,"topics":["java","jax-rs","jpa","json-api","low-code","opentracing","rest-api","restful-api","spring-boot","spring-data-rest"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crnk-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2017-05-18T11:06:31.000Z","updated_at":"2024-09-19T01:25:22.000Z","dependencies_parsed_at":"2024-06-02T01:42:54.526Z","dependency_job_id":"6dbd7647-45c7-4ef2-a2a2-a94fc33e5bae","html_url":"https://github.com/crnk-project/crnk-framework","commit_stats":{"total_commits":810,"total_committers":69,"mean_commits":11.73913043478261,"dds":0.337037037037037,"last_synced_commit":"4e4dd8970d2bc1bb63970093e2049689d6189f30"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crnk-project%2Fcrnk-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crnk-project%2Fcrnk-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crnk-project%2Fcrnk-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crnk-project%2Fcrnk-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crnk-project","download_url":"https://codeload.github.com/crnk-project/crnk-framework/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248590388,"owners_count":21129805,"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":["java","jax-rs","jpa","json-api","low-code","opentracing","rest-api","restful-api","spring-boot","spring-data-rest"],"created_at":"2024-08-01T05:01:03.628Z","updated_at":"2025-04-12T15:36:39.273Z","avatar_url":"https://github.com/crnk-project.png","language":"Java","funding_links":[],"categories":["Java","开发框架"],"sub_categories":[],"readme":"# crnk.io - Crank up the development of RESTful applications!\n\n[![Build Status](https://github.com/crnk-project/crnk-framework/workflows/build/badge.svg)](https://github.com/crnk-project/crnk-framework/actions)\n[![Gitter](https://img.shields.io/gitter/room/crkn-io/lobby.svg)](https://gitter.im/crnk-io/Lobby)\n[![License](https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg)](https://github.com/crnk-project/crnk-framework/blob/master/LICENSE.txt)\n[![Coverage Status](https://coveralls.io/repos/github/crnk-project/crnk-framework/badge.svg?branch=master)](https://coveralls.io/github/crnk-project/crnk-framework?branch=master)\n[![maven-central](https://img.shields.io/maven-central/v/io.crnk/crnk-core)](https://search.maven.org/artifact/io.crnk/crnk-core)\n\n## What is Crnk?\n\nCrnk is an implementation of the [JSON API](https://jsonapi.org/) specification and recommendations in Java to\nfacilitate building RESTful applications. It provides many conventions and building blocks that application can benefit from.\nThis includes features such as  sorting, filtering, pagination, requesting complex object graphs, sparse\nfield sets, attaching links to data or atomically execute multiple operations. Further integration\nwith frameworks and libraries such as Spring, CDI, JPA, Bean Validation, Dropwizard, Servlet API, Zipkin and\nand more ensure that JSON API plays well together with the Java ecosystem. Have a look at\n[www.crnk.io](http://www.crnk.io) and the  [documentation](http://www.crnk.io/releases/stable/documentation/) for more detailed\ninformation.\n\nRelease notes can be found in http://www.crnk.io/releases/.\n\n## Repository\n\nCrnk Maven artifacts are available from jcenter/bintray: \u003ca href=\"https://bintray.com/crnk-project\"\u003ehttps://bintray.com/crnk-project\u003c/a\u003e.\n\nNote that due to reliability issues of MavenCentral we only rarely publish there.\n\n\n## Requirements\n\nCrnk requires Java 1.8 or later and an SLF4J setup for logging.\n\n## Example\n\nSee https://github.com/crnk-project/crnk-example/\n\nGradle `settings.gradle` can look like:\n\n```\ngradle.beforeProject { Project project -\u003e\n    project.with {\n        buildscript {\n            repositories {\n                jcenter()\n                // maven { url 'https://dl.bintray.com/crnk-project/mavenLatest/' }\n            }\n        }\n        repositories {\n            jcenter()\n            // maven { url 'https://dl.bintray.com/crnk-project/mavenLatest/' }\n        }\n    }\n}\n```\n\nand the `build.gradle`:\n\n```\ndependencies {\n    implementation platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')\n    annotationProcessor platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')\n\n    annotationProcessor 'io.crnk:crnk-gen-java'\n\n    implementation \"io.crnk:crnk-setup-spring-boot2\"\n    implementation \"io.crnk:crnk-data-jpa\"\n    implementation \"io.crnk:crnk-data-facet\"\n    implementation \"io.crnk:crnk-format-plain-json\"\n    implementation \"io.crnk:crnk-validation\"\n    implementation \"io.crnk:crnk-home\"\n    implementation \"io.crnk:crnk-ui\"\n    implementation \"io.crnk:crnk-operations\"\n    implementation \"io.crnk:crnk-security\"\n}\n```\n\nand a basic Java example:\n\n```\n@JsonApiResource(type = \"vote\")\n@Data\npublic class Vote {\n\n    @JsonApiId\n    private UUID id;\n\n    private int stars;\n\n}\n\npublic class VoteRepository extends ResourceRepositoryBase\u003cVote, UUID\u003e {\n\n    public Map\u003cUUID, Vote\u003e votes = new ConcurrentHashMap\u003c\u003e();\n\n    public VoteRepository() {\n        super(Vote.class);\n    }\n\n    @Override\n    public ResourceList\u003cVote\u003e findAll(QuerySpec querySpec) {\n        return querySpec.apply(votes.values());\n    }\n\n    @Override\n    public \u003cS extends Vote\u003e S save(S entity) {\n        votes.put(entity.getId(), entity);\n        return null;\n    }\n\n    @Override\n    public void delete(UUID id) {\n        votes.remove(id);\n    }\n}\n```\n\nor with JPA:\n\n```\n@JsonApiResource(type = \"person\")\n@Entity\n@Data\npublic class PersonEntity {\n\n\t@Id\n\tprivate UUID id;\n\n\tprivate String name;\n\n\tprivate int year;\n\n\t@OneToMany(mappedBy = \"movie\")\n\tprivate List\u003cRoleEntity\u003e roles = new ArrayList\u003c\u003e();\n\n\t@Version\n\tprivate Integer version;\n}\n\npublic class PersonRepository extends JpaEntityRepositoryBase\u003cPersonEntity, UUID\u003e {\n\n\tpublic PersonRepository() {\n\t\tsuper(PersonEntity.class);\n\t}\n\n\t@Override\n\tpublic PersonEntity save(PersonEntity entity) {\n\t\t// add your save logic here\n\t\treturn super.save(entity);\n\t}\n\n\t@Override\n\tpublic PersonEntity create(PersonEntity entity) {\n\t\t// add your create logic here\n\t\treturn super.create(entity);\n\t}\n\n\t@Override\n\tpublic void delete(UUID id) {\n\t\t// add your save logic here\n\t\tsuper.delete(id);\n\t}\n}\n```\n\nCrnk integrates well with many frameworks. Have a look\nat the  [documentation](http://www.crnk.io/releases/stable/documentation/)\nand carefully choose what you need. Don't hesitate to ask for help and suggest\nimprovements!\n\n## Licensing\n\nCrnk is licensed under the Apache License, Version 2.0.\nYou can grab a copy of the license at http://www.apache.org/licenses/LICENSE-2.0.\n\n\n## Building from Source\n\nCrnk make use of Gradle for its build. To build the complete project run\n\n    gradlew clean build\n\nNote as part of the build a local Node installation is downloaded to build the frontend parts (crnk-ui) of the project.\n\n\n## Links\n\n* [Homepage](http://www.crnk.io)\n* [Documentation](http://www.crnk.io/releases/stable/documentation/)\n* [Source code](https://github.com/crnk-project/crnk-framework/)\n* [Issue tracker](https://github.com/crnk-project/crnk-framework/issues)\n* [Forum](https://gitter.im/crnk-io/Lobby)\n* [Build](https://github.com/crnk-project/crnk-framework/actions)\n\n\n## Endorsements\n\n[![YourKit](https://www.yourkit.com/images/yklogo.png)](https://www.yourkit.com/youmonitor/)\n\nWe thank YourKit for supporting open source projects with profiler and monitoring tooling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrnk-project%2Fcrnk-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrnk-project%2Fcrnk-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrnk-project%2Fcrnk-framework/lists"}