Documentation

Guides and references

Developer Experience

Project Structure

NextBento directory layout and conventions.

Overview

NextBento follows the Next.js App Router with a feature-based organization.

Root Directory

nextbento/
├── app/                  # App Router (pages, layouts, API)
├── components/           # React components
├── content/              # MDX (blog, docs, pseo)
├── hooks/                # Custom React hooks
├── lib/                  # Utilities and business logic
├── public/                # Static assets
├── scripts/              # Build and utility scripts
├── supabase/             # Migrations and config
├── __tests__/            # Test files
├── middleware.ts         # Next.js middleware
├── next.config.js
├── tailwind.config.ts
├── jest.config.js        # Jest config
└── package.json

App Directory

PathDescription
(auth)/Login, signup, forgot/reset password
(dashboard)/Dashboard, admin, settings, apps
(pseo)/Programmatic SEO pages
api/API routes
blog/Blog index and posts
docs/Documentation portal
landing-1/Landing 1 components
landing-2/Landing 2 page and components
sitemap.xml/, sitemaps/Sitemap routes
robots.tsRobots.txt

Components

PathDescription
auth/Auth forms
emails/React Email templates
landing/Landing sections (if used)
seo/Structured data component
ui/shadcn/ui components
app-sidebar.tsx, site-header.tsxDashboard layout

Lib

PathDescription
config/env, constants, auth-layouts, site-url
auth/Auth error handling
blog/Blog post loading
email/Resend service
indexnow/IndexNow client
middleware/CORS, rate limiting
pseo/PSEO engine
seo/Metadata, schema, sitemap
stripe/Stripe client
supabase/Supabase clients
subscriptions/Subscription logic
teams/Team access control

Content

PathDescription
blog/MDX blog posts
docs/MDX documentation
pseo/pages.jsonPSEO page data

Conventions

  • Use @/ alias for imports
  • Colocate route-specific components with routes
  • Shared UI in components/ui/
  • API routes in app/api/*/route.ts