How nishargshah/nextjs-fullstack-typescript-boilerplate works
Project type and purpose
• This is a full‑stack web application built on Next.js (v13+ with the App Router), React and TypeScript.
• The frontend and backend live in one monolithic Next.js codebase: UI pages, API routes, middleware, state management, and mocks.
• It uses React Query for server‑state, Zustand for client‑state, cookie‐based auth flows, plus Docker and GitHub Actions for CI/CD.
File structure
• Top‑level “src/app” holds all React pages and Next.js API route handlers:
– src/app/(public) & (auth) → public vs. protected page layouts and routes
– src/app/api → Next.js serverless functions grouped under “auth”, “protected” and shared utils/mocks
• src/api contains client‑side HTTP wrappers (axios.ts, endpoints.ts, catchAsync.ts) used by React Query and features.
• src/features drives the presentation–API boundary: hooks + typed API functions per domain (auth, users, profile).
• src/store & src/providers host global client‑state (Zustand slices, providers).
• config, constants, lib, utils provide cross‑cutting code.
• Middleware (middleware.ts) sits at the Next.js edge.
• Dev tools: Dockerfile, GitHub Actions workflow, pnpm workspace, ESLint/Prettier, Husky + lint‑staged.
Insights from the README
• It confirms the stack: Next.js, TS, React Query, Zustand, cookie auth, fully typed, strict linting, Docker + GH Actions.
• Emphasis on pre‑commit hooks, coding standards, pnpm usage.