AppManager Module & Boilerplate Integration Documentation

1. Introduction

This document outlines the functionality of the AppManager Module and its integration with a target Boilerplate Application. The primary goal is to provide a robust system for licensing, activation, and secure distribution of application files and updates.

1.1. Purpose of AppManager Module (Server-Side)

The AppManager module acts as a central server for:

1.2. Purpose of Boilerplate Integration (Client-Side)

The boilerplate application integrates with the AppManager module to:

2. AppManager Module (Server-Side)

This section details the features and configuration of the AppManager module itself, which runs as part of your main Laravel application (e.g., `digitalvocano.co.za`).

2.1. Key Features Implemented

2.2. Configuration (config/appmanager.php & .env) Implemented

2.3. Future Enhancements / To-Do To-Do

3. Boilerplate Integration (Client-Side)

This section describes how a typical boilerplate application (e.g., your TALL stack application) integrates with the AppManager module.

3.1. Installation & Activation Flow Implemented

A multi-step wizard guides the user through the initial setup of the boilerplate:

  1. Step 1: License Verification (/install/activate-application)
    • User provides their License Key or Envato Purchase Code.
    • User provides the primary domain for the application (e.g., digitalvocano.co.za or localhost/myproject for XAMPP).
    • The boilerplate's BoilerplateActivationController calls the AppManager's /api/app-manager/activate endpoint.
    • If successful, activation details are stored temporarily in the session, and the user proceeds to the next step.
  2. Step 2: Database & Admin User Setup (/install/setup-application)
    • User provides database connection details (host, port, database name, username, password).
    • User creates the initial admin user account (name, email, password).
    • The BoilerplateActivationController:
      • Tests the database connection.
      • Updates the boilerplate's .env file with DB credentials.
      • Runs database migrations (php artisan migrate --force).
      • Creates the admin user in the database and assigns a role (e.g., 'super_admin').
  3. Step 3: Finalization & Core File Download
    • The BoilerplateActivationController:
      • Permanently stores activation details (activation token, license key used, activated domain, license status, product version) into the boilerplate's `settings` database table.
      • Downloads essential core files (e.g., `AuthServiceProvider.php`, `custom_helpers.php`) from the AppManager using the received activation token. Note: `config/app.php` is NOT downloaded to avoid overwriting critical boilerplate-specific configurations.
      • Marks the installation as complete by setting `boilerplate_install_complete` to `true` in the `settings` table.
      • Attempts to clear relevant Laravel caches (config, etc.).
      • Logs in the newly created admin user.
      • Redirects the user to the admin dashboard.
      • Flashes a message prompting the user to delete the installation directory for security.

3.2. Ongoing License Verification (Middleware) Implemented

The EnsureAppIsActivated middleware (aliased as app.activated) protects the boilerplate application after installation:

3.3. Configuration (Boilerplate's .env & config/app.php) Implemented

The boilerplate requires these settings (primarily in .env, read via config/app.php):

The following are stored in the boilerplate's `settings` database table by the installer:

3.4. Post-Installation Security Partially Implemented

3.5. User Experience Partially Implemented

3.6. Future Enhancements / To-Do (Boilerplate) To-Do

4. Local Development & XAMPP Considerations

The system is designed to work in local development environments like XAMPP.

5. AppManager API Reference (Brief)

The AppManager module exposes the following key API endpoints for boilerplate interaction:

Method Endpoint Purpose Key Payload Fields Success Response Fields
POST /api/app-manager/activate Activates a license/purchase code for a product and domain. license_key OR purchase_code, product_slug, domain, server_signature (optional) status: "success", activation_token, product_info, license_info
POST /api/app-manager/validate-license Periodically re-validates an existing license for a domain. license_key, product_slug, domain status: "valid" or status: "invalid"
POST /api/app-manager/download-file Downloads a specific file for an activated product. activation_token, product_slug, file_identifier, version File stream with X-File-Hash header.

Documentation last updated: {{ date("Y-m-d H:i:s") }}