nextjs-saas-structure

Organize Next.js App Router SaaS projects with feature-based folder structures.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/gabrielnadoncanada/saas-starter --skill nextjs-saas-structure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-saas-structure
Source: https://github.com/gabrielnadoncanada/saas-starter/tree/main/.agents/skills/nextjs-saas-structure
Command: npx skills add https://github.com/gabrielnadoncanada/saas-starter --skill nextjs-saas-structure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a clear, pragmatic folder structure and code placement strategy for Next.js App Router SaaS projects, reducing cognitive overhead and improving maintainability.

Core Features & Use Cases

  • Optimized Folder Structure: Defines clear responsibilities for app/, features/, and shared/ directories.
  • Feature-Based Organization: Encourages domain-specific logic within features/<feature>/.
  • Server/Client Boundaries: Guides the separation of server-only code (server/) from client components.
  • Use Case: When starting a new Next.js SaaS project or refactoring an existing one, use this Skill to establish a clean, scalable, and easy-to-understand file organization that promotes rapid development and low maintenance.

Quick Start

Use the nextjs-saas-structure skill to organize a new Next.js project by following its default structure and folder responsibilities.

Frequently Asked Questions about nextjs-saas-structure

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

FAQPage Schema
How do I organize a Next.js SaaS folder structure using the App Router?

Next.js App Router SaaS projects use a pragmatic folder structure that divides code into `app/`, `features/`, and `shared/` directories. This organization defines clear boundaries for routing, domain logic, and shared utilities to reduce cognitive overhead and improve maintainability.

What is the best way to separate server and client logic in a Next.js SaaS application?

To separate server and client logic in a Next.js SaaS application, place server-only code within a dedicated `server/` directory. This establishes clear server/client boundaries, keeping server actions, schemas, and types secure while maintaining indie-friendly project maintainability.

How do I define feature boundaries in a Next.js SaaS project?

Define feature boundaries in a Next.js SaaS project by grouping domain-specific logic within `features/<feature>/` directories. This feature-based organization encapsulates related hooks, utils, and types, preventing code entanglement and promoting rapid indie-friendly development.

Where should I place server actions and hooks in a Next.js SaaS folder structure?

Place server actions and hooks in a Next.js SaaS folder structure by utilizing dedicated sub-directories. Server actions go within the feature's `server/` directory, while hooks reside alongside schemas and types to maintain a clear separation of concerns.

Can I use this Next.js folder structure for refactoring an existing SaaS project?

Yes, you can use this Next.js folder structure for refactoring an existing SaaS project to establish a clean, scalable codebase. It provides a pragmatic code placement strategy that updates file organization across app, features, and shared directories for low maintenance.

Why does my Next.js SaaS code become hard to maintain as features grow?

Next.js SaaS code becomes hard to maintain as features grow due to unclear folder responsibilities and tangled server/client logic. Applying a feature-based organization with distinct `app/`, `features/`, and `shared/` directories solves this by reducing cognitive overhead and improving maintainability.