惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
宝玉的分享
宝玉的分享
腾讯CDC
博客园_首页
T
Tailwind CSS Blog
月光博客
月光博客
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
M
MIT News - Artificial intelligence
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
V
Visual Studio Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
SecWiki News
SecWiki News
美团技术团队
P
Privacy International News Feed
H
Help Net Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
Y
Y Combinator Blog
D
DataBreaches.Net
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
C
Cisco Blogs
S
Schneier on Security
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
Cisco Talos Blog
Cisco Talos Blog
小众软件
小众软件
Forbes - Security
Forbes - Security
D
Docker
T
Tenable Blog
S
Secure Thoughts
雷峰网
雷峰网
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
The Cloudflare Blog
博客园 - 【当耐特】
Spread Privacy
Spread Privacy
阮一峰的网络日志
阮一峰的网络日志

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Colocate Your API Layer: A Next.js App Router Pattern That Scales
Philip Daniel Oghenetega · 2026-06-25 · via DEV Community

Keep your data-fetching logic next to where it's actually used — and watch your codebase stay navigable past 30 feature modules.

I'm a frontend engineer at MTN Nigeria. This pattern emerged from building a production-grade retail POS system serving users, merchants, and admins across multiple regions.


The services/ folder that ate the codebase

Every frontend project grows a services/ directory. It starts as one file. Then it's ten. Then someone adds merchantService.ts, adminMerchantService.ts, and merchantAdminService.ts, and nobody can tell you the difference without opening all three. You scroll through hundreds of exports hunting for one function, and it's never where you'd expect.

The centralized pattern feels organized right up until your project is large enough to prove it isn't. Once a codebase has 30-plus distinct feature modules — admin canvassers, merchant inventory, logistics, settlements, reporting, locations, compliance — a single services/ folder stops being a map and becomes a maze.

This article walks through the alternative: a colocated API layer, taken from a production retail POS system built on Next.js 15 App Router. The project runs two distinct dashboards — (AdminDashboard) and (MerchantDashboard) — across dozens of independent feature modules. Every module owns its own API calls. Nothing leaks.


What "colocated" actually means

Colocation just means the API functions for a feature live inside that feature's directory, not in a global folder somewhere else. The structure looks like this:

src/app/
├── (AdminDashboard)/
│   ├── admin-merchants/
│   │   ├── api/
│   │   │   └── index.ts        ← merchant API calls
│   │   ├── columns/
│   │   │   └── index.tsx
│   │   ├── components/
│   │   └── page.tsx
│   ├── admin-inventory/
│   │   ├── api/
│   │   │   └── index.ts        ← inventory API calls
│   │   └── page.tsx
│   ├── admin-settlement/
│   │   ├── api/
│   │   │   └── index.ts        ← settlement API calls
│   │   └── page.tsx
│   └── admin-logistics/
│       ├── api/
│       │   └── index.ts        ← logistics API calls
│       └── page.tsx
└── (MerchantDashboard)/
    ├── merchant-inventory/
    │   ├── api/
    │   │   └── index.ts        ← merchant inventory API calls
    │   └── page.tsx
    └── merchant-home/
        ├── api/
        │   └── index.ts        ← dashboard analytics API calls
        └── page.tsx

Each api/index.ts is a plain TypeScript module that exports async functions. No classes, no DI containers, no registries — just functions. This is the same principle that makes App Router route groups work: code that changes together lives together.


The one thing that stays global: a typed Axios instance

Only the HTTP client itself lives globally. Every api/index.ts in the project imports from the same place:

// src/components/Auth/Instance.ts

import axios, {
  AxiosInstance,
  AxiosRequestConfig,
  InternalAxiosRequestConfig,
  AxiosResponse,
  AxiosError,
} from "axios";
import TokenService from "./TokenService";
import { toast } from "sonner";

interface CustomAxiosInstance extends AxiosInstance {
  get<T = any, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
  post<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
  put<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
  patch<T = any, R = AxiosResponse<T>>(url: string, data?: any, config?: AxiosRequestConfig): Promise<R>;
}

const instance: CustomAxiosInstance = axios.create({
  baseURL: process.env.NEXT_PUBLIC_BASE_URL,
  timeout: 36000,
});

