App template
Storefront
A shop and its admin: browse, filter and buy with a bag that answers at once, a checkout that ships anywhere, and the orders, products and discounts behind it.
Use this template
Installs the whole app into your project: its pages, routes, services with sample data, agent tools and the browser entry. Every file is yours to edit.
npx shadcn@latest add checkfu/uicontext/storefront- Run itLoad from your page’s script. It builds the app with
createApp: the browser’s router, the agent tools, an offline notice, and sign-in when you turn it on. Inside an app that already routes, renderStorefrontTemplate, which brings its own in-memory router. - Connect your backendEvery read and write goes through
Storein . Implement it over your API and pointStoreLiveat your Layer. - Make it yoursPages are one file per route. Delete the ones you don’t need, and the sample data in .
Screens
Home
/The hero, the collections and the best sellers, each with quick view.
Collection
/collections/:idA grid narrowed by price, size, color and stock, sorted, with Load more; every filter is in the URL.
Product
/products/:handleA gallery that swipes and zooms, color and size with what’s sold out, delivery dates, reviews and related products.
Bag
/cartEdit quantities, remove with Undo, apply a code and estimate shipping. The bag also slides over every page.
Checkout
/checkoutContact, an address that follows the country, delivery, and a slot for your payment provider; then review and place.
Account
/accountOrders with tracking, addresses and returns.
Admin home
/adminSales, orders and conversion over 30 days, what to fulfill and what’s running low.
Order
/admin/orders/:idItems, fulfill with tracking, refund by item, cancel, notes and the timeline.
Product editor
/admin/products/:idPictures, sizes and colors with a variant grid for price and stock, and search listing.
Discounts
/admin/discountsCodes by percent, amount or free shipping, with limits and end dates.
Where your backend plugs in
Pages never call a backend. They read through the queries in queries/ and write through Commands kept beside the component that runs them; both capture the Store service. Implement its interface in over HTTP, a sync engine or a database client, then change one line:
export const StoreLive = Store.sample
// becomes your Layer, such as
export const StoreLive = Layer.effect(Store, makeHttpStore)The root provides it once, so every page shares one instance. Sign-in is one line: delete auth: false in once your backend serves the session routes, and the sidebar shows who signed in.
What to delete
- services/seed.ts, and Store.sample in services/Store.ts
- components/ProductArt.ts once your products have photos: ProductImage shows them
To drop a screen, delete its file in pages/ and its route in ; TypeScript points at every link that still prints it. The agent tools are in .