Architecture

Developed by EKR.

Deckixa is a modular Laravel application. PHP owns authorization, persistence, installation, billing and generation. Blade serves public/account/admin pages; small React islands implement creation, editing and presentation.

Directory Boundary
app/Domain/Accounts Isolated workspace creation
app/Domain/AI Adapters, shared output contract, reference context, credits/refunds
app/Domain/Agent Persistent conversation, bounded tool execution, draft state, event journal and call budgets
app/Domain/Images Image generation, capability checks and storage reservations
app/Domain/StockPhotos Unsplash discovery, workspace-owned selections, attribution and usage tracking
app/Domain/VisualAssets Local sanitized vector catalog, metadata and portable SVG embedding
app/Domain/Attachments Normalization, extraction and safe deletion
app/Domain/Billing Checkout intent, gateway, signed event dispatch, reconciliation
app/Domain/Installation First-run environment and empty-database installation
app/Domain/Presentations Slide schema, ownership, transactional saves and history
app/Domain/Themes Manifest, ZIP validation, resolution and rollback
app/Http Requests, thin controllers, policies and middleware
app/Jobs Generation, extraction and subscription event processing
resources/js Typed interactive UI
resources/data/slide-icons.json Shared, bundled icon identifiers and trusted SVG geometry
resources/views/theme/default Original theme and fallback layouts
tests Behavioral feature and editor-state tests

Ownership

Each user has a personal workspace. Presentations, references, generations, usage and billing belong to that workspace. Administrator management permissions do not bypass private deck policies. ULIDs/UUIDs provide identity, never authorization. Share tokens are random and only their hashes are stored.

Assistant sessions additionally belong to their initiating user. Another workspace member or administrator cannot read or operate that user's conversation by guessing its ID. An existing-deck edit requires an owned deck and its current revision before a session is created.

Saving

Immutable editor history supports undo/redo. SaveCoordinator serializes writes and preserves edits made during an in-flight request. A save uses the last confirmed revision; conflicts return 409. The UI offers a local JSON backup before discarding unsaved work.

Server actions lock workspace before deck, validate media ownership, save a snapshot and increment revision. The latest 30 versions are retained. Restore creates a new version.

Portable slide document

The deckixa.presentation.v1 document retains its original fields. Optional visual fields are additive, so existing decks and revision snapshots remain readable. SlideDocument owns server validation; resources/js/editor/types.ts defines the browser contract. Unknown object keys, arbitrary HTML/SVG/CSS, unsupported identifiers and values outside configured bounds are rejected.

Slide field Contract
visual One of eight presets; 1–6 items with an allowlisted icon, title, body, value and hex accent. Required for the visual layout.
background Solid/gradient type, two hex colors, 0–360 degree angle and hex text color.
decorations Up to three allowlisted shapes with logical corner position, hex color and opacity from 5–40.
motion Transition none/fade/slide/zoom; entrance none/fade/rise/zoom; duration 200–1200 ms; stagger 0–300 ms.
image_fit Optional cover or contain for an owned slide image.
elements The freeform layout holds up to 60 typed, editable text/shape/icon/image objects and, from 1.3, vector objects. FreeformElements defines geometry, typography, fills, strokes, locking and motion bounds. Images use owned media_id or stock_photo_id values.
vector_id A 1.3 vector object stores a namespaced library identifier such as tabler:rocket, never SVG markup or a remote URL. It must exist in the bundled catalog and files.

The icon registry contains 72 Lucide geometries with English/Arabic labels in six categories. Browser rendering, server validation and HTML export share it. Documents store only icon identifiers, never SVG markup. PresentationOutput uses the same allowlists in structured provider output; returned slides are validated again before persistence.

Rendering and export

SlideCanvas renders the editor, navigator and presenter. slide-visuals.css supplies the shared compositions and motion grammar used by the browser and portable HTML export. Motion uses actual navigation/view changes, finite CSS animation and bounded staggering. Reduced-motion and print rules disable animation without hiding content.

