backend-coding

Implement backend architecture in Next.js with clean architecture, DDD, and tsyringe DI.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/yuji-sniper/next-vibe-template --skill backend-coding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-coding
Source: https://github.com/yuji-sniper/next-vibe-template/tree/main/.claude/skills/backend-coding
Command: npx skills add https://github.com/yuji-sniper/next-vibe-template --skill backend-coding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a clear blueprint for building maintainable, scalable backend logic in Next.js projects using clean architecture, domain-driven design (DDD), and a robust dependency injection pattern with tsyringe. It consolidates how to organize domain, application, and infrastructure layers, so teams can collaborate without tight coupling.

Core Features & Use Cases

  • Layered architecture guidance that separates Presentation, Application, Domain, and Infrastructure.
  • Server Action patterns with validation via Zod, error handling, and DTO usage to decouple layers.
  • Domain-driven entities, repositories, ports, and use cases with a focus on testability and transaction safety.
  • Drizzle ORM integration with MySQL, including schema organization, migrations, and repository implementations.
  • Centralized DI bindings and module wiring to simplify cross-module coordination.

Quick Start

Follow these steps to bootstrap a new module: create the domain, ports, use cases, and infrastructure folders; implement a repository with drizzle; bind dependencies in the DI container; initialize the app and run the dev server. Then invoke a sample server action to create and persist an example entity.

Frequently Asked Questions about backend-coding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a scalable Next.js backend with clean architecture?

Structure a scalable Next.js backend by separating Presentation, Application, Domain, and Infrastructure layers. Use domain-driven entities, ports, use cases, and repositories to decouple logic and ensure maintainable code.

Can I use Drizzle ORM with MySQL in a TypeScript domain-driven design project?

Yes, you can use Drizzle ORM with MySQL in a TypeScript domain-driven design project. Implement repository interfaces in the domain layer and concrete Drizzle repository classes in the infrastructure layer for database operations.

What is the best way to manage dependency injection in a Next.js server action?

Manage dependency injection in Next.js server actions using tsyringe. Centralize DI bindings in a container, wire modules cross-cutting, and resolve use cases dynamically to keep presentation logic decoupled from infrastructure.

How do I validate inputs and decouple layers in Next.js server actions?

Validate inputs and decouple layers in Next.js server actions using Zod for schema validation. Pass Data Transfer Objects (DTOs) between layers to ensure presentation logic remains independent from domain and application rules.

Do I need TypeScript and Zod to implement clean architecture in Next.js?

Yes, TypeScript and Zod are required to implement clean architecture in Next.js. TypeScript enforces type safety across layers, while Zod handles schema validation for server actions, ensuring robust and error-free data flow.