# AI Admin Application - Windows Executable Packaging This document describes how to package the AI Admin application as a Windows executable file. ## Files Included in This Packaging Setup - `requirements-packaging.txt` - Dependencies including PyInstaller - `pyinstaller_config.spec` - PyInstaller configuration file - `build_exe.bat` - Batch script to build the executable - `run_server.bat` - Batch script to run the built executable - `README_packaging.md` - This documentation ## Build Process To build the executable: 1. Run `build_exe.bat` which will: - Install required packaging dependencies (including PyInstaller) - Build the executable using the PyInstaller spec file - Output the executable to the `dist` folder as `AI_Admin\AI_Admin.exe` ## Configuration The application requires a `config.json` file with the following structure: ```json { "database": { "host": "120.24.39.179", "port": 3306, "user": "root", "password": "TAI@2019#Zjun", "database_name": "ai_cs", "charset": "utf8mb4" }, "server": { "host": "0.0.0.0", "port": 9676, "debug": false }, "api": { "prefix": "/api/v1" } } ``` Note: For production deployment, consider changing the `debug` value to `false` in the server configuration. ## Deployment on Windows Server 1. Run the `build_exe.bat` script to create the executable 2. The executable will be created in the `dist\AI_Admin\` folder 3. Copy the entire `AI_Admin` folder to your Windows server 4. Ensure the `config.json` file is in the same directory as the executable 5. Run `run_server.bat` or execute `AI_Admin.exe` directly to start the server ## API Endpoints Once running, the application provides the following API endpoints: - `GET /health` - Health check endpoint - `POST /api/v1/type/save` - Save ContentType - `GET /api/v1/type/get` - Get ContentType - `POST /api/v1/content/save` - Save Content - `GET /api/v1/content/get` - Get Content - `DELETE /api/v1/content/delete` - Delete Content ## Notes - The `admin.html` file is excluded from this packaging as specified - The executable will run as a console application - Make sure the target server has access to the configured database - Port 9676 should be available and accessible as per the configuration