How emmanuelonah/nextjs-project-architecture-template works
Main Components
a) Application Layers (Primary Components):
• View Layer (Next.js Pages/Components)
• Presenter Layer (Hooks/Controllers)
• Model Layer (Data/Business Logic)
• Design System
• Global Store
• Services Layer
b) Supporting Infrastructure:
• Testing Infrastructure
• Build/Deploy Pipeline
• External Services Integration
[View Layer] <- -> [Presenter Layer] <- -> [Model Layer]
Detailed Component Breakdown
A. View Layer (Left Column):
• Sub-components:
• Pages (/src/app/*)
• Shared Components (/src/components/shared)
• Layouts (/src/layouts)
• Design System Integration
B. Presenter Layer (Middle Column):
• Sub-components:
• Custom Hooks (/src/hooks)
• Presenters (*.presenter.ts files)
• Utils (/src/utils)
C. Model Layer (Right Column):
• Sub-components:
• Models (/src/models)
• HTTP Services (/src/services)
• Data Types (/src/@types)
D. Supporting Systems (Bottom Section):
• Global Store (/src/globalstore)
• Design System (/src/design-system)
• Testing Infrastructure (/src/mocks)
Connection and Flow Representation
• Bidirectional communication between View and Presenter
• Bidirectional communication between Presenter and Model
• No direct connection between View and Model (enforcing MVP)
• Design System influence on View components
• Global Store interactions
Additional Elements
• External integrations (RadixUI, Styled-components)
• Build/Deploy pipeline (Git Actions)
• Testing coverage requirements (80% minimum)
Notes Section
A notes section mentioning:
• MVP architecture principles
• Testing trophy pattern
• Code conventions
• File naming conventions