All Projects → crnk-project → Crnk Framework

crnk-project / Crnk Framework

Licence: apache-2.0
JSON API library for Java

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Crnk Framework

Kotlin Spring Boot Jpa Rest Api Demo
Build a Restful API with Kotlin, Spring Boot, Mysql, Jpa and Hibernate
Stars: ✭ 67 (-71.37%)
Mutual labels:  rest-api, jpa, spring-boot
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-23.93%)
Mutual labels:  rest-api, restful-api, jax-rs
Hikaku
A library that tests if the implementation of a REST-API meets its specification.
Stars: ✭ 154 (-34.19%)
Mutual labels:  rest-api, restful-api, jax-rs
Cerberus
A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+105.98%)
Mutual labels:  rest-api, restful-api, spring-boot
Spring Boot Sample App
Sample app generated from my spring boot archtype on :https://github.com/Romeh/spring-boot-quickstart-archtype
Stars: ✭ 81 (-65.38%)
Mutual labels:  rest-api, jpa, spring-boot
Jersey Jwt
Example of REST API with JWT authentication using Jersey, Jackson, Undertow, Weld, Hibernate and Arquillian.
Stars: ✭ 131 (-44.02%)
Mutual labels:  rest-api, jax-rs, jpa
Spring Boot Postgresql Jpa Hibernate Rest Api Demo
Building RESTful APIs with Spring Boot, PostgreSQL, JPA and Hibernate
Stars: ✭ 209 (-10.68%)
Mutual labels:  rest-api, jpa, spring-boot
Mockinizer
An okhttp / retrofit api call mocking library
Stars: ✭ 176 (-24.79%)
Mutual labels:  rest-api, restful-api
Springboot Restful Starter
SpringBoot RESTful API 脚手架
Stars: ✭ 176 (-24.79%)
Mutual labels:  restful-api, spring-boot
Okta Spring Boot React Crud Example
Simple CRUD with React and Spring Boot 2.0
Stars: ✭ 176 (-24.79%)
Mutual labels:  jpa, spring-boot
Mcloud
基于Spring Cloud,实现微服务中常用的基础模块,包括 OAuth2 认证服务,统一注册中心,系统监控中心, 统一配置中心,API网关以及熔断器
Stars: ✭ 185 (-20.94%)
Mutual labels:  rest-api, spring-boot
Finale
Create flexible REST endpoints and controllers from Sequelize models in your Express app
Stars: ✭ 167 (-28.63%)
Mutual labels:  rest-api, restful-api
Spring Boot Leaning
Spring Boot 2.X 最全课程代码
Stars: ✭ 2,008 (+758.12%)
Mutual labels:  jpa, spring-boot
Nginx upstream module
Tarantool NginX upstream module (REST, JSON API, websockets, load balancing)
Stars: ✭ 157 (-32.91%)
Mutual labels:  rest-api, json-api
Restful Api With Laravel Definitive Guide
Repository with the base code for the course "RESTful API with Laravel - Definitive-Guide"
Stars: ✭ 156 (-33.33%)
Mutual labels:  rest-api, restful-api
Jax Rs Performance Comparison
⚡️ Performance Comparison of Jax-RS implementations and embedded containers
Stars: ✭ 181 (-22.65%)
Mutual labels:  jax-rs, spring-boot
Jpa Hibernate Tutorials
Hibernate Tutorials with Spring Boot and Spring-Data-JPA
Stars: ✭ 186 (-20.51%)
Mutual labels:  jpa, spring-boot
Graphql2rest
GraphQL to REST converter: automatically generate a RESTful API from your existing GraphQL API
Stars: ✭ 181 (-22.65%)
Mutual labels:  rest-api, restful-api
Blogbackendproject
Backend code for my blogs, develop with Django Rest framework.
Stars: ✭ 204 (-12.82%)
Mutual labels:  rest-api, restful-api
Event Driven Spring Boot
Example Application to demo various flavours of handling domain events in Spring Boot
Stars: ✭ 194 (-17.09%)
Mutual labels:  rest-api, spring-boot

crnk.io - Crank up the development of RESTful applications!

Build Status Gitter License Coverage Status

Bintray release on jcenter
Bintray latest in private repository

