# Blueprint Framework Blueprint is an open-source extension framework and manager for the Pterodactyl panel, designed to enable developers to create versatile, easy-to-install extensions that system administrators can install within minutes. The framework eliminates the need for custom-coded compatibility across multiple panel modifications, providing a standardized approach to extending Pterodactyl's functionality. Blueprint aims to lower the barrier to entry for new developers through comprehensive guides, documentation, developer commands, and robust community support. The framework operates on three primary levels: a command-line interface for extension lifecycle management (installation, removal, building, and development), a PHP-based extension library API for runtime integration, and a React-based UI component library for frontend development. Extensions are distributed as `.blueprint` files (ZIP archives) containing a `conf.yml` configuration file that defines metadata, file locations, routes, database migrations, and frontend components. Blueprint handles the complete extension lifecycle—from extracting and validating extension packages to copying files, running migrations, registering routes, injecting frontend components, and rebuilding panel assets. The framework provides Bash CLI tools for system administrators and developers, PHP libraries for extension developers to interact with the Pterodactyl panel's admin interface and database, and React UI components for building consistent, themeable frontend interfaces. ## CLI Commands ### Extension Installation Install a Blueprint extension from a `.blueprint` package file. The installation process extracts the package, validates the configuration, copies files to appropriate directories, runs database migrations, registers routes, and rebuilds panel assets. ```bash # Install an extension blueprint -install myextension.blueprint # Alternative syntax blueprint -add myextension.blueprint blueprint -i myextension.blueprint # Example output # Installing myextension... (1/1) # Validating extension configuration... # Copying files... # Running database migrations... # Registering routes... # Rebuilding assets... # Extension installed successfully! ``` ### Extension Removal Remove an installed Blueprint extension from the Pterodactyl panel. This command removes extension files, database entries, routes, and rebuilds panel assets without the extension. ```bash # Remove an installed extension blueprint -remove extensionid # Alternative syntax blueprint -r extensionid # Example: Remove an extension named 'analytics' blueprint -remove analytics # The identifier is found in the extension's conf.yml file # Output confirms removal and asset rebuild ``` ### Extension Query Query information about an extension, including its metadata, version, author, and installation status. ```bash # Query extension information blueprint -query myextension.blueprint # Alternative syntax blueprint -q myextension.blueprint # Example output: # Name: My Extension # Identifier: myextension # Description: Adds analytics to the panel # Version: 1.0.0 # Author: John Doe # Target: beta-2025-11 # Status: Not installed ``` ### Developer Commands Initialize a new extension project from templates, build extensions from source, and export them for distribution. ```bash # Initialize a new extension in the development directory blueprint -init # Prompts for extension details and creates scaffolding # Build the extension from .blueprint/dev directory blueprint -build # Validates, compiles, and prepares extension for testing # Export extension for distribution blueprint -export # Creates a .blueprint package file in the current directory # Export with public exposure (includes source files) blueprint -export expose # Creates package with readable source code # Wipe the development directory blueprint -wipe # Removes all files from .blueprint/dev # Watch mode for development (auto-rebuild on changes) blueprint -watch ``` ### System Commands Manage Blueprint framework itself, including version information, upgrades, and debugging. ```bash # Show Blueprint version blueprint -version # Show system information blueprint -info # Displays Blueprint version, Pterodactyl version, PHP version, etc. # Show help information blueprint -help # Upgrade Blueprint framework blueprint -upgrade # Downloads and installs latest Blueprint version # Upgrade from remote repository blueprint -upgrade remote # Rerun installation process blueprint -rerun-install # Useful for fixing broken installations # Debug information blueprint -debug # Displays detailed debug logs ``` ## PHP Extension Library API ### Database Operations - Get Single Record Fetch a single record from the database using Blueprint's key-value storage system. Records are stored in the `settings` table with automatic serialization. ```php dbGet('myextension', 'api_key', 'default-key'); // Get numeric value $maxUsers = $blueprint->dbGet('myextension', 'max_users', 100); // Get array/object (automatically unserialized) $settings = $blueprint->dbGet('myextension', 'settings', [ 'enabled' => true, 'theme' => 'dark' ]); // Returns the default value if record doesn't exist $missingValue = $blueprint->dbGet('myextension', 'nonexistent', null); // $missingValue will be null return view('myextension.index', [ 'apiKey' => $apiKey, 'maxUsers' => $maxUsers, 'settings' => $settings ]); } } ``` ### Database Operations - Get Multiple Records Fetch multiple records from the database in a single query, returning an associative array with record names as keys. ```php dbGetMany('myextension', [ 'api_key', 'api_secret', 'webhook_url', 'enabled' ], 'not-set'); // Returns: [ // 'api_key' => 'abc123', // 'api_secret' => 'xyz789', // 'webhook_url' => 'https://example.com/hook', // 'enabled' => true // ] // Get all records for a table (omit second parameter) $allSettings = $blueprint->dbGetMany('myextension', [], null); // Returns all records with 'myextension::*' keys // Access individual values if ($values['enabled']) { $api = new ApiClient($values['api_key'], $values['api_secret']); $api->sendWebhook($values['webhook_url'], $data); } return response()->json($values); } } ``` ### Database Operations - Set Single Record Store a single record in the database. Values are automatically serialized, supporting strings, numbers, arrays, and objects. ```php dbSet('myextension', 'api_key', $request->input('api_key')); $blueprint->dbSet('myextension', 'max_users', 150); $blueprint->dbSet('myextension', 'enabled', true); // Store arrays (automatically serialized) $blueprint->dbSet('myextension', 'allowed_ips', [ '192.168.1.1', '10.0.0.1', '172.16.0.1' ]); // Store complex objects $blueprint->dbSet('myextension', 'theme_config', [ 'primary_color' => '#3B82F6', 'secondary_color' => '#10B981', 'fonts' => ['Inter', 'Roboto'], 'dark_mode' => true ]); // updateOrInsert behavior: creates new record or updates existing $blueprint->dbSet('myextension', 'last_updated', now()->toDateTimeString()); return redirect() ->route('admin.extensions.myextension.index') ->with('success', 'Settings updated successfully'); } } ``` ### Database Operations - Set Multiple Records Store multiple records in a single database operation for improved performance. ```php validate([ 'api_key' => 'required|string', 'api_secret' => 'required|string', 'webhook_url' => 'required|url', 'enabled' => 'boolean', 'max_retries' => 'integer|min:1|max:10' ]); // Batch update multiple records $blueprint->dbSetMany('myextension', [ 'api_key' => $validated['api_key'], 'api_secret' => $validated['api_secret'], 'webhook_url' => $validated['webhook_url'], 'enabled' => $validated['enabled'] ?? true, 'max_retries' => $validated['max_retries'] ?? 3, 'updated_at' => now()->toDateTimeString() ]); // Use for initial setup $blueprint->dbSetMany('myextension', [ 'installed' => true, 'version' => '1.0.0', 'install_date' => now()->toDateTimeString(), 'license_key' => $this->generateLicenseKey() ]); return response()->json([ 'success' => true, 'message' => 'All settings updated successfully' ]); } } ``` ### Database Operations - Delete Single Record Remove a single record from the database, returning whether the deletion was successful. ```php dbForget('myextension', 'api_key'); if ($deleted) { // Record existed and was deleted return response()->json([ 'success' => true, 'message' => 'API key cleared' ]); } else { // Record didn't exist return response()->json([ 'success' => false, 'message' => 'No API key to clear' ], 404); } } public function clearCache(BlueprintAdminLibrary $blueprint) { // Clear temporary data $blueprint->dbForget('myextension', 'cache_data'); $blueprint->dbForget('myextension', 'cache_timestamp'); $blueprint->dbForget('myextension', 'temp_token'); return redirect()->back()->with('success', 'Cache cleared'); } } ``` ### Database Operations - Delete Multiple Records Remove multiple records in a single database operation. ```php dbForgetMany('myextension', [ 'api_key', 'api_secret', 'api_endpoint', 'api_timeout', 'api_retries' ]); if ($deleted) { return response()->json([ 'success' => true, 'message' => 'API settings reset' ]); } return response()->json([ 'success' => false, 'message' => 'No settings to reset' ], 404); } public function clearSessionData(BlueprintAdminLibrary $blueprint) { // Clear all session-related data $blueprint->dbForgetMany('myextension', [ 'session_token', 'csrf_token', 'temp_data', 'flash_messages' ]); return redirect()->route('admin.extensions.myextension.index'); } } ``` ### Database Operations - Delete All Records Remove all records associated with an extension table, useful for uninstallation or complete resets. ```php dbForgetAll('myextension'); if ($deleted) { // Log the uninstallation \Log::info('Extension myextension uninstalled, all data removed'); return response()->json([ 'success' => true, 'message' => 'All extension data removed' ]); } return response()->json([ 'success' => false, 'message' => 'No data to remove' ], 404); } public function factoryReset(BlueprintAdminLibrary $blueprint) { // Complete reset to defaults $blueprint->dbForgetAll('myextension'); // Reinstall default settings $blueprint->dbSetMany('myextension', [ 'version' => '1.0.0', 'enabled' => false, 'max_users' => 100, 'theme' => 'default' ]); return redirect() ->route('admin.extensions.myextension.index') ->with('success', 'Extension reset to factory defaults'); } } ``` ### Extension Detection and Management Check if extensions are installed and retrieve their configurations for conditional features or inter-extension compatibility. ```php extension('analytics'); $hasThemeEngine = $blueprint->extension('themeengine'); $hasBilling = $blueprint->extension('billing'); // Enable features based on installed extensions if ($hasAnalytics) { $this->enableAnalyticsIntegration(); } // Get list of all installed extensions $installedExtensions = $blueprint->extensions(); // Returns: ['analytics', 'themeengine', 'myextension', ...] // Get configuration for specific extension if ($hasThemeEngine) { $themeConfig = $blueprint->extensionConfig('themeengine'); // Returns parsed conf.yml as array: // [ // 'info' => [ // 'name' => 'Theme Engine', // 'identifier' => 'themeengine', // 'version' => '2.0.0', // ... // ], // 'admin' => [...], // 'dashboard' => [...] // ] $themeName = $themeConfig['info']['name']; $themeVersion = $themeConfig['info']['version']; } // Get all extension configurations $allConfigs = $blueprint->extensionsConfigs(); // Returns Laravel Collection of all conf.yml files return view('myextension.integrations', [ 'hasAnalytics' => $hasAnalytics, 'installedExtensions' => $installedExtensions, 'extensionCount' => count($installedExtensions) ]); } } ``` ### Admin Library - Display Alerts Display flash alerts at the top of admin pages using Laravel's alert system with automatic styling for different message types. ```php updateSettings($request->all()); // Success alert (green) $blueprint->alert('success', 'Settings updated successfully!'); } catch (\Exception $e) { // Danger alert (red) $blueprint->alert('danger', 'Failed to update settings: ' . $e->getMessage()); } return redirect()->route('admin.extensions.myextension.index'); } public function configure(BlueprintAdminLibrary $blueprint) { $apiKey = $blueprint->dbGet('myextension', 'api_key', null); if (!$apiKey) { // Warning alert (yellow/orange) $blueprint->alert('warning', 'API key not configured. Some features may not work.'); } // Info alert (blue) $blueprint->alert('info', 'Remember to save your changes before leaving this page.'); return view('myextension.configure'); } public function maintenance(BlueprintAdminLibrary $blueprint) { // Multiple alerts can be chained $blueprint->alert('info', 'Starting maintenance tasks...'); $results = $this->runMaintenanceTasks(); if ($results['success']) { $blueprint->alert('success', "Maintenance completed. {$results['count']} items processed."); } else { $blueprint->alert('danger', 'Maintenance failed. Check logs for details.'); } return redirect()->back(); } } ``` ### Admin Library - Import Assets Import stylesheets and scripts into admin pages with automatic cache-busting to ensure users receive updated assets. ```php importStylesheet('/extensions/myextension/admin.css'); // Returns: // Import JavaScript file $jsScript = $blueprint->importScript('/extensions/myextension/admin.js'); // Returns: // Import multiple assets $chartJs = $blueprint->importScript('/extensions/myextension/charts.js'); $dashboardCss = $blueprint->importStylesheet('/extensions/myextension/dashboard.css'); $analyticsJs = $blueprint->importScript('/extensions/myextension/analytics.js'); return view('admin.extensions.myextension.index', [ 'cssLink' => $cssLink, 'jsScript' => $jsScript, 'chartJs' => $chartJs, 'dashboardCss' => $dashboardCss, 'analyticsJs' => $analyticsJs ]); } } // In the Blade view (resources/views/admin/extensions/myextension/index.blade.php): // @section('content-header') // {!! $cssLink !!} // {!! $dashboardCss !!} // @endsection // // @section('scripts') // {!! $jsScript !!} // {!! $chartJs !!} // {!! $analyticsJs !!} // @endsection ``` ### Client Library - Import Assets Import stylesheets and scripts into client-facing pages with cache-busting for updated assets. ```php importStylesheet('/extensions/myextension/client.css'); // Returns: // Import client-specific JavaScript $clientJs = $blueprint->importScript('/extensions/myextension/client.js'); // Returns: // Import third-party libraries $vue = $blueprint->importScript('/extensions/myextension/vendor/vue.min.js'); $tailwind = $blueprint->importStylesheet('/extensions/myextension/vendor/tailwind.css'); return view('myextension.client.dashboard', [ 'clientCss' => $clientCss, 'clientJs' => $clientJs, 'vue' => $vue, 'tailwind' => $tailwind ]); } } // In the Blade view: // @section('meta') // {!! $tailwind !!} // {!! $clientCss !!} // @endsection // // @section('content') //
Configure basic extension settings here.
Set up your API credentials and endpoints.
Configure advanced features and integrations.
Destructive actions that cannot be undone.