Setting up your project
For the Business website template on Next.js 16 with Code graph. Only what your project uses, in the order to do it.
Build this guide for your project
1. Run the project
- 1Unzip the download and open a terminal in the folder. Run
npm install. - 2Run
npm run devand openhttp://localhost:3000. This is a Next.js 16 project (Turbopack by default); it needs Node 20 or newer. - 3The
README.mdinside the project repeats this guide under Go live, so you can hand the folder to someone else.
Pages in the Business website template
//products/pricing/about/support/contact/terms/privacy
2. Code graph (for coding agents)
Your project can describe itself as a graph: pages, the components on them, routes, server actions, database tables, env vars and dependencies, with the relationships between them. Coding agents query it instead of reading every file. Nothing about the running site changes.
Values you will paste into .env.local
NEO4J_URIBolt URI of your Neo4j instance, e.g. neo4j://localhost:7687 or the neo4j+s:// URI from Aura. Only needed for npm run graph:push.NEO4J_USERDatabase user. Defaults to neo4j.NEO4J_PASSWORDDatabase password.Secret.
Build the graph
- 1Run
npm run graph. It writesgraph/nodes.jsonl,graph/edges.jsonlandgraph/import.cypherin about a second, and also runs automatically beforenpm run dev. - 2Open
graph/SCHEMA.mdfor the node labels, relationships and ready-made queries. - 3While working,
npm run graph:watchin a second terminal keeps the graph current as files change.
Load it into Neo4j
- 1Get a database: Neo4j Desktop (local app), Docker (
docker run -p 7474:7474 -p 7687:7687 -e NEO4J_AUTH=neo4j/your-password neo4j), or a free Aura instance. - 2Add the connection to
.env.local: - 3Run
npm run graph:push. It merges nodes and edges, so re-running after changes updates in place. - 4Open Neo4j Browser (
http://localhost:7474locally) and try a query fromgraph/SCHEMA.md, for exampleMATCH (p:Page)-[:CONTAINS*]->(c:Component) RETURN p.title, count(c).
NEO4J_URI=neo4j://localhost:7687 NEO4J_USER=neo4j NEO4J_PASSWORD=your-neo4j-password
No Neo4j? The JSONL files are plain data; any agent can read them directly, and import.cypher pastes into any Cypher console.
Point a coding agent at it
- 1
AGENTS.mdin the project root explains the layout, conventions and how to use the graph. Claude Code, Cursor and Codex read it automatically. - 2For live queries, run the official Neo4j MCP server (
mcp-neo4j-cypher) against your database and add it to the agent's MCP config. The agent can then ask questions like “which modules write to the subscribers table?” in Cypher.
What was added to your project
scripts/extract_graph.mjs (+ extract_graph.js alias), scripts/graph_push.mjsgraph/SCHEMA.md, graph/spec-graph.jsonthe graph section of AGENTS.mdnpm scripts: graph, graph:watch, graph:push, predev
If something goes wrong
npm run graph:pushsays NEO4J_URI is not set: Add the three NEO4J_ values to.env.local. Pushing is optional;npm run graphalone writes the files.- Connection refused on push: Neo4j isn't running, or the URI scheme is wrong. Local:
neo4j://localhost:7687. Aura: use theneo4j+s://URI from the console. - The graph is missing something I just wrote: Run
npm run graphagain (or keepnpm run graph:watchrunning). The extractor scansapp/,components/,lib/andemails/.
Missing something? See the full reference. Back to the builder