Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PloutusLab/krafta-web/llms.txt

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

The Krafta admin panel at /admin is the central operations hub for the platform. It surfaces live KPI metrics derived directly from the database and provides navigation to every management section. Access is restricted to users whose account carries the ADMIN role — Next.js middleware redirects any other authenticated session to /creator with an error message, and unauthenticated requests are redirected to the login page.
Admin routes enforce role-based access through Next.js middleware. Any user without the ADMIN role who attempts to visit /admin or any sub-route will be redirected to /creator with an authorization error. Always verify the role has been applied before sharing admin credentials.

Dashboard metrics

When the database is reachable, the admin panel computes six live KPIs from Prisma queries:
MetricSource
Ingresos ConfirmadosSum of total across all Order records with status: "CONFIRMED"
Pedidos ConfirmadosCount of Order records with status: "CONFIRMED"
Margen PromedioFixed at ~40 % whenever at least one confirmed order exists
Usuarios RegistradosCount of all User records
Productos BaseCount of all Product records
ROI EstimadoDisplayed as until business expense tracking is enabled
If the database is unavailable, the dashboard falls back to demonstration values (12 orders, $148.00 revenue, 8 users, 6 products) and displays a yellow warning banner.

Catálogo & Mockups

Manage base products with variants, SKUs, pricing tiers, print template coordinates, and mockup images. Supports bulk CSV import and the three-step product creation wizard.

Comprobantes y Pagos

Manual verification pipeline for Banesco bank transfers and Pago Móvil receipts submitted by customers. Confirm or reject payments to advance orders into production.

Configuración de Talleres

CRUD for allied workshop records. Configure production capacity, SLA commitments, payment policy, and geographic coverage for each workshop.

Gestión de Usuarios

View all registered users, change roles between CLIENTE, CREADOR, TALLER, and ADMIN, manage creator storefronts, and reset passwords.

Template Studio

Configure versioned surface templates with SVG print areas, mockup scene layers, DPI rules, and transform constraints for the design editor.

Pipeline de Pedidos

View and manage the full order pipeline from Confirmed through In Production, Shipped, and Delivered. Assign workshops, dispatch production notifications, and review quotes. See the Orders API reference for the underlying data model.
The admin panel also includes two additional sections accessible from the operations grid that do not have separate documentation pages:
  • Pipeline de Pedidos (/admin/orders) — Displays all confirmed orders, allows workshop assignment, and links to payment verification for each order. Order status advances through CONFIRMED → IN_PRODUCTION → SHIPPED → DELIVERED.
  • CMS de Portada (/admin/content) — Dynamic content editor for the storefront Hero section, promotional banners, and landing page announcements.

Granting admin access

The ADMIN role is not self-assignable through the UI. To promote a user to admin for the first time, set the role field directly in the database. Using Prisma Studio:
npx prisma studio
  1. Open the User table.
  2. Find the target user by email.
  3. Change the role field from CLIENTE to ADMIN.
  4. Save the record.
The promoted user must log out and back in so that a new JWT carrying the ADMIN role is issued. Existing sessions retain the previous role until they expire (24 hours) or until the user re-authenticates.

Build docs developers (and LLMs) love