# LikeAdmin PHP - Project AI Prompt This document provides a comprehensive overview of the LikeAdmin PHP project context, architecture, and development conventions. It is intended to assist AI editors and developers in understanding the codebase. ## 1. Project Overview LikeAdmin PHP is a rapid development framework featuring a separated front-end and back-end architecture. - **Backend**: ThinkPHP 8.0 - **Admin Panel**: Vue 3 + Element Plus - **Mobile Client**: UniApp (supports WeChat Mini Program, H5, App) - **PC Client**: Nuxt 3 (SSR) ## 2. Technology Stack ### Server (Backend) - **Framework**: ThinkPHP 8.0 (`topthink/framework`) - **Language**: PHP >= 8.0 - **Database**: MySQL - **Cache**: Redis - **Key Dependencies**: - `topthink/think-orm`: ORM - `topthink/think-multi-app`: Multi-app support - `w7corp/easywechat`: WeChat SDK ### Admin (Management Panel) - **Framework**: Vue 3.5 + Vite - **UI Library**: Element Plus 2.9 - **CSS**: Tailwind CSS + SCSS - **State Management**: Pinia - **Router**: Vue Router - **HTTP Client**: Axios ### Uniapp (Mobile Client) - **Framework**: UniApp (Vue 3 based) - **UI Library**: vk-uview-ui - **CSS**: Tailwind CSS + SCSS - **Platforms**: WeChat Mini Program, H5, Android/iOS App ### PC (Web Client) - **Framework**: Nuxt 3.6 - **UI Library**: Element Plus - **CSS**: Tailwind CSS ## 3. Directory Structure ### Root Directory - `server/`: PHP Backend code - `admin/`: Vue 3 Admin Panel source code - `uniapp/`: Mobile client source code - `pc/`: Nuxt 3 PC client source code - `docker/`: Docker deployment configurations ### Server Structure (`server/`) - `app/`: Application logic - `adminapi/`: Admin panel APIs (Controllers, Logic, Services) - `api/`: Client-facing APIs (Mobile/PC) - `common/`: Shared logic (Models, Enums, Utils) - `config/`: Configuration files - `public/`: Web root (entry point `index.php`) - `.env`: Environment variables (Database, Redis, Debug) ### Admin Structure (`admin/src/`) - `api/`: API request definitions - `views/`: Page components - `components/`: Global reusable components - `layout/`: Main layout structure - `router/`: Route definitions - `stores/`: Pinia state management - `utils/`: Utility functions ### Uniapp Structure (`uniapp/src/`) - `pages/`: Page views - `api/`: API request definitions - `components/`: Reusable components - `uni_modules/`: Plugins (e.g., vk-uview-ui) - `manifest.json`: App configuration - `pages.json`: Page routing and window configuration ## 4. Development Conventions ### Server (ThinkPHP) - **Architecture**: Controller -> Logic -> Service -> Model - **Controller**: Handles HTTP requests, parameter validation. - **Logic**: Business logic implementation. - **Service**: Reusable services (e.g., Upload, SMS). - **Model**: Database interactions. - **Routing**: Defined in `app/adminapi/config/route.php` and `app/api/config/route.php`. - **Response Format**: Standard JSON structure (`code`, `msg`, `data`, `show`). - **Authentication**: Token-based authentication (AdminToken, UserToken). ### Admin (Vue 3) - **Component Style**: Composition API (`