dystcz/lunar-api
REST API layer for Lunar, the Laravel e-commerce platform. Exposes products, orders, customers, carts, and more through configurable JSON endpoints, with authentication, API resources, and OpenAPI-ready documentation for storefronts and integrations.
Architecture fit. dystcz/lunar-api is a presentation-layer package: it exposes Lunar's Eloquent domain (products, variants, carts, orders, pricing, media) through JSON:API-compliant endpoints rather than introducing new commerce logic. That is the correct shape for a headless deployment — it keeps the commerce core vendor-owned and gives storefronts a versioned contract. Fit is high if Lunar is already the commerce engine; it is near-zero otherwise, since the package has no standalone value.
Integration feasibility. Standard Laravel package mechanics: Composer install, service provider auto-discovery, configurable route prefix and middleware, JSON:API serialization (spatie-style sparse fieldsets, includes, filters, pagination, error objects). Realistic effort is low-to-moderate — a few days of config and auth wiring, plus meaningful time on contract validation and frontend client adaptation. The hard part is not installation; it is agreeing the resource schema and include graph with client teams.
Technical risk. The [READ ONLY] designation is the dominant risk and should be treated as a gate, not a footnote. It strongly implies the repository is archived or mirrored from a private upstream: no issue triage, no PRs, no roadmap influence, and no guarantee of patches for Lunar security releases. Secondary risks: tight coupling to Lunar internals (model/relationship renames propagate directly into serializers), thin community (42 stars, effectively single-vendor), uncertain endpoint coverage beyond catalog and cart, and JSON:API's own complexity tax on client teams. The score of ~16/100 with an opportunity score of 0.43 suggests a usable glue package, not a strategic asset — do not build differentiation on top of it.
Key questions.
Stack fit. PHP 8.x, Laravel 10/11, Lunar 1.x, with Next.js/Nuxt/mobile clients using a JSON:API deserializer. It slots in as the API edge in front of Lunar, behind your existing gateway/WAF and auth middleware. It does not replace queue, search (Meilisearch/Elastic), or CDN layers — those remain separate concerns.
Migration path. Greenfield is straightforward: install alongside Lunar, publish config, mount under /api/v1, wire auth, point the storefront at it. Brownfield is a resource-by-resource replacement of hand-rolled REST controllers or Lunar's default endpoints, starting with read-only catalog (lowest blast radius), then cart, then checkout last. Keep the legacy path live behind a feature flag per resource so rollback is a routing change, not a deploy.
Compatibility. Pin exact versions of Lunar, the package, and the JSON:API serializer in composer.lock; add a CI matrix that runs the package's contract tests against each Lunar minor you intend to support. Because the upstream is read-only, treat every Lunar upgrade as a potential breaking change requiring a manual compatibility review.
Sequencing.
Maintenance. Assume you own it. A read-only upstream means either an internal fork with a named maintainer and a patch cadence, or a thin adapter layer that isolates Lunar model changes from the serializers. Budget roughly 10–20% of one backend engineer per quarter for dependency bumps, Lunar compatibility, and contract changes — more in the first two quarters.
Support. Community-only, no SLA, no vendor escalation path. Supportability therefore depends on your own runbooks and fixtures. Track upstream commit activity as a leading indicator; a silent repo for two quarters should trigger the fork decision.
Scaling. JSON:API is stateless and horizontally scalable, so the API tier itself is not the bottleneck — the database is. Expect pressure from compound documents and deep include graphs (N+1 across variants, prices, media). Mitigations: hard caps on include depth and page size, Redis caching for catalog reads, eager-loading enforced in code review, read replicas for catalog, and queue-backed writes for cart mutations. Validate Octane compatibility explicitly if you run it — package service providers and serializers occasionally hold state.
Failure modes. Silent spec drift breaking typed clients on upgrade; Lunar model renames surfacing as 500s on relationships; token expiry mid-checkout losing carts; include/pagination edge cases returning inconsistent page contents; missing rate limits enabling catalog scraping; and the classic — no upstream patch for a Lunar CVE, leaving you to backport under time pressure.
Ramp-up. A mid-level Laravel engineer is productive in about one sprint; genuine proficiency requires JSON:API literacy (sparse fieldsets, compound documents, error semantics) plus Lunar's domain model, which is the longer pole. Frontend teams need equivalent JSON:API familiarity or a generated client. Plan for one designated API owner and a lightweight contract-review step on every schema change — that role is what keeps a read-only dependency from becoming an unowned liability.
How can I help you explore Laravel packages today?