# react-php-student **Repository Path**: polarzone/react-php-student ## Basic Information - **Project Name**: react-php-student - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-03 - **Last Updated**: 2024-04-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 项目结构 ``` +---react-php-student // 项目根路径 +---backend // 后端php +---front // 前端react ``` ### 后端-backend 进入backend文件夹后, 使用 `composer install` 安装codeigniter依赖包 测试环境使用 Apache , 监听端口为80端口, 网站根目录请指向 `backend/public` 文件夹下 #### 数据库连接配置 [Database.php](/backend/app/Config/Database.php) ```php public array $default = [ 'DSN' => '', 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'php_test', 'DBDriver' => 'MySQLi', 'DBPrefix' => '', 'pConnect' => false, 'DBDebug' => true, 'charset' => 'utf8', 'DBCollat' => 'utf8_general_ci', 'swapPre' => '', 'encrypt' => false, 'compress' => false, 'strictOn' => false, 'failover' => [], 'port' => 3306, 'numberNative' => false, ]; ``` > 数据库数据删除操作为 `软删除` #### 主要逻辑代码 控制器 [Students.php](/backend/app/Controllers/Students.php) 模型 [StudentsModel.php](/backend/app/Models/StudentsModel.php) ### 前端-front 进入 `front` 后使用 `npm install` 安装相关依赖 可使用 `npm run dev` 命令运行代码,此时由于配置了 vite 的 proxy, 使得开发环境可以无视跨域,请求到 80 端口的接口,项目得以正常运行 如需打包,可对 `front` 目录下的 `.env.production` 文件进行配置,使得打包后文件能正确的访问到接口地址