rastuci
Complete e-commerce with payments, shipping, and admin dashboard
The Problem
A children's clothing brand needs a professional online store with local payment methods, shipping integration, and an admin panel to manage everything independently.
The Solution
A complete e-commerce platform with MercadoPago integration, shipping calculator, inventory management, and a full admin dashboard — all custom-built for the Argentine market.
Architecture
Next.js public storefront with product catalog and checkout flow
Protected admin dashboard for product, order, and inventory management
Next.js API routes for orders, products, payments, and shipping
PostgreSQL on Neon with Prisma Decimal for monetary values
MercadoPago integration with webhook processing for payment notifications
Shipping API integration for carrier rate calculation and tracking
Key Features
MercadoPago payment integration
Full MercadoPago checkout flow with webhook-based payment confirmation
Shipping calculator with multiple carriers
Real-time shipping rates from multiple carriers based on destination and weight
Product catalog with variants
Products with size and color variants, stock tracking per variant
Inventory management with stock tracking
Automatic stock deduction on purchase, low-stock alerts, and restock management
Order management with status workflow
Orders flow through states: pending → paid → preparing → shipped → delivered
Admin dashboard with analytics
Sales overview, top products, revenue charts, and order management in one place
+4 more features in the repo
Under the Hood
Payment Webhook Pipeline
MercadoPago webhooks are received, idempotency-checked to prevent duplicate processing, order status is updated, and a confirmation email is dispatched — all in a single atomic flow.
- MercadoPago webhook
- Idempotency check
- Order update
- Email notification
Decimal Price Handling
All monetary values use Prisma Decimal instead of JavaScript floats — eliminating floating-point rounding errors in financial calculations.
- Price stored as Decimal
- Arithmetic with Decimal
- Display formatted string