PPTX export loads PptxGenJS only when requested. Text, component cards, decorative shapes, charts and tables remain native editable objects; bundled icons use SVG with a compatibility preview. exportVisuals lays out resource compositions. pptxDocument then updates only generated OOXML to insert native gradient fills, transitions and entrance timing. Exporter-assigned names identify eligible shapes; timing targets their generated IDs. It assigns unique timing-node IDs, preserves static visibility and leaves backgrounds/branding outside entrance sequences. A small compatibility correction places the PptxGenJS 4.0.1 notes-master list in schema order.

Native entrance effects combine fade with bounded position or scale behavior. PowerPoint slide transitions use its standard fast/medium/slow speed categories; element durations and stagger retain millisecond values. Tests exercise actual archives, target IDs, timing bounds, schema allowlists and escaping. Microsoft OpenXML SDK validation passed for the native motion fixtures and a six-slide deck downloaded through the Chrome editor, including its SVG icons and PNG previews. Every animation target resolved and timing IDs were unique. Desktop playback has not been verified in the release environment, and individual presentation viewers may interpret effects differently.

Legacy single-step generation

A workspace transaction reserves credits and a presentation slot. Idempotency prevents duplicate reservation. A job claims a queued record once, calls the provider outside the transaction, validates structured output, then saves under locks. Its payload holds only the generation ID. Failure/expiry refunds the original UTC usage bucket once.

Conversational presentation agent — 1.2

AgentCoordinator creates or resumes a session and serializes user input with workspace reservations. AgentSession, AgentMessage, AgentEvent and AgentRun persist state, public conversation, tool results and execution identity. Their content-bearing state, messages, event data and action payloads use encrypted casts. A provider/model is selected once for the session; execution checks its current server availability without silently substituting another model.

AgentModelGateway requests one schema-constrained decision containing a short public message and a registered action. AgentRuntime executes the action, records its actual result, and queues the next decision. The next model context contains conversation, the current draft, plan, allowed resources and previous tool results. Questions are authored by the model through ask_user; there is no fixed audience/goal/tone questionnaire. Instructions tell the model to follow the user's conversation language, with UI locale only a hint. The output document retains its supported direction locale while its text can use other languages.

Tool Effect
ask_user Persists one question and optional short choices, then pauses in awaiting_user.
plan_deck Updates the draft title, content language, summary and outline for the session's slide count.
inspect_resources Lists allowed image IDs, bundled icons/fonts/shapes and resource availability.
search_vectors / use_vector Searches compact local vector metadata and selects returned IDs before they enter the slide-writing allowlist. No SVG markup is sent to the model.
search_stock_images / use_stock_image Searches the configured stock service and selects only results returned to this session.
generate_image Queues a bounded image request only with the session's explicit image opt-in; the agent waits for its result without spending model calls on polling.
write_slide Validates and replaces one draft slide with editable freeform objects. Locked source objects are retained.
style_elements Applies selected style fields to existing unlocked objects across selected slides without rebuilding their content, geometry, identity or references.
finish_deck Validates the whole draft and creates the deck, or saves an existing deck through normal revision/history checks.

The agent's write_slide input uses opacity_fraction from 0 to 1: 1 is fully opaque and 0.4 is 40% opacity. The tool boundary converts that value into the document/editor's opacity percentage from 0 to 100. It rejects percentage values in tool input instead of guessing their units. Stored documents and editor/export contracts retain their existing percentage representation.

Vector search returns at most twelve semantic results per agent action; selected IDs alone enter the structured slide schema. Existing deck assets remain available to its edit session. Search/selection counts are bounded separately from model calls. asset_color supports non-destructive tint changes to the original icons and recolorable vector assets. Multicolor artwork keeps its native palette; its metadata lets the editor omit an ineffective tint control. Original 72-icon documents remain compatible.

