Directory layout
Routing directories
app/
The app/ directory contains pages and API routes. The file path maps directly to the URL:
| File | URL |
|---|---|
app/page.tsx | / |
app/about/page.tsx | /about |
app/blog/[slug]/page.tsx | /blog/:slug |
app/api/users/route.ts | /api/users |
page.tsx (or page.mdx). API routes use route.ts. Layouts use layout.tsx.
See Pages & Routing for the full routing system.
Auto-discovered directories
These directories are scanned automatically at startup. Every file with a default export is registered.| Directory | Purpose | Import |
|---|---|---|
agents/ | AI agent definitions | veryfront/agent |
tools/ | Tool definitions with Zod schemas | veryfront/tool |
prompts/ | Prompt templates | veryfront/prompt |
workflows/ | Multi-step workflow DAGs | veryfront/workflow |
resources/ | MCP-exposable resources | veryfront/resource |
agents/assistant.ts registers as "assistant" and can be retrieved with getAgent("assistant").
Customizing discovery paths
Override the default directories inveryfront.config.ts:
Convention directories
These directories aren’t auto-discovered but follow standard conventions:| Directory | Purpose |
|---|---|
components/ | Shared React components |
lib/ | Shared utilities and business logic |
content/ | Static content (MDX, JSON, YAML) |
public/ | Static assets served at root path |
styles/ | Global CSS files |
middleware/ | Custom middleware functions |
Special files
| File | Purpose |
|---|---|
app/layout.tsx | Root layout wrapping all pages |
app/error.tsx | Error boundary for the app |
app/not-found.tsx | Custom 404 page |
veryfront.config.ts | Framework configuration |
package.json | Dependencies and metadata |
Why flat?
Veryfront is an AI-native framework. Agents, tools, prompts, and workflows are first-class primitives, not add-ons tucked inside a subfolder. Keeping them at the project root makes them visible and accessible, just likecomponents/ or lib/.
Next
- Pages & Routing: file-based routing, layouts, and dynamic routes
- Agents: create your first AI agent
Related
- Configuration:
veryfront.config.tsoptions veryfront(root): core framework API reference