# Managing Applications

Configure and manage apps on VibesEZ-Laptop.

## Built-in Apps

The following apps are always available:

| App        | Purpose           | Removable | Configurable |
| ---------- | ----------------- | --------- | ------------ |
| Notes      | Text notes        | No        | Yes          |
| Tasks      | To-do management  | No        | Yes          |
| Calculator | Math operations   | No        | No           |
| Crypto     | Wallet management | No        | Yes          |
| Settings   | User preferences  | No        | No           |

## Configurable Apps

### Notes App Configuration

Edit `config/apps.lua`:

```lua
Config.Apps.Notes = {
    Enabled = true,
    CharacterLimit = 50000,
    MaxNotesPerPlayer = 1000,
    AllowSharing = true,
    AllowCategories = true
}
```

### Tasks App Configuration

```lua
Config.Apps.Tasks = {
    Enabled = true,
    MaxTasksPerPlayer = 5000,
    AllowRecurring = true,
    AllowSubtasks = true,
    AllowReminders = true
}
```

### Crypto App Configuration

```lua
Config.Apps.Crypto = {
    Enabled = true,
    TransactionTimeout = 30,  -- seconds
    MaxTransferAmount = 999999999,
    MinTransferAmount = 1,
    AllowOfflineTransfers = true
}
```

## External App Management

### Approving External Apps

Before players can install external apps:

1. Review app code and intent
2. Verify no malicious behavior
3. Check performance impact
4. Test in development
5. Approve in whitelist (if whitelist enabled)

### Whitelist System

```lua
Config.ExternalApps = {
    UseWhitelist = true,  -- Require approval
    Whitelist = {
        'approved_app_1',
        'approved_app_2'
    }
}
```

### Blacklist System

Block specific apps:

```lua
Config.ExternalApps = {
    UseBlacklist = true,
    Blacklist = {
        'bad_app_1',
        'exploitative_app'
    }
}
```

## Application Permissions

### Permission System

Control what apps can access:

```lua
Config.AppPermissions = {
    DefaultApp = {
        accessWallet = false,        -- Can read wallet
        accessTransactions = false,  -- Can read history
        initiateTransfers = false,   -- Can send money
        accessNotes = false,         -- Can read notes
        accessTasks = false          -- Can read tasks
    },
    TrustedApps = {
        ['trusted_app'] = {
            accessWallet = true,
            accessTransactions = true,
            initiateTransfers = false
        }
    }
}
```

### Per-App Permission Configuration

For each external app:

* Define what it can access
* Restrict sensitive operations
* Require user confirmation
* Log permission usage

## Pre-installed Apps

Configure what apps launch with new laptops:

### Default Installation

```lua
Config.PreinstalledApps = {
    {
        id = 'notes',
        label = 'Notes',
        defaultInstalled = true,
        pinned = true
    },
    {
        id = 'tasks',
        label = 'Tasks',
        defaultInstalled = true,
        pinned = true
    },
    {
        id = 'calculator',
        label = 'Calculator',
        defaultInstalled = true,
        pinned = false
    },
    {
        id = 'crypto',
        label = 'Crypto',
        defaultInstalled = true,
        pinned = true
    },
    {
        id = 'settings',
        label = 'Settings',
        defaultInstalled = true,
        pinned = false
    }
}
```

### Custom Pre-installation

Add custom apps to default installation:

```lua
Config.PreinstalledApps = {
    -- ... built-in apps ...
    {
        id = 'your_company:messenger',
        label = 'Company Messenger',
        defaultInstalled = true,
        pinned = true
    }
}
```

**Note:** External app must exist and be accessible

## Performance Management

### App Limits

Prevent resource abuse:

```lua
Config.AppLimits = {
    MaxInstalledApps = 50,           -- Per player
    MaxTotalAppSize = 500000,        -- KB per player
    MaxSimultaneousApps = 3,         -- Running at once
    AppCacheSize = 10000             -- KB per app
}
```

### Monitoring App Performance

Track problematic apps:

* CPU usage per app
* Memory usage per app
* Crash frequency
* User complaints
* Update frequency

**Response Actions:**

* Warn users
* Limit availability
* Disable if critical
* Remove if necessary

## Security Management

### Dangerous Apps

Identify and manage risky apps:

```lua
Config.Security = {
    BlockRiskyApps = false,  -- Manual review instead
    RiskyApps = {
        'known_malware_app',
        'exploit_app'
    }
}
```

### Permissions Audit

Regularly review:

* What permissions each app has
* Which apps access wallets
* Which apps access personal data
* Suspicious permission requests

### Suspicious Behavior

Watch for apps that:

* Access wallets unnecessarily
* Make unauthorized transfers
* Steal personal data
* Crash repeatedly
* Use excessive resources

**Action:** Blacklist immediately if confirmed.

## Update Management

### Automatic Updates

Control update behavior:

```lua
Config.Updates = {
    AutoUpdate = false,
    AllowUserChoice = true,
    UpdateCheckInterval = 3600,  -- seconds
    ForceUpdateAfter = 604800    -- 7 days
}
```

### Update Deployment

For major updates:

1. Test thoroughly
2. Create maintenance window
3. Notify players in advance
4. Deploy update
5. Monitor for issues
6. Have rollback ready

### Version Tracking

Keep records of:

* App versions installed
* User app versions
* Update dates
* Problem versions
* Deprecated versions

## Troubleshooting Apps

### App Won't Install

**Possible causes:**

* Insufficient storage
* Compatibility issues
* Permission denied
* Corrupted app data

**Admin Actions:**

* Check storage space
* Verify app integrity
* Reset app permissions
* Force reinstall

### App Crashes Repeatedly

**Investigation:**

* Check error logs
* Review recent changes
* Check for conflicts
* Test in isolation

**Resolution:**

* Update app
* Uninstall/reinstall
* Disable incompatible features
* Remove completely if necessary

### App Using Too Many Resources

**Monitoring:**

* CPU usage spikes
* Memory leaks
* Network bandwidth
* Disk I/O excessive

**Actions:**

* Throttle app
* Limit simultaneous use
* Restrict features
* Disable if critical

## App Hooks & Events

### App Lifecycle Events

```lua
--- Called when app installed
function OnAppInstalled(appId, playerId)
end

--- Called when app launched
function OnAppLaunched(appId, playerId)
end

--- Called when app uninstalled
function OnAppUninstalled(appId, playerId)
end

--- Called when app crashed
function OnAppCrashed(appId, playerId, error)
end
```

### Monitoring Integration

Connect to your monitoring:

* Track app lifecycle events
* Log to database
* Alert on crashes
* Generate reports

## Admin Commands (Optional)

If your framework supports custom commands:

```lua
-- Disable app for all players
/disableapp <app_id>

-- Force reinstall app
/reinstallapp <app_id>

-- Clear app cache
/clearcache <app_id>

-- View app stats
/appstats <app_id>
```

## Best Practices

✓ Review external apps carefully before allowing

✓ Keep pre-installed apps minimal to start

✓ Monitor resource usage regularly

✓ Have update process planned

✓ Test major changes in development

✓ Communicate changes to players

✓ Keep audit trails of app management

✓ Security first approach

✓ Regular permission audits

***

Need more help? See [Troubleshooting](/vibesez/docs/laptop/for-administrators/troubleshooting.md) or [Configuration](https://github.com/VibesEZ/VibesEZ-Laptop/blob/main/docs/admin/configuration.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vibesez.gitbook.io/vibesez/docs/laptop/for-administrators/managing-apps.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
