ramizasoft/prism

Prism core CLI engine built on Laravel Zero.

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/ramizasoft/prism

v1.1.0 2025-12-27 13:54 UTC

This package is auto-updated.

Last update: 2025-12-27 16:44:49 UTC


README

A high-performance static site generator platform for Amazon sellers to achieve brand verification and own their audience.

Built by RamizaSoft, Prism acts as a "factory" engine that powers 50+ client instances with a shared core, ensuring consistent compliance, performance (100/100 Lighthouse), and professional branding.

Key Features

  • Multi-Niche Presets: Instantly switch between "Clinical" (Vitamins), "Playful" (Pet Products), "Luxury", and "Organic" vibes via configuration.
  • Compliance Mode: Built-in, automated injection of regulatory requirements (FDA disclaimers for supplements, AAFCO statements for pet food).
  • Thin Client Pattern: Manage dozens of client sites from a single versioned core.
  • Fleet Management: Batch update and build entire fleets of repositories with a single command.
  • Performance Optimized: Architected for 100/100 Lighthouse scores out of the box.

Technology Stack

  • Core Engine: Laravel Zero (v12.x)
  • SSG: Jigsaw (v1.8.3) with Vite
  • Styling: Tailwind CSS (JIT Mode)
  • Configuration: Spatie Laravel Data (DTOs)
  • Language: PHP 8.2+ (Strict Types)

Getting Started

Prerequisites

  • PHP 8.2 or higher
  • Composer
  • Node.js & NPM

Installation

Option 1: Global Installation (Recommended for creating new projects)

composer global require ramizasoft/prism

Option 2: Local Installation (For existing projects)

composer require ramizasoft/prism

Creating a New Project

The easiest way to start is using the init command.

  1. Create a directory:

    mkdir my-brand
    cd my-brand
  2. Initialize the project:

    prism init

    Follow the interactive prompts to set your Project Name, Niche (Clinical, Playful, etc.), and Brand Color.

    This command automatically:

    • Generates config.php with your settings.
    • Creates bootstrap.php to link the core engine.
    • Sets up composer.json with the correct dependencies.
    • Scaffolds a basic source directory.
  3. Install & Build:

    composer install
    prism build
    prism build production

Configuration

Client Repository Setup

Prism uses a "Thin Client" pattern. Client repositories depend on the prism core package and should not contain custom PHP logic.

Core Events (bootstrap.php): Add the build listeners to the client's bootstrap.php to enable validation and template loading:

<?php

use Prism\Core\Listeners\BuildValidator;
use Prism\Core\Listeners\TemplateLoader;

/** @var \TightenCo\Jigsaw\Events\EventBus $events */
$events->beforeBuild([
    BuildValidator::class,
    TemplateLoader::class,
]);
  • BuildValidator: Loads config.php, strictly validates it against Spatie Data DTOs, and halts the build on error.
  • TemplateLoader: Registers the correct Blade templates based on the active niche preset.

Usage

1. Building your site

Instead of calling the Jigsaw binary manually, use the Prism wrapper:

# Development build (local)
prism build

# Production build (optimized)
prism build production

2. Fleet Management

Use the Prism CLI to manage updates across multiple client repositories.

Update all clients:

# Dry run to see what will happen
prism update:all --file=fleet.json --dry-run

# Execute updates and push to remote
prism update:all --file=fleet.json --push

Build all clients:

# Stop immediately if a build fails
prism build:all --file=fleet.json --stop-on-failure

Fleet File Format (fleet.json):

[
    "../clients/brand-alpha",
    "../clients/brand-beta"
]

3. Using Components

Supplement Facts Panel: Renders an FDA-aligned panel. Usage in Blade:

<x-prism::supplement-facts :data="$page->supplement" />

Development

Code Quality

  • Strict Typing: All files must start with declare(strict_types=1);.
  • Testing: We use Pest PHP. Run tests with ./vendor/bin/pest.
  • Formatting: Code must adhere to PSR-12.

Adding Features

  1. Core First: Implement logic in prism core, not client repos.
  2. Config Driven: Use PrismConfig DTOs to drive behavior.
  3. Validate: Add validation rules to DTOs to fail fast.

License

Prism is open-source software licensed under the MIT license.