Skip to content

Java framework for mobile and web applications based on the graph database Neo4j

License

Notifications You must be signed in to change notification settings

Jim-Salmons/structr

 
 

Repository files navigation

The structr project

Build Status

structr (pronounce it like 'structure') is a Java framework for mobile and web applications based on the graph database Neo4j. It was designed to simplify the creation of complex graph database applications by providing a comprehensive Java API and a set of features common to most use cases. This enables developers to build a sophisticated web or mobile app based on Neo4j within hours.

Main features

  • highly configurable RESTful API using Java beans
  • data integrity and validation constraints
  • Cypher Query Language support
  • access control
  • search/spatial search
  • CRON-jobs for background agents

Awards

structr was awarded with the Graphie Award for the Most Innovative Open Source Graph Application in 2012.

Getting started

structr uses Apache Maven, so you can use Maven to get a demo project up and running in 5 minutes with our simple example archetype.

Examples

A simple “city” entity in Java..

public class City extends AbstractNode {

	// define a 1:n relationship between “City” and “Person”
	public static final Property<List<Person>> persons =

		new CollectionProperty<Person>(
			"persons",               // the name of the property
			Person.class,            // the end node type
			RelType.LIVES_IN,        // the relationship type
			Direction.INCOMING,      // the direction
			true                     // 1:n instead of n:m
		);

	// define the public view of a City to contain name and persons
	public static final View publicView = new View(Person.class, PropertyView.Public,
		name, persons
	);
}

.. its creation via REST using the demo server

curl -si http://0.0.0.0:8082/structr/rest/cities -XPOST -d '{"name":"Berlin"}'

HTTP/1.1 201 Created                                                                                                                                                                                                                                         
Content-Type: application/json; charset=UTF-8                                                                                                                                                                                                                
Location: http://0.0.0.0:8082/structr/rest/cities/2fe1180289db49f59827f9a88aefa707                                                                                                                                                                           
Transfer-Encoding: chunked                                                                                                                                                                                                                                   
Server: Jetty(8.1.0.RC5)                                                                                                                                                                                                                                     

..and its JSON output

curl -si http://0.0.0.0:8082/structr/rest/cities

HTTP/1.1 200 OK                                                                                                                                                                                                                                              
Content-Type: application/json; charset=utf-8                                                                                                                                                                                                                
Transfer-Encoding: chunked                                                                                                                                                                                                                                   
Server: Jetty(8.1.0.RC5)                                                                                                                                                                                                                                                                                                                                               

{                                                                                                                                                                                                                                                            
	"query_time": "0.071098661",                                                                                                                                                                                                                               
	"result_count": 1,                                                                                                                                                                                                                                         
	"result": [                                                                                                                                                                                                                                                
		{
			"id": "2fe1180289db49f59827f9a88aefa707",
			"name": "Berlin",
			"persons": []
		}
	],
	"serialization_time": "0.000401979"
}

Components

There are these two main components: structr Server and structr UI.

structr Server provides libraries and modules building the backend.

structr UI is a frontend for CRUD operations and basic CMS functionalitiy, e.g. for handling pages, files, images, users/groups.

Learn more

For updates and news around structr, follow @structr on Twitter.

Contribute

For submitting feature requests or bug report, please use Github's issue tracking system.

In order to contribute to structr, you must sign the structr Contributor’s License Agreement, which can be found here.

Authors

Copyright and License

Copyright 2010-2013 Axel Morgner structr is licensed under the GPLv3 and AGPLv3 (structr UI).

About

Java framework for mobile and web applications based on the graph database Neo4j

Resources

License

Stars

Watchers

Forks

Packages

No packages published