Setup
/Project Structure
Project Structure
Open LangGraph Server integrates seamlessly into your existing JavaScript/TypeScript projects. While it's flexible about how you organize your code, following a consistent structure makes your project maintainable and easy to navigate.
This guide shows recommended folder structures for different frameworks and project types.
Hono.js Projects
For lightweight API servers with Hono.js, we recommend this structure:
Key Files
| File/Folder | Description |
|---|---|
src/agent/graph.ts | Your main LangGraph workflow definition |
src/agent/index.ts | Graph registration and export |
src/app.ts | Hono application setup with middleware |
src/routes/ | Additional API routes beyond LangGraph |
studio.ts | Studio configuration for testing (optional) |
Next.js Projects
For full-stack applications with Next.js:
Key Files
| File/Folder | Description |
|---|---|
app/api/langgraph/[...path]/route.ts | Next.js API route handler for LangGraph |
agent/graph.ts | Your LangGraph workflow |
agent/index.ts | Graph registration for the API route |
Built with
Show your support! Star us on GitHub ⭐️