# Technology Stack

**Analysis Date:** 2026-05-07

## Languages

**Primary:**
- TypeScript 5 - All application code, types, and configuration
- React 19 - UI components and application logic (via Next.js)
- CSS / Tailwind - Styling

**Secondary:**
- JavaScript - Configuration files, optional runtime

## Runtime

**Environment:**
- Node.js 22.10.0 (Alpine Linux) - as specified in Dockerfile

**Package Manager:**
- Yarn (primary for Docker builds; npm/pnpm also supported locally)
- Lockfiles: `package-lock.json`, `pnpm-lock.yaml`, `yarn.lock` present
- Registry: npm registry (Dockerfile uses Taobao mirror `registry.npmmirror.com` for builds)

## Frameworks

**Core:**
- Next.js 15.2.4 - App Router, React Server Components, standalone output mode
  - Configuration: `next.config.mjs`
  - Build output: standalone (optimized for Docker)
  - Experimental features: webpackBuildWorker, parallelServerBuildTraces, parallelServerCompiles

**Styling:**
- Tailwind CSS 3.4.17 - Utility-first CSS framework
  - Animation plugin: `tailwindcss-animate` 1.0.7
  - Config: `tailwind.config.ts`
  - CSS Variables enabled for theming (light/dark mode)

**UI Components:**
- Radix UI (15+ component libraries) - Headless, accessible primitives
  - Core: accordion, alert-dialog, avatar, checkbox, dialog, dropdown-menu, label, popover, select, tabs, toast, tooltip, etc.
  - shadcn/ui style components (local copies, not npm packages)
  - Config: `components.json`
  - Aliases: `@/components`, `@/components/ui`, `@/lib`, `@/hooks`

**Form Management:**
- React Hook Form (latest) - Lightweight form state management
- Zod (latest) - Schema validation and type-safe form schemas
- @hookform/resolvers (latest) - Integration between React Hook Form and validation libraries

**Data Visualization:**
- Recharts (latest) - React charting library built on D3.js
  - Used for dashboard analytics/metrics visualization

**Notifications & Toasts:**
- Sonner 1.7.1 - Toast notification library
- Radix UI Toast 1.2.4 - Low-level toast primitive (wrapped by use-toast)

**Navigation & Theming:**
- next-themes 0.4.4 - Dark/light mode switching
- lucide-react 0.454.0 - Icon library (240+ icons)

**HTTP Client:**
- Axios 1.9.0 - Promise-based HTTP client
  - Configured with request/response interceptors in `lib/api/client.ts`
  - Automatic token injection via Authorization header
  - 401 error handling (token expiry redirect to /login)

**Utilities:**
- js-cookie 3.0.5 - Cookie management (auth token persistence)
- date-fns 4.1.0 - Date utility library
- class-variance-authority 0.7.1 - Component variant utilities
- clsx 2.1.1 - Conditional className merging
- tailwind-merge 2.5.5 - Tailwind class conflict resolution
- cmdk 1.0.4 - Command palette component
- embla-carousel-react 8.5.1 - Carousel component
- react-day-picker 8.10.1 - Calendar/date picker
- input-otp 1.4.1 - OTP input component
- react-resizable-panels 2.1.7 - Resizable panel layout
- vaul 0.9.6 - Drawer component

## Testing & Development

**Type Checking:**
- TypeScript 5 (strict mode enabled)
- Type checking via `npm run lint`

**Linting:**
- Next.js ESLint (build-time linting)
- Config: ignored during builds (`eslint.ignoreDuringBuilds: true`)

**Development Server:**
- Next.js dev server: `npm run dev` (default port 3000)

## Configuration

**Environment:**
- Location: `.env.local` (local overrides), `.env.development`, `.env.production`, `.env.example`
- Example file: `c:\Users\admin\Desktop\Lila-Server\qy-lty-admin\.env.example`
- Key env vars:
  - `NEXT_PUBLIC_API_BASE_URL` - Backend API base URL (e.g., `http://localhost:8000/api`)
  - `NODE_ENV` - Set to `production` in Docker runtime

**TypeScript:**
- Config: `tsconfig.json`
- Strict mode: enabled
- Path aliases: `@/*` maps to project root

**Next.js:**
- Config: `next.config.mjs`
- Output mode: `standalone` (self-contained app)
- Images: unoptimized (external image optimization)
- Build optimization: parallel webpack, server build traces, server compilation

## Platform Requirements

**Development:**
- Node.js 22+ (or compatible version)
- Package manager: yarn, npm, or pnpm
- Environment variables: `.env.local` with `NEXT_PUBLIC_API_BASE_URL`

**Production:**
- Docker runtime: Node.js 22.10.0 Alpine
- Memory: Typical SPA requirements (~500MB minimum)
- Port: 3000 (exposed in Dockerfile)
- Build artifacts: `.next/standalone`, `public/`

## Build Process

**Development Build:**
```bash
npm install          # Install dependencies
npm run dev          # Start dev server (hot reload)
```

**Production Build:**
```bash
npm install          # Install all dependencies
npm run build        # Next.js standalone build → .next/ directory
npm run start        # Start production server (requires .next/ + public/)
```

**Docker Build (CI/CD):**
- Multi-stage build (builder + runner)
- Builder stage: installs full dependencies, runs `npm run build`
- Runner stage: installs production-only dependencies, copies .next/ and public/
- Yarn mirror: Taobao registry (`registry.npmmirror.com`)
- Final CMD: `yarn start` (port 3000)

---

*Stack analysis: 2026-05-07*