The key decision: CustomAxiosInstance re-declares the HTTP method signatures with generics. Every downstream API call then gets full TypeScript inference — the response type flows from the call site all the way to the consuming component, no casting required.

Request interceptor: token injection

instance.interceptors.request.use(
  (config: InternalAxiosRequestConfig): InternalAxiosRequestConfig => {
    const token = TokenService.getLocalAccessToken();
    if (token) {
      config.headers.Authorization = `Bearer ${token}`;
    }
    return config;
  },
  (error) => Promise.reject(error),
);

Every outbound request gets the bearer token attached automatically. No individual API function thinks about auth headers. This is the only kind of logic that belongs in the shared layer: behavior that genuinely applies to every single request.

Response interceptor: centralized error handling

The response interceptor maps every HTTP error the API can return — 400, 401, 403, 404, 405, 408, 409, 412, 429, 500, 502 — to a user-facing toast. The 401 case carries the most weight, because it has to distinguish a real session expiry on a protected route from a legitimate 401 coming back from an auth endpoint like /login or /verify:

const isAuthEndpoint =
  requestUrl.includes("/login") ||
  requestUrl.includes("/otp") ||
  requestUrl.includes("/verify");

if (isAuthEndpoint) {
  return Promise.reject(error); // let the form handle this
}

// session expired on a protected route
TokenService.removeUserAndRedirect();

This is exactly where that logic should live. If each API function handled its own 401, you'd either duplicate the redirect across dozens of files or extract a utility and import it everywhere anyway. The interceptor does it once, invisibly.


Role-aware token management

The app runs three concurrent session types — admin, merchant, and user — and TokenService resolves the right token by reading the current URL path:

// src/components/Auth/TokenService.ts

const ROLE_PREFIXES: Record<SessionRole, string[]> = {
  admin: ["admin", "super_admin"],
  merchant: ["general_manager", "regional_manager", "state_manager"],
  user: ["user", "branch_staff", "customer"],
};

getLocalAccessToken(pathname?: string): string | undefined {
  const role = this.getSessionRoleFromPath(pathname);
  return Cookies.get(`token-${role}`);
}

Tokens live in role-namespaced cookies — token-admin, token-merchant, token-user. When the request interceptor calls getLocalAccessToken(), it derives the cookie key from window.location.pathname. An admin moving through /admin-merchants gets the admin token; a merchant on /merchant-inventory gets the merchant token.

The subtle payoff: the shared Axios instance never needs to know which role is active. TokenService owns that resolution, and the interceptor just calls the method.


The pattern in practice

Here's the merchants API module in full:

// src/app/(AdminDashboard)/admin-merchants/api/index.ts

import axios from "@/components/Auth/Instance";
import { MerchantStatusUpdate, updateStatusType } from "@/types";

export const getMerchants = (
  page: number,
  searchTerm: string,
  activeTab: string,
  startDate?: string,
  endDate?: string
) => {
  return axios
    .get(`merchant/list?page=${page}&limit=10&search=${searchTerm}&status=${activeTab}&startDate=${startDate}&endDate=${endDate}`)
    .then((res) => res.data);
};

export const getSingleMerchant = (id: string) => {
  return axios.get(`merchant/${id}`).then((res) => res.data);
};

export const createMerchants = (value: FormData) => {
  return axios.post("merchant/add", value).then((res) => res.data);
};

export const editMerchants = (value: FormData) => {
  return axios.put("merchant/update", value).then((res) => res.data);
};

export const updateMerchantStatus = (data: MerchantStatusUpdate) => {
  return axios.patch("merchant/update/status", data);
};

export const deleteMerchant = (id: string) => {
  return axios.delete(`/merchant/delete/${id}`).then((res) => res.data);
};

A few things to notice:

  • The import path is ./api — relative, short, scoped to the feature.
  • Shared types like MerchantStatusUpdate come from the global @/types index. Types stay global; functions don't.
  • Every export is a plain async function, not a class method. No instantiation, no inheritance, no this.
  • The CRUD surface is complete: GET (list and single), POST, PUT, PATCH, DELETE.

The logistics module shows how to absorb messy query parameters inside the function instead of leaking them into the signature:

