How mariariosnavarro/next-payloadcms-app works
Main System Components
a) Frontend Layer (Next.js):
• Represented by a blue rectangle labeled "Frontend (Next.js)"
• (frontend) route structure under src/app/(frontend)
b) Admin Panel Layer:
• This parallel to the frontend
• Represented by a green rectangle labeled "Payload Admin Panel"
• Connected to the src/app/(payload)/admin structure
c) API Layer:
• This in the middle
• Represented by a yellow rectangle containing:
• REST API endpoints (/api/[...slug])
• GraphQL endpoint (/api/graphql)
• GraphQL Playground
d) Collections Layer:
• This near the bottom
• Represented by an orange rectangle showing:
• Users
• Posts
• Media
e) Database Layer:
• At the bottom
Component Relationships
• Frontend → API Layer (REST/GraphQL requests)
• Admin Panel → API Layer (CMS operations)
• API Layer → Collections Layer (data operations)
• Collections Layer → Database Layer (persistence)
Special Architectural Elements
• beforeOperation
• beforeValidate
• beforeChange
• afterChange
• beforeDelete
• afterDelete
• afterRead
• afterError
Technical Stack Indicators
• Next.js 13+ (App Router)
• Payload CMS
• TypeScript
• SCSS/Tailwind
• GraphQL
Key Design Patterns
Highlight:
• Route Groups ((frontend) and (payload))
• API Routes structure
• Collection-based data modeling
[Frontend Layer (Next.js)] -----> [Admin Panel Layer]
• ↓ ↓
• → [API Layer] ←────┘
• ↓
• [Collections Layer]
• ↓
• [Database Layer]
[Hooks System Panel] [Technical Stack]
Important Considerations:
Clear separation between
• Client-side components
• Server-side components
• API endpoints
• Data storage
A small section showing the build/deployment setup
• Docker configuration
• Environment variables
• Next.js configuration