# nestjs-starter-pro-frontend **Repository Path**: d-killy/nestjs-starter-pro-frontend ## Basic Information - **Project Name**: nestjs-starter-pro-frontend - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-12 - **Last Updated**: 2026-02-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NestJS Starter Pro Web > Frontend for NestJS Starter Pro - A lightweight, production-ready admin dashboard. > Modern management interface built with React 18 + TypeScript 5 + Ant Design 5. [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![React](https://img.shields.io/badge/react-18.3-blue)](https://reactjs.org/) [![TypeScript](https://img.shields.io/badge/typescript-5.8-blue)](https://www.typescriptlang.org/) [![Vite](https://img.shields.io/badge/vite-6.0-646CFF)](https://vitejs.dev/) [![Ant Design](https://img.shields.io/badge/antd-5.0-1890ff)](https://ant.design/) [English](#english) | [ไธญๆ–‡](#ไธญๆ–‡) --- ## ๐ŸŽฏ Overview This is the frontend dashboard for **NestJS Starter Pro** - a lightweight backend management framework. Built with modern React ecosystem for optimal developer experience and production performance. **Perfect for**: - ๐Ÿ’ผ Freelancers building admin dashboards quickly - ๐Ÿš€ Startups creating MVP products - ๐ŸŽ“ Learners studying React best practices - ๐Ÿ› ๏ธ Side projects that need professional UI --- ## โœจ Core Features - ๐ŸŽฏ **Feature-First Architecture** - Code organized by business modules, not file types - ๐Ÿ” **Complete RBAC System** - Permission guards, role-based access control - ๐Ÿ“Š **Smart State Management** - Zustand (client state) + TanStack Query (server state) - ๐ŸŽจ **Modern UI** - Ant Design 5 + Tailwind CSS + Dark Mode support - ๐Ÿš€ **Blazing Fast** - Vite 6 + HMR + TypeScript - ๐Ÿ“ฑ **Responsive Design** - PC-first, tablet-friendly - ๐Ÿงช **Complete Testing** - Vitest (unit) + Playwright (E2E) - ๐ŸŒ“ **Dark Mode** - Beautiful dark theme with smooth transitions --- ## ๐Ÿ› ๏ธ Tech Stack ### Core Framework - **React 18.3** - UI framework - **TypeScript 5.8** - Type safety - **Vite 6** - Build tool ### UI & Styling - **Ant Design 5** - Component library - **Tailwind CSS 4** - Utility-first CSS - **@ant-design/icons** - Icon library ### State Management - **Zustand 5** - Client state (theme, sidebar, etc.) - **TanStack Query 5** - Server state (API data caching) ### Routing & Forms - **React Router 7** - Routing - **React Hook Form 7** - Forms ### Tools - **Axios 1** - HTTP client - **dayjs** - Date/time handling - **lodash-es** - Utilities ### Dev Tools - **ESLint 9** - Linting - **Prettier 3** - Code formatting - **Vitest 3** - Unit testing - **Playwright 1** - E2E testing --- ## ๐Ÿ“ฆ Quick Start ### Prerequisites - Node.js >= 20.x - npm >= 10.x - Backend service running at `http://localhost:3000` (see [nestjs-starter-pro](../home-admin)) ### Installation ```bash # Install dependencies npm install # Start dev server npm run dev ``` **Access**: http://localhost:3001 **Default credentials** (after backend migration): ``` Username: admin Password: admin123 ``` ### Build for Production ```bash # Build npm run build # Preview production build npm run preview ``` ### Code Quality ```bash # ESLint check npm run lint # Type check npm run type-check # Format code npm run format ``` ### Testing ```bash # Unit tests npm run test # E2E tests npm run test:e2e # Test coverage npm run test:coverage ``` --- ## ๐Ÿ“ Project Structure ``` nestjs-starter-pro-web/ โ”œโ”€โ”€ public/ # Static assets โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ app/ # App layer โ”‚ โ”‚ โ”œโ”€โ”€ App.tsx # Root component โ”‚ โ”‚ โ”œโ”€โ”€ router.tsx # Route configuration โ”‚ โ”‚ โ””โ”€โ”€ providers.tsx # Global providers โ”‚ โ”œโ”€โ”€ features/ # Business modules (Feature-First) โ”‚ โ”‚ โ”œโ”€โ”€ auth/ # Authentication โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ components/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ hooks/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ pages/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ services/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ stores/ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ types/ โ”‚ โ”‚ โ”œโ”€โ”€ dashboard/ # Dashboard โ”‚ โ”‚ โ”œโ”€โ”€ rbac/ # RBAC (User/Role/Permission) โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ user/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ role/ โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ permission/ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ menu/ โ”‚ โ”‚ โ”œโ”€โ”€ file/ # File management โ”‚ โ”‚ โ”œโ”€โ”€ task/ # Task scheduling โ”‚ โ”‚ โ”œโ”€โ”€ notification/ # Notifications โ”‚ โ”‚ โ”œโ”€โ”€ dict/ # Data dictionary โ”‚ โ”‚ โ”œโ”€โ”€ config/ # System config โ”‚ โ”‚ โ””โ”€โ”€ api-auth/ # API Key management โ”‚ โ”œโ”€โ”€ shared/ # Shared modules โ”‚ โ”‚ โ”œโ”€โ”€ components/ # Common components โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ layouts/ # Layout components โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ auth/ # Auth components โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ common/ # Reusable UI โ”‚ โ”‚ โ”œโ”€โ”€ config/ # Configuration โ”‚ โ”‚ โ”œโ”€โ”€ hooks/ # Common hooks โ”‚ โ”‚ โ”œโ”€โ”€ types/ # Global types โ”‚ โ”‚ โ””โ”€โ”€ utils/ # Utilities โ”‚ โ”œโ”€โ”€ assets/ # Assets โ”‚ โ”‚ โ””โ”€โ”€ styles/ # Global styles โ”‚ โ””โ”€โ”€ main.tsx # Entry point โ”œโ”€โ”€ .env.development # Dev environment โ”œโ”€โ”€ .env.production # Prod environment โ”œโ”€โ”€ tailwind.config.ts # Tailwind config โ”œโ”€โ”€ vite.config.ts # Vite config โ”œโ”€โ”€ tsconfig.json # TypeScript config โ””โ”€โ”€ package.json ``` --- ## ๐Ÿ”‘ Environment Variables ### Development (.env.development) ```bash VITE_API_URL=http://localhost:3000/api/v1 VITE_APP_TITLE=NestJS Starter Pro VITE_ENABLE_MOCK=false ``` ### Production (.env.production) ```bash VITE_API_URL=https://api.example.com/api/v1 VITE_APP_TITLE=NestJS Starter Pro VITE_ENABLE_MOCK=false ``` --- ## ๐Ÿ“ Code Standards ### File Naming - Components: `PascalCase` (e.g., `UserList.tsx`) - Hooks: `use + camelCase` (e.g., `useUsers.ts`) - Utils: `camelCase` (e.g., `request.ts`) - Types: `camelCase` (e.g., `user.types.ts`) ### Component Design - โœ… Use function components (no class components) - โœ… Use named exports (no default exports) - โœ… Props must have interface - โœ… Components should be < 200 lines ### State Management - โœ… Client state โ†’ Zustand (theme, sidebar, user preferences) - โœ… Server state โ†’ TanStack Query (API data) - โœ… Components should NOT call APIs directly - โœ… All API calls must be in Services --- ## ๐Ÿ” Authentication & Authorization ### Login Flow 1. User enters username/password 2. Call `/auth/login` endpoint 3. Get `accessToken` and `refreshToken` 4. Store in Zustand + localStorage 5. Subsequent requests auto-attach token ### Permission Control #### Component-level ```typescript import { PermissionGuard } from '@/shared/components/auth/PermissionGuard'; ``` #### Hook-level ```typescript import { usePermission } from '@/shared/hooks/usePermission'; function UserActions() { const { hasPermission } = usePermission(); return ( <> {hasPermission(['user:create']) && } {hasPermission(['user:delete']) && } ); } ``` #### Route-level ```typescript // router.tsx { path: 'users', element: , children: [ { index: true, element: , }, ], } ``` --- ## ๐Ÿงช Testing ### Unit Tests (Vitest) ```bash # Run all tests npm run test # Watch mode npm run test:watch # Coverage report npm run test:coverage ``` ### E2E Tests (Playwright) ```bash # Run E2E tests npm run test:e2e # UI mode npm run test:e2e:ui # Debug mode npm run test:e2e:debug ``` --- ## ๐Ÿ“š Documentation - **[CLAUDE.md](./CLAUDE.md)**: AI development guide (for Claude/ChatGPT) - **[Backend README](../home-admin/README.md)**: Backend documentation - **[Architecture Decisions](../docs/ADR.md)**: Why we built it this way - **[Framework Comparison](../docs/COMPARISON.md)**: vs other frameworks --- ## ๐Ÿš€ Deployment ### Docker ```bash # Build image docker build -t nestjs-starter-pro-web . # Run container docker run -p 3001:80 nestjs-starter-pro-web ``` ### Nginx ```nginx server { listen 80; server_name example.com; root /var/www/nestjs-starter-pro-web; location / { try_files $uri $uri/ /index.html; } location /api { proxy_pass http://backend:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } ``` --- ## ๐Ÿค Contributing 1. Fork the repo 2. Create feature branch (`git checkout -b feature/amazing-feature`) 3. Commit changes (`git commit -m 'Add amazing feature'`) 4. Push to branch (`git push origin feature/amazing-feature`) 5. Open Pull Request --- ## ๐Ÿ“„ License MIT License - see [LICENSE](LICENSE) for details. --- ## ๐Ÿ’ฌ Community - ๐Ÿ’ก **GitHub Discussions**: Ask questions, share ideas - ๐Ÿ› **GitHub Issues**: Report bugs, request features - โญ **Star this repo**: If you find it useful! --- **Built with โค๏ธ by developers who got tired of over-engineered frontends.** **Philosophy**: Keep it simple, keep it clean, make it work. --- ## ไธญๆ–‡ > NestJS Starter Pro ็š„ๅ‰็ซฏ็ฎก็†็•Œ้ขใ€‚ > ๅŸบไบŽ React 18 + TypeScript 5 + Ant Design 5 ็š„็ŽฐไปฃๅŒ–็ฎก็†ๅŽๅฐใ€‚ --- ## ๐ŸŽฏ ้กน็›ฎ็ฎ€ไป‹ ่ฟ™ๆ˜ฏ **NestJS Starter Pro** ็š„ๅ‰็ซฏ็ฎก็†็•Œ้ข - ไธ€ไธช่ฝป้‡็บง็š„ๅŽๅฐ็ฎก็†ๆก†ๆžถใ€‚ไฝฟ็”จ็Žฐไปฃ React ็”Ÿๆ€็ณป็ปŸๆž„ๅปบ๏ผŒๆไพ›ๆœ€ไฝณ็š„ๅผ€ๅ‘ไฝ“้ชŒๅ’Œ็”Ÿไบงๆ€ง่ƒฝใ€‚ **้€‚ๅˆ**๏ผš - ๐Ÿ’ผ ๆŽฅ็งๆดปๅฟซ้€Ÿๆญๅปบ็ฎก็†ๅŽๅฐ - ๐Ÿš€ ๅˆๅˆ›ๅ…ฌๅธๆž„ๅปบ MVP ไบงๅ“ - ๐ŸŽ“ ๅญฆไน  React ๆœ€ไฝณๅฎž่ทต - ๐Ÿ› ๏ธ ไธชไบบ้กน็›ฎ้œ€่ฆไธ“ไธš UI --- ## โœจ ๆ ธๅฟƒ็‰นๆ€ง - ๐ŸŽฏ **Feature-First ๆžถๆž„** - ๆŒ‰ไธšๅŠกๆจกๅ—็ป„็ป‡ไปฃ็  - ๐Ÿ” **ๅฎŒๆ•ด RBAC ็ณป็ปŸ** - ๆƒ้™ๅฎˆๅซใ€ๅŸบไบŽ่ง’่‰ฒ็š„่ฎฟ้—ฎๆŽงๅˆถ - ๐Ÿ“Š **ๆ™บ่ƒฝ็Šถๆ€็ฎก็†** - Zustand๏ผˆๅฎขๆˆท็ซฏ๏ผ‰+ TanStack Query๏ผˆๆœๅŠก็ซฏ๏ผ‰ - ๐ŸŽจ **็ŽฐไปฃๅŒ– UI** - Ant Design 5 + Tailwind CSS + ๆทฑ่‰ฒๆจกๅผ - ๐Ÿš€ **ๆž้€Ÿๅผ€ๅ‘** - Vite 6 + HMR + TypeScript - ๐Ÿ“ฑ **ๅ“ๅบ”ๅผ่ฎพ่ฎก** - PC ไผ˜ๅ…ˆ๏ผŒๅ…ผ้กพๅนณๆฟ - ๐Ÿงช **ๅฎŒๆ•ดๆต‹่ฏ•** - Vitest๏ผˆๅ•ๅ…ƒๆต‹่ฏ•๏ผ‰+ Playwright๏ผˆE2E ๆต‹่ฏ•๏ผ‰ - ๐ŸŒ“ **ๆทฑ่‰ฒๆจกๅผ** - ็ฒพ็พŽ็š„ๆทฑ่‰ฒไธป้ข˜๏ผŒๅนณๆป‘่ฟ‡ๆธก --- ## ๐Ÿ“ฆ ๅฟซ้€Ÿๅผ€ๅง‹ ```bash # ๅฎ‰่ฃ…ไพ่ต– npm install # ๅฏๅŠจๅผ€ๅ‘ๆœๅŠกๅ™จ npm run dev ``` ่ฎฟ้—ฎ๏ผšhttp://localhost:3001 ้ป˜่ฎค่ดฆๅท๏ผš`admin` / `admin123`๏ผˆ่ฟ่กŒๅŽ็ซฏ migration ๅŽ๏ผ‰ --- ## ๐Ÿ“š ๆ–‡ๆกฃ - **[CLAUDE.md](./CLAUDE.md)**๏ผšAI ่พ…ๅŠฉๅผ€ๅ‘ๆŒ‡ๅ— - **[ๅŽ็ซฏ README](../home-admin/README.md)**๏ผšๅŽ็ซฏๆ–‡ๆกฃ - **[ๆžถๆž„ๅ†ณ็ญ–](../docs/ADR.md)**๏ผšไธบไป€ไนˆ่ฟ™ๆ ท่ฎพ่ฎก - **[ๆก†ๆžถๅฏนๆฏ”](../docs/COMPARISON.md)**๏ผšไธŽๅ…ถไป–ๆก†ๆžถๅฏนๆฏ” --- ## ๐Ÿค ่ดก็Œฎ ๆฌข่ฟŽ่ดก็Œฎไปฃ็ ๏ผ่ฏทๆŸฅ็œ‹ [CONTRIBUTING.md](CONTRIBUTING.md) ไบ†่งฃ่ฏฆๆƒ…ใ€‚ --- ## ๐Ÿ“„ ่ฎธๅฏ่ฏ MIT License - ่ฏฆ่ง [LICENSE](LICENSE) ๆ–‡ไปถใ€‚ --- **็”ฑๅŽŒๅ€ฆไบ†่ฟ‡ๅบฆ่ฎพ่ฎกๅ‰็ซฏ็š„ๅผ€ๅ‘่€…็”จ โค๏ธ ๆž„ๅปบใ€‚** **็†ๅฟต**๏ผšไฟๆŒ็ฎ€ๅ•๏ผŒไฟๆŒๅนฒๅ‡€๏ผŒ่ฎฉๅฎƒๅทฅไฝœใ€‚