Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Learn to use AWS Neptune Analytics with Next.js API Routes for graph database operations.
AWS Neptune Analytics with Next.js API Routes is a Vercel starter template that demonstrates how to build a Next.js application performing CRUD operations on an AWS Neptune Analytics graph database using OpenCypher queries.
This template is a Next.js application that creates, reads, updates, and deletes graph nodes and edges in AWS Neptune Analytics through RESTful API Routes. It takes a graph ID and AWS credentials as input and produces a working web app with API endpoints that issue OpenCypher queries to the graph database. The template runs on Next.js with Tailwind CSS for styling and is published in the Vercel examples repository maintained by Vercel and the Next.js team.
The template reads the GRAPH_ID and AWS credentials from environment variables, then instantiates NeptuneGraphClient at runtime. Each API route uses that client to run an OpenCypher query (matching a node or edge by ID, creating a label, or deleting relationships) and returns JSON results to the browser. To run locally, create a graph in Neptune Analytics, set GRAPH_ID in .env.local, and start the dev server. To deploy, use the Vercel button and supply the graph ID as an environment variable.
This is an open-source example in the Vercel examples repository, so the template code is free to use. AWS Neptune Analytics itself is a paid AWS service, so costs depend on the graph configuration you provision.
The README specifies an IAM role with permissions neptune-graph:ReadDataViaQuery, neptune-graph:WriteDataViaQuery, and neptune-graph:DeleteDataViaQuery.
Yes, Option 1 lets you retrieve an existing graph ID and deploy directly with the Vercel button, which sets the GRAPH_ID environment variable automatically.
Follow Option 2: create an IAM role with the required permissions, create a Neptune Analytics graph with a public endpoint and 16 NCUs, then save the graph ID into an .env.local file for local development.