What is Crnk?

Crnk is an implementation of the JSON API specification and recommendations in Java to facilitate building RESTful applications. It provides many conventions and building blocks that application can benefit from. This includes features such as sorting, filtering, pagination, requesting complex object graphs, sparse field sets, attaching links to data or atomically execute multiple operations. Further integration with frameworks and libraries such as Spring, CDI, JPA, Bean Validation, Dropwizard, Servlet API, Zipkin and and more ensure that JSON API plays well together with the Java ecosystem. Have a look at www.crnk.io and the documentation for more detailed information.

Release notes can be found in http://www.crnk.io/releases/.

Repository

Crnk Maven artifacts are available from jcenter/bintray: https://bintray.com/crnk-project.

Note that due to reliability issues of MavenCentral we only rarely publish there.

Requirements

Crnk requires Java 1.8 or later and an SLF4J setup for logging.

Example

See https://github.com/crnk-project/crnk-example/

Gradle settings.gradle can look like:

gradle.beforeProject { Project project ->
    project.with {
        buildscript {
            repositories {
                jcenter()
                // maven { url 'https://dl.bintray.com/crnk-project/mavenLatest/' }
            }
        }
        repositories {
            jcenter()
            // maven { url 'https://dl.bintray.com/crnk-project/mavenLatest/' }
        }
    }
}

and the build.gradle:

dependencies {
    implementation platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')
    annotationProcessor platform('io.crnk:crnk-bom:INSERT_VERSION_HERE')

    annotationProcessor 'io.crnk:crnk-gen-java'

    implementation "io.crnk:crnk-setup-spring-boot2"
    implementation "io.crnk:crnk-data-jpa"
    implementation "io.crnk:crnk-data-facet"
    implementation "io.crnk:crnk-format-plain-json"
    implementation "io.crnk:crnk-validation"
    implementation "io.crnk:crnk-home"
    implementation "io.crnk:crnk-ui"
    implementation "io.crnk:crnk-operations"
    implementation "io.crnk:crnk-security"
}

and a basic Java example:

@JsonApiResource(type = "vote")
@Data
public class Vote {

    @JsonApiId
    private UUID id;

    private int stars;

}

public class VoteRepository extends ResourceRepositoryBase<Vote, UUID> {

    public Map<UUID, Vote> votes = new ConcurrentHashMap<>();

    public VoteRepository() {
        super(Vote.class);
    }

    @Override
    public ResourceList<Vote> findAll(QuerySpec querySpec) {
        return querySpec.apply(votes.values());
    }

    @Override
    public <S extends Vote> S save(S entity) {
        votes.put(entity.getId(), entity);
        return null;
    }

    @Override
    public void delete(UUID id) {
        votes.remove(id);
    }
}

or with JPA:

@JsonApiResource(type = "person")
@Entity
@Data
public class PersonEntity {

	@Id
	private UUID id;

	private String name;

	private int year;

	@OneToMany(mappedBy = "movie")
	private List<RoleEntity> roles = new ArrayList<>();

	@Version
	private Integer version;
}

public class PersonRepository extends JpaEntityRepositoryBase<PersonEntity, UUID> {

	public PersonRepository() {
		super(PersonEntity.class);
	}

	@Override
	public PersonEntity save(PersonEntity entity) {
		// add your save logic here
		return super.save(entity);
	}

	@Override
	public PersonEntity create(PersonEntity entity) {
		// add your create logic here
		return super.create(entity);
	}

	@Override
	public void delete(UUID id) {
		// add your save logic here
		super.delete(id);
	}
}

Crnk integrates well with many frameworks. Have a look at the documentation and carefully choose what you need. Don't hesitate to ask for help and suggest improvements!

Licensing

Crnk is licensed under the Apache License, Version 2.0. You can grab a copy of the license at http://www.apache.org/licenses/LICENSE-2.0.

Building from Source

Crnk make use of Gradle for its build. To build the complete project run

gradlew clean build

Note as part of the build a local Node installation is downloaded to build the frontend parts (crnk-ui) of the project.

Links

Endorsements

YourKit

We thank YourKit for supporting open source projects with profiler and monitoring tooling.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].