dystcz/dystore-api
JSON:API layer for the Dystore headless commerce stack on Laravel. Exposes products, carts, orders, customers, and checkout as JSON:API endpoints built on Lunar, letting any storefront, SPA, or mobile app run off a single Laravel backend.
Architecture fit
dystcz/dystore-api is not a standalone product; it is a presentation layer that sits on top of Lunar (a Laravel headless commerce domain package) and exposes the catalog/order domain through a JSON:API contract. Architecturally that is a clean separation: Lunar owns entities, pricing, and persistence; Dystore owns routing, serialization, sparse fieldsets, includes, filtering, and pagination semantics. For a team already committed to Laravel and to Lunar as the commerce core, this is a natural seam — it converts an in-process domain package into a consumable HTTP contract without requiring you to hand-roll controllers, resources, and query parsing.
For a team not on Lunar, this package is not an entry point. It presumes the Lunar data model and its version line; adopting Dystore means adopting Lunar, its migration set, and its release cadence in the same decision. The real evaluation is therefore "Lunar + JSON:API layer" as a bundle, not Dystore in isolation.
Integration feasibility
Standard Composer install into a Laravel application, route registration, and JSON:API configuration (server definition, resource schemas, authorization hooks). The friction is concentrated in three places: (1) the JSON:API spec surface — clients must handle application/vnd.api+json, compound documents, include/fields[...]/filter[...] query grammar, and relationship linkage; (2) auth — you will be wiring Sanctum/passport and per-resource authorization policies yourself; (3) the write path — the repo is marked read-only in its own description, which, if it means GET-only endpoints, pushes cart, checkout, payment, and customer mutation entirely outside this package and into bespoke controllers. That last point is the single largest scope question and must be resolved before commitment.
Technical risk
include-driven eager loading is powerful and easy for clients to abuse; unbounded includes against a large catalog is a predictable performance incident.Key questions
Stack fit Fits Laravel 10/11-era applications using Composer, MySQL/Postgres, Redis, and a queue worker. It assumes a headless posture — the storefront is a separate SPA/SSR/mobile client consuming JSON. If your roadmap includes a server-rendered Blade storefront, this package adds a contract you will not use and a dependency you will still have to patch.
Migration path Two realistic entry paths:
/api/v1/store) alongside existing endpoints, and migrate read traffic (catalog, product detail, search, order history) first. Existing write endpoints stay untouched until the read path is proven. This is the lower-risk route and the one I would recommend.Do not attempt a big-bang cutover of checkout.
Compatibility
Pin exact versions of Dystore, Lunar, and Laravel in composer.json and treat any Lunar minor bump as a scheduled change with a regression run, not a routine composer update. Maintain a short compatibility matrix in-repo. Freeze the JSON:API media type and query grammar as a published contract and version it; clients must not depend on resource type strings you have not committed to.
Sequencing
Maintenance Budget ongoing effort for upstream upgrades — this is the recurring cost, not the initial integration. Assign a named owner with Laravel depth. Assume you may need to carry a fork; keep local patches isolated in a thin wrapper package or a small set of overridden resource classes so a fork stays mergeable.
Support No commercial support is implied. Escalation is GitHub issues and reading source. Plan for internal triage: an on-call engineer who can read Lunar's Eloquent layer is the realistic requirement. If commerce is revenue-critical, an internal fork with a maintenance retainer is the honest posture.
Scaling Read traffic scales well with standard tactics: HTTP caching keyed on the full query string (includes and fieldsets make cache keys combinatorial — cap and normalize them), CDN in front of anonymous catalog endpoints, Redis for sessions and query caches, read replicas for catalog. The genuine scaling risk is query amplification from client-chosen includes; enforce a server-side allowlist per resource and reject unknown include paths. Write throughput is not a concern for this layer if it is read-only — but that also means checkout scaling is a problem you solve elsewhere.
Failure modes
include chain that produces a multi-second query. Mitigate with allowlisting, query timeouts, and per-endpoint budgets.type). Mitigate with snapshot tests on response fixtures.Ramp-up
Client teams need JSON:API literacy — compound documents, included resolution, sparse fieldsets, and relationship URLs are a genuine learning curve, roughly 2–5 days for a competent frontend engineer and longer for the team to converge on conventions. Backend engineers need Lunar domain familiarity plus the JSON:API Laravel server abstraction: 1–2 weeks to first independent change. Document your own query conventions rather than pointing at the spec.
Recommendation Adopt as an accelerator, not a foundation. It is a credible read-layer for a Lunar-based headless build and saves real weeks of serialization work; the small ecosystem, upstream coupling, and unresolved write-path question make it unsuitable as a strategic dependency without a fork-and-own plan and an explicit exit path.
How can I help you explore Laravel packages today?