coding-be

Implement Next.js App Router backend logic with Zod validation and Firestore transactions.

4|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/thuandiep1707/stitch-skill-copilot --skill coding-be-thuandiep1707
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-be
Source: https://github.com/thuandiep1707/stitch-skill-copilot/tree/main/skills/coding-be
Command: npx skills add https://github.com/thuandiep1707/stitch-skill-copilot --skill coding-be-thuandiep1707

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a structured, maintainable blueprint for building backend features in Next.js apps by linking validation, data access, and server actions into a cohesive, testable workflow.

Core Features & Use Cases

  • Architecture guarantees: Validation -> DAL -> Actions with strict type safety.
  • Security & reliability: JWT-based auth, idempotency for create operations, and audit logging.
  • Operational readiness: Support for Firestore transactions, revalidation of affected routes, and end-to-end testing of server-side logic.

Quick Start

Define a new feature by pairing a Zod schema, a Firestore DAL, and a server action in the expected paths, then validate, run, and test end-to-end.

Frequently Asked Questions about coding-be

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

FAQPage Schema
How do I implement type-safe server actions in Next.js App Router?

Build reliable Next.js server actions by chaining Zod schema validation, a Firestore Data Access Layer, and strict TypeScript. This enforces validation before data mutation, ensuring deterministic and testable backend logic execution.

How do I handle idempotency for create operations in Firestore?

Handle idempotency for Firestore create operations by enforcing unique constraints within server actions. This prevents duplicate document creation during network retries, ensuring deterministic data writes and maintaining data integrity across client retries.

What is the best way to structure backend validation and data access in Next.js?

The best way to structure backend validation is linking Zod schemas, a Data Access Layer, and server actions sequentially. This enforces strict type safety and creates a cohesive, maintainable, and testable backend workflow for Next.js applications.

How does route revalidation work with Firebase Storage and Firestore mutations?

Route revalidation works by triggering Next.js cache updates after Firestore transactions or Firebase Storage mutations complete. Server actions execute the data mutation and then revalidate affected routes to ensure the UI reflects the latest backend state.

Can I use JWT-based auth with Firestore transactions in server actions?

Yes, you can use JWT-based authentication with Firestore transactions inside server actions. This combination secures backend operations while maintaining atomic data writes, ensuring reliable auditing and strict type safety across the transaction.

Do I need Zod schemas for every Firestore server action?

Yes, Zod schemas are required for server actions to enforce strict runtime type safety. Validating inputs before they reach the Data Access Layer prevents malformed data from entering Firestore transactions and ensures reliable audit logging.