Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Authoring Interactive APIs Using Neo4j Swagger

DZone's Guide to

Authoring Interactive APIs Using Neo4j Swagger

· Java Zone
Free Resource

Try Okta to add social login, MFA, and OpenID Connect support to your Java app in minutes. Create a free developer account today and never build auth again.

When developing web applications it becomes very useful to start by authoring an API over your data model in order to expose certain services to data-driven components of your front-end application.

For Neo4j, the best API authoring solution out there is Neo4j Swagger.

What does Neo4j Swagger do?

Neo4j Swagger is an API authoring solution that runs exclusively on top of a Neo4j graph database and was created by Mat Tyndal as an open-source project forked from Swagger.

Swagger is a Node.js open-source project that enables you to author interactive APIs on top of your data model.

What does the architecture look like?


Your front-end web app, which looks like this:

http://neo4jmovies.herokuapp.com
https://github.com/kbastani/neo4j-app-movies-ui

Makes HTTP REST requests to Neo4j Swagger, which looks like this:

http://movieapi-neo4j.herokuapp.com/
https://github.com/kbastani/node-neo4j-swagger-api

Which then makes parameterized Cypher queries to a Neo4j database instance, which can be easily hosted in the cloud on either http://graphhost.com/ or http://www.graphenedb.com/

Neo4j then returnsresultstoSwagger, which then returnsresults back to your web app.

That's it. It's a super simple architecture and it's all open-source and ready for you to start programming with. You can clone my movie recommendation example app in the links above.

If you're interested in reviewing some slides from a recent talk I did about authoring this API and front-end application, head on over to SlideShare: http://www.slideshare.net/KennyBastani/building-killer-apps-with-neo4j-20


Build and launch faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Published at DZone with permission of Kenny Bastani, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}