Skip to main content

Example: A Simple CRM Extension

To see how the core concepts of the Spacedrive SDK come together, let’s look at an example of a simple CRM (Customer Relationship Management) extension. This extension will allow us to manage contacts, companies, and deals.

1. Model Definitions

First, we define our data models using the #[model] attribute.
This will create three tables in the database: ext_crm_contact, ext_crm_company, and ext_crm_deal, with the appropriate columns, indexes, and foreign keys.

2. A Job to Create a Contact

Next, we can create a job that adds a new contact to our CRM.

3. A Query to Find Contacts

Finally, we can create a query to find contacts, potentially with joins to other tables.
This simple example demonstrates how you can use the Spacedrive SDK to quickly build powerful, data-driven applications as extensions. With real database tables, automatic sync, and integration with core features like tagging, the possibilities are nearly limitless.