Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Template of NextJS Project using Hexagonal Architecture
Next Hexagonal Architecture is a free, open-source Next.js 15.4.1 boilerplate that enforces hexagonal architecture in a production-ready project setup. It is a template for building scalable applications with a clean separation of business logic, framework code, and UI.
Next Hexagonal Architecture is a Next.js starter template using the App Router and server components. It organizes source code into modules with dedicated domain, application, and infrastructure layers, plus a presentation layer in src/sections. The template runs on Bun as package manager and runtime, and is released under the MIT license.
src/modules with separate domain/, application/, and infrastructure/ folders per module, plus src/sections for the presentation layer.src/app.tailwind.config.ts along with src/styles/globals.css.src/components/ui.bun test, bun run cy:run, bun run cy:open).bun install and bun dev, then build features inside the modular structure.bun test for unit tests and bun run cy:run for Cypress E2E tests, with configuration files already present.bun run check to lint and format with Biome, and bun run check:fix to auto-fix issues.The template organizes code into modules under src/modules, each with application (use cases), domain (entities and interfaces), and infrastructure (external adapters). The presentation layer lives in src/sections, where feature components are grouped. To use it, clone the repo, run bun install, then start the dev server with bun dev at localhost:3000.
The template is free and open source, released under the MIT License.
Yes, it is open source under the MIT License, so you can use, modify, and distribute it without licensing fees.
Use bun install to install dependencies, bun dev to start the dev server, bun build for production builds, bun test for unit tests, and bun run cy:run for end-to-end tests.
Vitest with @testing-library/react and Happy-DOM powers unit tests, while Cypress handles end-to-end testing. Configuration files vitest.config.ts and cypress.config.ts are already in the project.
