This repository is a reference architecture for building production-ready React applications, implemented as a monorepo containing three distinct application templates: Next.js App Router, Next.js Pages Router, and Vite. It serves as a comprehensive guide for scalable project structure, demonstrating best practices in state management (Zustand for client state, TanStack Query for server state), testing (Vitest, Playwright, MSW), and security (JWT, RBAC). The codebase prioritizes strict TypeScript usage, unidirectional data flow, and feature-based colocation. The system functions as a boilerplate and educational tool rather than a standalone product. It provides a complete development environment including UI component libraries (Radix UI + Tailwind), form handling (React Hook Form + Zod), and API abstraction layers. The architecture is designed to be copy-pasted into new projects, with the three app implementations serving as comparative examples for different React rendering strategies. Key operational patterns include a centralized API client with Axios interceptors for authentication and error handling, a mock backend service using MSW and @mswjs/data for local development and testing, and a robust authorization system that enforces role-based access control at the component and route levels. The codebase is heavily instrumented with tests and documentation to ensure maintainability and adherence to the defined architectural standards.
eslint-plugin-project-structure is a TypeScript-based ESLint plugin that enforces scalable, consistent project architecture through three configurable rules: folder-structure enforcement, file-composition constraints (e.g., `**/*.consts.ts` may only contain variables, `**/*.types.ts` only interfaces/types), and independent-modules enforcement to prevent massive dependency trees. The plugin parses all import syntaxes — ESM, CJS, dynamic `import()`, `require()`, `jest.mock()`, `jest.requireActual()`, plus `ExportAllDeclaration`/`ExportNamedDeclaration` — and validates file paths against micromatch glob patterns. Configuration is provided via JSON files validated against a bundled JSON schema, enabling IDE autocompletion and early error detection. The codebase is a standard ESLint plugin library: rules receive AST nodes and report violations, with utility modules handling import classification, cross-platform path resolution (Windows/POSIX), and multi-pattern glob matching. It is distributed as compiled CommonJS (`dist/index.js`) with a self-referencing dev dependency for integration testing. The project ships with comprehensive tests covering edge cases like Windows paths, `@types/` scoped packages, and external-import detection, plus CI running type checks, format checks, lint, and tests via Yarn 3.6.3.