The Avanzar storefront is an Astro v6 application that serves the public-facing side of the shop — the product catalog, category browsing, and the checkout flow. It consumes the Avanzar backend API directly and is intentionally minimal: the repository ships a working skeleton that connects all the pieces end-to-end, giving developers a clean foundation to build their own UI on top of without inheriting any opinionated design system or component library.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ItsJhonAlex/Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
Running the Storefront
Start the Astro dev server from the monorepo root:http://localhost:4321), which is also the origin whitelisted in the backend CORS configuration.
Project Structure
4321:
Backend Integration
The storefront communicates with the Avanzar backend athttp://localhost:3000 in development. Endpoints fall into two categories based on whether they require a session.
Unauthenticated (open to all visitors)
No cookie or token is needed to browse the catalog, look up shipping costs, or submit a checkout:
- Product and category listing
- Single-product detail pages
- Shipping rate lookups
- Checkout (order submission)
httpOnly cookie (better-auth.session_token), which the browser attaches automatically on requests that set credentials: "include".
Key API Endpoints Used
The storefront primarily interacts with the following backend endpoints:| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/products | Full product catalog listing |
GET | /api/v1/products/:slug | Single product detail by URL slug |
GET | /api/v1/categories | Category tree for navigation |
GET | /api/v1/shipping-rates?province=¤cy= | Shipping rate lookup for checkout |
POST | /api/v1/checkout | Submit a new order |
GET | /api/v1/orders | Authenticated user’s order history |
201 Created on success or a structured { error, code } body on business-rule violations (e.g. insufficient stock, unrecognised shipping zone).
Building for Production
The storefront is intentionally minimal and acts as a starting point rather than a production-ready UI. The home page renders a plain heading out of the box. Developers are expected to build their own pages, components, and styles on top of the backend API — the infrastructure (routing, API contract, auth, checkout logic) is already wired up and ready to use.