# Getting Started

Learn how to extend PteroCA with custom functionality through the plugin system.

## Introduction

PteroCA v0.6+ includes a comprehensive plugin system that allows developers to extend the panel with custom functionality without modifying the core codebase. This guide covers everything you need to know to create powerful, secure, and maintainable plugins.

### What is a Plugin?

A plugin is a self-contained extension that adds new features to PteroCA. Plugins are:

* **Isolated**: Separate from core code, making upgrades safer
* **Modular**: Can be enabled/disabled independently
* **Extensible**: Access to powerful framework capabilities
* **Secure**: Automatically scanned for security vulnerabilities
* **Maintainable**: Clear structure and conventions

### Plugin Architecture

PteroCA plugins are built on Symfony 7 and integrate seamlessly with the framework:

* **Symfony Services**: Full dependency injection support
* **Doctrine ORM**: Database entities and migrations
* **Twig Templates**: Templating engine for views
* **Event System**: Subscribe to system events
* **EasyAdmin**: Extend the admin panel with CRUD interfaces

### Plugin Capabilities

Plugins can implement any combination of these capabilities:

| Capability   | Description                                |
| ------------ | ------------------------------------------ |
| `routes`     | Custom HTTP routes and controllers         |
| `entities`   | Database entities (Doctrine ORM)           |
| `migrations` | Database schema changes                    |
| `ui`         | Dashboard widgets, server tabs, menu items |
| `eda`        | EasyAdmin CRUD controllers                 |
| `console`    | CLI commands                               |
| `cron`       | Scheduled tasks (cron jobs)                |

### Check Existing Plugins First

Before creating a custom plugin, check if similar functionality already exists:

* [**PteroCA Marketplace**](https://marketplace.pteroca.com) — Browse curated, security-scanned plugins
* **Discord `#plugins-releases`** — Latest community releases and discussions
* **GitHub** — Search for "pteroca-plugin" topic

If you find an existing plugin that's close but not perfect, consider:

1. Contributing to the existing plugin (open source)
2. Forking and extending it
3. Building your own if requirements differ significantly

### Publishing Your Plugin

Once you've created a plugin, share it with the community:

{% hint style="success" %}
**Publish on PteroCA Marketplace**

Submit your plugin to the [PteroCA Marketplace](https://marketplace.pteroca.com) to reach the entire PteroCA community.

**Benefits:**

* ✅ Wider audience reach
* ✅ Automated security scanning
* ✅ Community reviews and ratings
* ✅ Version management
* ✅ Free and paid distribution options
* ✅ Developer support and feedback

**Visit:** [marketplace.pteroca.com](https://marketplace.pteroca.com)
{% endhint %}

**Other distribution channels:**

* GitHub releases (open source)
* Discord community sharing
* Your own website or portfolio
* Direct distribution to clients

***

### When to Create a Plugin

Create a plugin when you need to:

* Add a new payment provider (Stripe, PayPal, Coinbase, etc.)
* Integrate with external services (Discord, Telegram, webhooks)
* Implement custom business logic specific to your needs
* Extend the admin panel with custom management interfaces
* Add automation and scheduled maintenance tasks
* Create custom dashboard widgets or server management tools

### When NOT to Create a Plugin

Consider other approaches for:

* **Minor UI tweaks**: Use themes instead
* **Configuration changes**: Use settings and environment variables
* **Core functionality changes**: Consider contributing to PteroCA core
* **Single-use scripts**: Use console commands or cron jobs directly

## Next Steps

Now that you understand what plugins are and when to use them, continue with:

* [Plugin Structure](https://docs.pteroca.com/for-developers/plugins/plugin-structure) - Learn about plugin file organization
* [Plugin Manifest](https://docs.pteroca.com/for-developers/plugins/plugin-manifest) - Configure your plugin with plugin.json
* [Bootstrap & Lifecycle](https://docs.pteroca.com/for-developers/plugins/bootstrap-and-lifecycle) - Initialize and cleanup logic

## Need Help?

* Check [Example Plugins](https://docs.pteroca.com/for-developers/plugins/examples) for working code samples
* Review [Best Practices](https://docs.pteroca.com/for-developers/plugins/best-practices) for guidelines
* Join [Discord Community](https://discord.com/invite/Gz5phhuZym)
* Report issues on [GitHub](https://github.com/PteroCA-Org/panel/issues)