// src/app/(AdminDashboard)/admin-logistics/api/index.ts

export const getLogisticsData = (
  search: string,
  selectedDate: { from?: Date; to?: Date },
  sort: string,
  page: string
) => {
  let startDate = "";
  let endDate = "";

  if (selectedDate?.from && selectedDate?.to) {
    startDate = selectedDate.from.toISOString().split("T")[0];
    endDate = selectedDate.to.toISOString().split("T")[0];
  }

  return axios
    .get("admin/shipping/list", {
      params: { search: search?.toLowerCase() || "", startDate, endDate, sort, page, limit: 10 },
    })
    .then((res) => res.data);
};

Date formatting and encoding happen inside the API function. The component passes a Date; the module hands the API a "YYYY-MM-DD" string. That's the boundary — the component doesn't know what format the API wants, and the API module doesn't know what the component's state looks like.

When a module reuses query-building logic across several endpoints, it reaches for a shared utility — never a shared API function:

// src/app/(AdminDashboard)/admin-settlement/api/index.ts

import { buildQueryParams } from "@/lib/utils";

export const getAdminSettlement = (
  page: number,
  selectedDate?: { from?: Date; to?: Date }
) => {
  const queryParams = buildQueryParams(selectedDate);
  return axios
    .get(`report/settlements?page=${page}&limit=10&${queryParams}`)
    .then((res) => res.data);
};

export const getAdminMomoSettlement = (
  page: number,
  selectedDate?: { from?: Date; to?: Date }
) => {
  const queryParams = buildQueryParams(selectedDate);
  return axios
    .get(`report/momo-settlements?page=${page}&limit=10&${queryParams}`)
    .then((res) => res.data);
};

buildQueryParams lives in @/lib/utils because it has zero API-specific knowledge — it's a string builder. The colocated module imports it. The rule holds: utilities can be shared; API functions cannot.


Wiring to React Query

The colocated functions plug straight into React Query's queryFn:

// src/app/(AdminDashboard)/admin-merchants/page.tsx

"use client";
import { useQuery } from "@tanstack/react-query";
import { getMerchants } from "./api";  // ← relative import, same directory

function AdminMerchants() {
  const [page, setPage] = useState<number>(1);
  const [search, setSearch] = useState("");
  const [activeTab, setActiveTab] = useState("active");

  const { data, isLoading } = useQuery<MerchantApiResponse>({
    queryKey: ["Merchants", page, search, activeTab],
    queryFn: () => getMerchants(page, search, activeTab),
  });

  // ...
}

The import is "./api", not "@/services/merchantService". The page and its API module are siblings. Move, rename, or delete the feature and everything travels together — there's no orphaned import in a distant services/ folder pointing at a module that no longer exists.

The merchant dashboard home fetches four statistics endpoints in parallel with useQueries, then wraps them into a single metrics array:

// src/hooks/useStatisticsQueries.ts

import {
  getProductStatistics,
  getOrderStatistics,
  getSalesStatistics,
  getProfitStatistics,
} from "@/app/(MerchantDashboard)/merchant-home/api";

export const useStatisticsQueries = (
  selectedOption: string,
  selectedDate: DateRange | undefined
) => {
  const queries = useQueries({
    queries: [
      {
        queryKey: ["getProductStatistics", selectedOption, selectedDate],
        queryFn: () => getProductStatistics(selectedOption || "today", selectedDate),
        select: (data: any) => transformApiResponse("productStatistics", data.dialogData),
      },
      {
        queryKey: ["getOrderStatistics", selectedOption, selectedDate],
        queryFn: () => getOrderStatistics(selectedOption || "today", selectedDate),
        select: (data: any) => transformApiResponse("totalOrder", data.dialogData),
      },
      // ...two more
    ],
  });

  return {
    metrics: Metrics.map((metric, i) => ({
      ...metric,
      dialogData: queries[i]?.data || metric.dialogData,
      isLoading: queries[i]?.isLoading,
    })),
    isLoading: queries.some((q) => q.isLoading),
  };
};

