Frontend Foundation is designed as a long-lived, swap-friendly Next.js starter. Its primary goal is to ensure that UI code is never coupled to:
This enables teams to evolve technology choices without refactoring UI or business logic.
UI components never import:
Instead, UI interacts only with hooks and services.
This repository follows hexagonal principles without academic folder names.
The separation exists by responsibility, not by theory labels.
This mirrors how modern production frontends are actually built.
Every major concern is isolated behind a boundary:
No UI changes are required when swaps occur.
src/app - Routing and layouts only. No business logic.
src/components - Pure presentational components. No side effects.
src/hooks - The ONLY API UI code is allowed to consume.
Example: useAuth, useTheme, useDashboard.
src/services - Business intent and orchestration.
Example: loginUser, loadDashboardData.
src/clients - Low-level adapters for HTTP, CMS, or external services.
src/stores - State adapters. Storage mechanism is irrelevant to consumers.
This structure: