Back
Full-stack commercial flowCompleted
Professional project
tu-dominio.cl
- Next.js
- Prisma
- PostgreSQL
- Supabase
- Mercado Pago
Problem
A client wanted to sell several domains online and needed a site with a catalog and integrated payment, instead of handling each sale by hand.
Context
A solo commission: tu-dominio.cl, a site to sell domains. I built it solo, end to end.
Objective
Solve the full commercial flow, from picking a domain to the payment result and its state change.
My role
- Built everything: frontend, backend and database.
- Integrated Mercado Pago with Checkout Pro and a webhook that confirms the payment.
- Modeled the data with Prisma on PostgreSQL hosted on Supabase.
Architecture & decisions
- Next.js owns frontend and backend; Prisma talks to PostgreSQL on Supabase; Mercado Pago runs checkout.
- The webhook does not trust the notification: it queries the payment in Mercado Pago again before recording the order.
- An approved payment creates the order and marks the domain as sold; the order stays pending data until the buyer completes the information for the transfer.
Solution
- Domain catalog with search, category filters and availability.
- Checkout with Mercado Pago and result pages for approved, pending or failed payments.
- When the payment is approved, the domain goes from available to sold and the order is created.
- A post-payment form for the owner's data, needed to transfer the domain through NIC Chile.
Challenges & trade-offs
- Keeping the external payment and local state consistent across approved, failed or incomplete results.
- Avoiding duplicate orders when Mercado Pago repeats a notification: the payment id is unique in the database.
- Closing the technical product even though its release depended on third-party information.
Learnings
- Integrating a payment gateway and reacting to its result to move the order state.
- Leaving a finished, functional product even when closing it out depends on third parties.
Result
Development finished, with payments tested in test mode. Closing it out is still pending on information the person in charge had to provide.