# PragmaStack - Frontend Production-ready Next.js 16 frontend with TypeScript, authentication, admin panel, and internationalization. ## Features ### Core - โก **Next.js 16** - App Router with React Server Components - ๐ **TypeScript** - Full type safety - ๐จ **Tailwind CSS** - Utility-first styling - ๐งฉ **shadcn/ui** - High-quality component library - ๐ **Dark Mode** - System-aware theme switching ### Authentication & Security - ๐ **JWT Authentication** - Access & refresh token flow - ๐ **Protected Routes** - Client-side route guards - ๐ค **User Management** - Profile settings, password change - ๐ฑ **Session Management** - Multi-device session tracking ### Internationalization (i18n) - ๐ **Multi-language Support** - English & Italian (easily extensible) - ๐ **Locale Routing** - SEO-friendly URLs (`/en/login`, `/it/login`) - ๐ฏ **Type-safe Translations** - TypeScript autocomplete for keys - ๐ **Localized Metadata** - SEO-optimized meta tags per locale - ๐บ๏ธ **Multilingual Sitemap** - Automatic sitemap generation with hreflang ### Admin Panel - ๐ฅ **User Administration** - CRUD operations, search, filters - ๐ข **Organization Management** - Multi-tenant support with roles - ๐ **Dashboard** - Statistics and quick actions - ๐ **Advanced Filtering** - Status, search, pagination ### Developer Experience - โ **Comprehensive Testing** - 1,142+ unit tests, 178+ E2E tests - ๐ญ **Playwright** - End-to-end testing with fixtures - ๐งช **Jest** - Fast unit testing with coverage - ๐ **ESLint & Prettier** - Code quality enforcement - ๐ **TypeScript** - Strict mode enabled ## Getting Started ### Prerequisites - Node.js 18+ - npm, yarn, or pnpm ### Installation ```bash # Install dependencies npm install # Run development server npm run dev ``` Open [http://localhost:3000](http://localhost:3000) to view the app. ### Environment Variables Create a `.env.local` file: ```env NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1 NEXT_PUBLIC_SITE_URL=http://localhost:3000 ``` ## Scripts ```bash # Development npm run dev # Start dev server npm run build # Production build npm run start # Start production server # Code Quality npm run lint # Run ESLint npm run format # Format with Prettier npm run format:check # Check formatting npm run type-check # TypeScript type checking npm run validate # Run all checks (lint + format + type-check) # Testing npm test # Run unit tests npm run test:watch # Watch mode npm run test:coverage # Coverage report npm run test:e2e # Run E2E tests npm run test:e2e:ui # Playwright UI mode # API Client npm run generate:api # Generate TypeScript client from OpenAPI spec ``` ## Project Structure ``` frontend/ โโโ src/ โ โโโ app/ # Next.js App Router โ โ โโโ [locale]/ # Locale-specific routes โ โ โ โโโ (auth)/ # Auth pages (login, register) โ โ โ โโโ (authenticated)/ # Protected pages โ โ โ โโโ admin/ # Admin panel โ โ โ โโโ layout.tsx # Locale layout โ โ โโโ sitemap.ts # Multilingual sitemap โ โ โโโ robots.ts # SEO robots.txt โ โโโ components/ # React components โ โ โโโ auth/ # Auth components โ โ โโโ admin/ # Admin components โ โ โโโ forms/ # Form utilities โ โ โโโ navigation/ # Navigation (Header, LocaleSwitcher) โ โ โโโ ui/ # shadcn/ui components โ โโโ lib/ # Utilities & configuration โ โ โโโ api/ # API client (auto-generated) โ โ โโโ auth/ # Auth utilities & storage โ โ โโโ i18n/ # Internationalization โ โ โ โโโ routing.ts # Locale routing config โ โ โ โโโ utils.ts # Locale utilities โ โ โ โโโ metadata.ts # SEO metadata helpers โ โ โโโ stores/ # Zustand state management โ โโโ hooks/ # Custom React hooks โโโ messages/ # Translation files โ โโโ en.json # English โ โโโ it.json # Italian โโโ e2e/ # Playwright E2E tests โโโ tests/ # Jest unit tests โโโ docs/ # Documentation โ โโโ I18N.md # i18n guide โ โโโ design-system/ # Design system docs โโโ types/ # TypeScript type definitions ``` ## Internationalization (i18n) The app supports multiple languages with SEO-optimized routing. ### Supported Languages - ๐ฌ๐ง English (default) - ๐ฎ๐น Italian ### Usage ```typescript // Client components import { useTranslations } from 'next-intl'; export function MyComponent() { const t = useTranslations('namespace'); return