# Nextivite

Next.js 16 (App Router) boilerplate scaffolded by **create-reactivite**.

## Stack

- **Next.js 16** + React 19 (App Router, `output: "standalone"`)
- **Tailwind CSS v4** (`@tailwindcss/postcss`, config-less) + shadcn/ui (new-york)
- **i18n** — `app/[locale]` routing with a lightweight `TranslationProvider` + `locales/*.json`
- **TanStack Query** (+ Devtools) via `hoc/provider.tsx`
- **axios** httpClient with interceptors + **orval** for type-safe API hooks
- **Zustand** stores (`store/`)
- **react-hook-form** + **zod** forms
- **Vitest** + **MSW** + Testing Library
- **husky** pre-commit (lint + format + tests), **prettier**, **eslint-config-next**

## Getting started

```bash
pnpm install      # or npm install
pnpm dev          # http://localhost:3000  → redirects to /az
```

## Structure

```
app/
  layout.tsx              # root passthrough
  page.tsx                # redirects to /{DEFAULT_LOCALE}
  globals.css             # Tailwind v4 theme tokens
  api/clear-session/      # cookie-clearing route
  [locale]/
    layout.tsx            # html/body shell + all providers
    locales.ts            # server-only dictionary loader
    page.tsx              # Home
    (public)/login/       # login (react-hook-form + zod)
    (private)/dashboard/  # guarded page
components/
  ui/                     # shadcn/ui components
  theme-provider.tsx
  AuthEventListener.tsx
config/                   # env + constants (LOCALES, timeouts)
contexts/                 # translation-context
hoc/                      # QueryProvider
lib/                      # utils, paramsSerializer
services/
  httpClient/             # axios instance + orval mutator
  generated/              # orval output (git-ignored content)
store/                    # zustand stores
locales/                  # az.json, en.json
testing/msw/              # mock server + handlers
__tests__/                # vitest specs
```

## API codegen (orval)

1. Point `orval.config.ts` `input.target` at your OpenAPI schema (or set `OPENAPI_TARGET`).
2. `pnpm generate:api` → writes react-query hooks + models to `services/generated/`.

## Scripts

- `pnpm dev` / `pnpm build` / `pnpm start`
- `pnpm lint` / `pnpm format`
- `pnpm test` / `pnpm test:run`
- `pnpm generate` / `pnpm generate:api`

## Adding components

```bash
npx shadcn@latest add <name>
```

`components.json` points `css` at `app/globals.css`.