The shared renderer uses a fixed same-origin SVG route and validated color. Passive gallery previews use that same renderer with motion/handlers disabled and attribution links rendered as text, avoiding nested interactive controls. Portable HTML embeds the actual local SVG data and bounds repeated vector payloads to 20 MB. PowerPoint embeds SVG artwork, with native object position, rotation, opacity, framing and motion. Missing preloaded artwork stops export visibly. Inline primitive gradients use unique rendered-instance IDs; HTML gradients include slide identity to avoid collisions between duplicated objects.

For style-only requests the agent is instructed to prefer style_elements. Its zero-based slide list and optional exact object IDs define the scope; an empty object-ID list selects all unlocked objects on those slides. Nullable opacity/fill/stroke/radius/text-color/font-size fields leave omitted changes explicit. Unknown IDs, unavailable slides, empty styles and unmatched/locked-only scopes are rejected. Only actually changed slides add to the credit reservation and emit slide.updated. An already satisfied style reports already_applied and can complete without creating a needless revision, while retaining the existing minimum edit-session credit. Context reports changed_slide_indices and each slot's edited flag to help the model avoid repeating completed work. A repeated-action guard reports loop_detected separately from a real budget limit.

One queue invocation performs at most one model request. A run sequence and lease prevent duplicate queue delivery from repeating it. Provider I/O occurs outside the mutation transaction; the lease and session status are checked again before applying its result. Cancellation invalidates active leases. A late response may add sanitized usage accounting, but cannot add messages, write slides or finish a cancelled session.

A definitively received successful HTTP response with invalid action JSON or an invalid action envelope can trigger one automatic correction per run. The runtime persists that retry allowance, records the receipt, adds a strict-JSON correction instruction without the raw output, emits model.retrying, and queues a separate step. That step consumes ordinary call/output budgets. A second invalid action stops the run. Funding errors, ambiguous transport/timeouts, incomplete completions, context errors and revision conflicts are not automatic retry candidates.

New-deck sessions reserve their requested slide credits once and reserve presentation capacity alongside manual/legacy creation. Edits reserve one credit initially and additional credits for distinct changed slides. Failure/cancellation releases that slide reservation once; the separate daily call/output reservation is not refunded. Existing-deck completion uses SavePresentation, including the supplied base revision and revision snapshot. Conflicts preserve the assistant draft and leave the current deck untouched.

The journal records actual model/tool/resource/status transitions. Its snapshot reloads session state under a short session lock. version is the latest session event ID, while cursor is only the last event delivered in the current page. Consumers reject older versions, merge events by ID, and drain remaining pages when has_more is true—even after completion or cancellation. These events represent execution progress and public responses, not hidden model reasoning.

OpenCode reference and scope

The implementation was informed by the official OpenCode repository at commit 2fa3363c924c5c3e367b84a87ae478296a0ed59b: its session loop, tool-state processor, and question tool. The adapted patterns are successive model/tool steps, explicit question suspension, real lifecycle events, repeated-action detection and cancellation.

Deckixa implements those patterns in native PHP using Laravel queues, SQL transactions and a portable structured-action contract. It does not embed OpenCode, execute its terminal runtime, or expose shell/code-execution tools. No OpenCode source is included in the customer package. The permitted actions are presentation and resource operations validated by Deckixa's own domain services.

Billing

BillingGateway separates transport from business rules. Checkout identity is persisted before network access. Webhooks store minimal signed events before dispatch. Scheduled recovery handles delivery gaps. Sync reads the current Stripe subscription to resist out-of-order events.

Extension

Add an AI adapter through PresentationGenerator and ConfiguredPresentationGenerator; retain output validation, fixed endpoints and tenant-checked context. Test refusals, malformed responses, references and refunds.

A slide layout affects SlideDocument, TypeScript types, inspector, SlideCanvas, structured AI output, HTML and PPTX exports. Update them together and preserve existing optional-field semantics. New icons must be added to the bundled registry and retain their license attribution; never accept uploaded executable geometry as a document field. Themes customize views/assets; they do not install arbitrary dependency trees or database migrations. Domain actions exist where they protect transactions and invariants, rather than duplicating Eloquent CRUD.