Core Concepts

Understanding Stellify's Architecture

Stellify stores your application as structured JSON in a database instead of text files. This fundamental shift enables instant refactoring, intelligent code reuse, and AI-native development.

The Big Idea

Traditional codebases are text files that humans and machines struggle to modify reliably. Stellify treats your application as structured data - every element, method, and line of code is a queryable database record with relationships.

What This Means for You

  • Update a method once, all references update instantly
  • Reuse battle-tested code across projects automatically
  • AI can read and write code with surgical precision
  • No merge conflicts - work on the same file simultaneously

The Hierarchy

Your application is organized in a hierarchical structure, similar to a traditional file system but stored as database records:

Project
└── Directories (e.g., "Controllers", "Models")
    └── Files (e.g., "UserController.php")
        └── Methods (e.g., "store()")
            └── Statements (individual lines of code)
                └── Clauses (code fragments like variables, operators)

What You Work With

  • Directories - Organize files, just like folders (Controllers, Models, etc.)
  • Files - PHP classes, controllers, models - contain methods
  • Methods - Functions that do things - contain statements
  • Statements - Individual lines of code
  • Clauses - The smallest pieces (variables, operators, values)

For interface building, there's also Elements - HTML components like divs, buttons, forms.

How It Works in Practice

Creating a Controller Method

When you create a new controller method in Stellify:

  1. You select the file (UserController)
  2. Create a method (store)
  3. Add statements (the actual code logic)
  4. Stellify stores everything as connected database records
  5. When needed, it assembles these records into executable PHP

You Don't Need to Think About This

Use the IDE or API to work with your code naturally. Stellify handles the JSON structure behind the scenes. You interact with files and methods just like any other development tool.

The Deduplication Magic

Here's where Stellify gets powerful: automatic code reuse.

Global Libraries

Stellify maintains global libraries of proven code patterns:

  • Method Library - Common utility methods (validateEmail, formatDate, etc.)
  • Statement Library - Frequently-used code patterns

When you (or AI) write code that matches an existing pattern, Stellify automatically references the existing version instead of creating a duplicate. Over time, your codebase becomes more efficient and consistent.

How Deduplication Works

  1. You create a method or statement
  2. Stellify computes a hash of the code
  3. Checks if this exact code already exists in the global library
  4. If yes: references the existing version, increments its usage count
  5. If no: creates a new entry that can be reused later

Real Benefits

  • Import the same utility function 10 times - stored once
  • AI suggests existing methods instead of writing duplicates
  • Popular patterns become battle-tested through usage
  • Smaller database, faster queries, more consistent code

Working with Stellify

Through the IDE

The Stellify IDE provides visual tools for:

  • Code Editor - Write PHP methods with syntax highlighting and autocomplete
  • Interface Builder - Drag-and-drop HTML elements
  • Bulk Editor - Update multiple files/methods at once

Through the API

The REST API enables programmatic access for AI agents and custom tools:

# Create a new method
POST /api/v1/method
{
    "file": "controller-uuid",
    "name": "store",
    "returnType": "redirect"
}

# Search global library for reusable methods
POST /api/v1/method/search-global
{
    "name": "validateEmail",
    "limit": 10
}

With AI via MCP

AI assistants can connect via the Model Context Protocol to:

  • Search for existing code patterns before generating new ones
  • Create and modify methods with surgical precision
  • Refactor code across your entire project instantly
  • Suggest improvements based on usage patterns

Key Differences from Traditional Development

Traditional Stellify
Files are text Files are structured JSON
Edit text directly Edit through API or IDE
Find/replace with regex Query database with SQL
Git merge conflicts Granular, conflict-free updates
Duplicate code everywhere Automatic deduplication
AI rewrites everything AI references existing patterns

From Database to Executable Code

When your application runs, Stellify:

  1. Receives an HTTP request
  2. Looks up the route in the database
  3. Fetches the controller and method definitions
  4. Assembles statements and clauses into PHP code
  5. Executes the assembled code
  6. Returns the response

For deployment, you can export your entire application as traditional PHP files if needed.

Why This Matters

For You

  • Faster development - Reuse code automatically, refactor instantly
  • Higher quality - Battle-tested patterns, consistent code
  • Better collaboration - No merge conflicts, granular permissions
  • AI superpowers - AI can actually understand and modify your code

For AI

  • Structured context - No token waste parsing text files
  • Precise modifications - Update specific methods, not entire files
  • Knowledge sharing - Global libraries = shared AI knowledge
  • Zero hallucination - AI references actual code, doesn't imagine it

Getting Started

The best way to understand Stellify is to use it:

  1. Set up your database connection
  2. Create your first project through the IDE
  3. Add a controller with a simple method
  4. See how Stellify assembles it into working PHP

The structure becomes intuitive quickly - you're still building Laravel applications, just with a more intelligent foundation.

Deep Dive Available

If you need technical details about the JSON structure, database schema, or API endpoints, check out the API documentation.

Previous
Hosting

Please be aware that our documentation is under construction.