This is the one sanctioned exception to "import from ./api." When a cross-cutting hook aggregates data from several feature modules, it imports them by absolute path. But notice what it doesn't do: it doesn't invent a shared statistics service. It still pulls from each colocated module, which remains the single source of truth for its own requests. The boundary holds — the hook just reaches across it deliberately.


Query key design

React Query caches by the queryKey array, so keys are named after the domain entity and include every variable that changes the result:

queryKey: ["Merchants", page, search, activeTab, startDate, endDate]
queryKey: ["getProductStatistics", selectedOption, selectedDate]
queryKey: ["AdminSettlement", page, selectedDate]

That key drives three things:

  1. Cache hits — the same key returns cached data with no network request.
  2. Automatic refetch — change any array element and a fresh request fires.
  3. Manual invalidationqueryClient.invalidateQueries({ queryKey: ["Merchants"] }) busts the entire merchant list cache.

The classic bug: you bury a variable inside queryFn but leave it out of queryKey. React Query has no idea the result changed, so paging or filtering silently serves stale data. The fix is mechanical — if it changes the response, it goes in the key.


What the pattern prevents

Accidental coupling. In a shared service file, it's tempting to write one function that hits three endpoints to "pre-assemble" what the UI needs — and now two features that should be independent are welded together. Colocation forces the question: does this extra call belong in merchant-inventory/api, or should it be a separate query? Usually, separate.

Namespace collisions. Both dashboards deal with inventory, locations, settlements, and orders. Centralized, you end up with getInventory, getMerchantInventory, getAdminInventory — or a flag like getInventory(role: 'admin' | 'merchant'). Colocated, getInventory in admin-inventory/api and getInventory in merchant-inventory/api are simply different modules. Same name, no collision.

Dead code. A function in a global services/ folder is hard to delete safely — you have to grep the whole codebase to be sure nothing else depends on it. A function in merchant-return/api/index.ts can only be reached by the merchant return feature. Delete the feature, delete the API file with it. "Find usages" stays honest.


The boundaries that have to stay global

Layer Lives in Why
HTTP client + interceptors src/components/Auth/Instance.ts All requests share auth, error handling, and base URL
Token management src/components/Auth/TokenService.ts Session state belongs to no single feature
Shared types src/types/index.ts Type definitions aren't API behavior
Pure utilities src/lib/utils.ts Date formatters and query builders have no feature ownership

Everything else — the actual HTTP calls — lives inside the feature directory.


Trade-offs, going in eyes open

Deliberate duplication. Some endpoints show up in more than one module. location/countries appears in both admin-merchants/api and admin-locations/api — on purpose. Both features need that data and probably shape it differently. A shared getCountries() couples them; two functions that happen to call the same endpoint keep them independent. If the URL changes, yes, you edit two files — but that's a known cost with a knowable scope (grep the endpoint, fix each hit). You never have to untangle shared state.

Discovery. Finding a specific call means navigating to its feature folder instead of opening one services file. If you already know which feature you're in, colocation is strictly faster. If the task is "find everywhere that calls settlements," you grep -r "settlements" — same operation either way.

Cross-feature data. When a hook legitimately spans features (like useStatisticsQueries), it imports from several colocated modules. That's fine. The alternative — a shared statistics service — would couple four independently owned features to satisfy a filing preference. Import from the modules; keep the module as the boundary.


Summary

Colocated APIs aren't a new idea — they're the same principle that makes route groups powerful: code that changes together should live together. In this retail POS project, the pattern holds across 30-plus modules, two dashboard contexts, and a three-role auth model. Each feature's API file is:

  • Discoverable — it's in the same folder as the page that uses it.
  • Deletable — removing the feature removes its calls automatically.
  • Independently testable — no shared state between modules.
  • Readable — a feature's entire API surface fits in one file.

The shared Axios instance handles the cross-cutting work — auth headers, session redirects, error toasts — once, for everything. The colocated modules handle only what their feature needs.

Adding a feature is always the same five steps: create a folder, add page.tsx, add api/index.ts, import the shared instance, export functions. No registration, no central manifest, no risk of breaking something unrelated.

That predictability is what makes it scale.


Have you run into the centralized-services/-folder sprawl on a large App Router project? I'd be curious how you've drawn the line between shared and colocated — drop a comment.