Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt

Use this file to discover all available pages before exploring further.

The Urban Store admin dashboard is a protected interface available at /admin that gives authorized administrators full control over the store: browsing and updating every order, creating and maintaining the product catalog, and viewing real-time sales analytics. All admin API endpoints require a valid JWT that carries the is_admin: true claim — unauthenticated or non-admin requests are rejected outright.

Access Control

Admin privileges are stored directly on the MongoDB users collection as an is_admin boolean field. When a user authenticates, that field is embedded in the signed JWT payload. The Next.js middleware.js inspects the JWT cookie on every request to /admin/** and redirects any visitor whose token does not carry is_admin: true back to the homepage. To promote an existing user to administrator, connect to your MongoDB database and run:
db.users.updateOne(
  { email: "youremail@example.com" },
  { $set: { is_admin: true } }
)
The user must log out and log back in for a new token with the updated claim to be issued.

Admin Panel Features

Order Management

View every order in the store and update its fulfillment status as it moves through the pipeline.

Product Catalog

Create, edit, and delete products including per-variant inventory, images, sizes, and colors.

Analytics Dashboard

Real-time conversion funnels, RFM customer segments, traffic sources, and smart anomaly alerts.

Inventory Control

Manage per-variant stock via the stock_by_variant map to track exact size|color quantities.

Viewing All Orders

Retrieve the full order list with customer details, totals, and current status:
GET /api/orders/all/
Authorization: Bearer <admin_token>

Updating Order Status

Move an order through its lifecycle with a PATCH request:
PATCH /api/orders/<order_id>/status/
Authorization: Bearer <admin_token>
Content-Type: application/json

{
  "status": "shipped"
}
Valid status values are:
StatusMeaning
pendingOrder created, awaiting payment
paidPayment confirmed by Stripe
pending_shipmentPaid and queued for dispatch
shippedDispatched to the carrier
cancelledOrder cancelled

Managing Products

All product write operations are restricted to admin users and require a Bearer token in the Authorization header.
ActionMethodEndpoint
Create productPOST/api/products/
Edit productPUT/api/products/<slug>/
Delete productDELETE/api/products/<slug>/

Accessing the Analytics Dashboard

The analytics dashboard is embedded in the admin frontend at /admin. From there you can switch between the conversion funnel, RFM segmentation, traffic sources, and smart alerts views. The underlying data is served by the analytics API — see the Analytics page for the full endpoint reference.
The chatbot and recomendaciones apps are present in INSTALLED_APPS in config/settings.py but their features are not yet implemented. The corresponding API endpoints are not active.

Build docs developers (and LLMs) love