Core Interfaces
ProductBackend
Handles product search, details, and inventory:CartBackend
Handles shopping cart operations:OrderBackend
Handles order creation and management:Type Definitions
Product
Implementation Examples
In-Memory Backend
Perfect for development and testing:Database Backend (Prisma)
Connect to your existing database:Best Practices
Implement Partial Backends
Implement Partial Backends
You don’t need to implement everything. Start with
ProductBackend, add CartBackend when needed.Use TypeScript
Use TypeScript
The type definitions catch errors early and provide excellent IDE support.
Handle Errors Gracefully
Handle Errors Gracefully
Return
null for not found items rather than throwing. Throw for actual errors.