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

Providers
Next.js

1. Run the project

  1. 1Unzip the download and open a terminal in the folder. Run npm install.
  2. 2Run npm run dev and open http://localhost:3000. This is a Next.js 16 project (Turbopack by default); it needs Node 20 or newer.
  3. 3The README.md inside 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

  1. 1Run npm run graph. It writes graph/nodes.jsonl, graph/edges.jsonl and graph/import.cypher in about a second, and also runs automatically before npm run dev.
  2. 2Open graph/SCHEMA.md for the node labels, relationships and ready-made queries.
  3. 3While working, npm run graph:watch in a second terminal keeps the graph current as files change.

Load it into Neo4j

  1. 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.
  2. 2Add the connection to .env.local:
  3. 3Run npm run graph:push. It merges nodes and edges, so re-running after changes updates in place.
  4. 4Open Neo4j Browser (http://localhost:7474 locally) and try a query from graph/SCHEMA.md, for example MATCH (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. 1AGENTS.md in the project root explains the layout, conventions and how to use the graph. Claude Code, Cursor and Codex read it automatically.
  2. 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.mjs
  • graph/SCHEMA.md, graph/spec-graph.json
  • the graph section of AGENTS.md
  • npm scripts: graph, graph:watch, graph:push, predev

If something goes wrong

  • npm run graph:push says NEO4J_URI is not set: Add the three NEO4J_ values to .env.local. Pushing is optional; npm run graph alone writes the files.
  • Connection refused on push: Neo4j isn't running, or the URI scheme is wrong. Local: neo4j://localhost:7687. Aura: use the neo4j+s:// URI from the console.
  • The graph is missing something I just wrote: Run npm run graph again (or keep npm run graph:watch running). The extractor scans app/, components/, lib/ and emails/.

Missing something? See the full reference. Back to the builder