# CloudNexus Systems - Development Server Startup Guide This guide explains how to use the startup scripts to automatically launch your development server. ## Available Startup Scripts ### 1. Windows Batch File (`start.bat`) - **Usage**: Double-click `start.bat` or run from command prompt - **Features**: Simple PHP server startup with user-friendly messages - **Best for**: Quick manual startup on Windows ### 2. PowerShell Script (`start.ps1`) - **Usage**: Right-click → "Run with PowerShell" or run `powershell .\start.ps1` - **Features**: Enhanced error handling, optional browser auto-open - **Best for**: Windows users who want more features ### 3. Shell Script (`start.sh`) - **Usage**: Run `chmod +x start.sh && ./start.sh` in terminal - **Features**: Cross-platform compatibility (Linux/macOS) - **Best for**: Unix-based systems ## Auto-Startup Configuration ### Option A: IDE Integration 1. In Trae AI, go to project settings 2. Look for "Startup Commands" or "Project Tasks" 3. Add the appropriate script for your OS: - Windows: `start.bat` or `powershell .\start.ps1` - Linux/macOS: `./start.sh` ### Option B: VS Code Integration (if applicable) Create `.vscode/tasks.json`: ```json { "version": "2.0.0", "tasks": [ { "label": "Start Development Server", "type": "shell", "command": "php", "args": ["-S", "localhost:8000"], "group": "build", "presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "new" }, "runOptions": { "runOn": "folderOpen" } } ] } ``` ### Option C: Package.json (Alternative) If you want to use npm-style commands, create a `package.json`: ```json { "name": "cloudnexus-systems", "version": "1.0.0", "scripts": { "start": "php -S localhost:8000", "dev": "php -S localhost:8000" } } ``` Then run `npm start` or `npm run dev` ## Customization ### Auto-open Browser To automatically open the browser when starting the server: **PowerShell (`start.ps1`)**: Uncomment line 10 ```powershell Start-Process "http://localhost:8000" ``` **Shell Script (`start.sh`)**: Uncomment lines 16-20 ```bash if command -v xdg-open &> /dev/null; then xdg-open http://localhost:8000 elif command -v open &> /dev/null; then open http://localhost:8000 fi ``` ### Change Port To use a different port, modify the scripts and change `localhost:8000` to your preferred port (e.g., `localhost:3000`). ## Troubleshooting ### PHP Not Found - Ensure PHP is installed and added to your system PATH - Test by running `php --version` in terminal/command prompt ### Port Already in Use - Change the port number in the script - Or stop the existing process using that port ### Permission Denied (Linux/macOS) - Make the script executable: `chmod +x start.sh` ## Quick Start 1. Choose your preferred script based on your operating system 2. Double-click (Windows) or run in terminal (Linux/macOS) 3. Open http://localhost:8000 in your browser 4. Start developing! For automatic startup when opening the project, configure your IDE to run the appropriate startup script.