Skip to main content
Back to Blog
2026. 06. 23.
4 min read
755 words
Article

AI-Built Webshop: extrahasznaltruha.hu — Next.js + PostgreSQL + Stripe [Case Study]

How do you build a B2B/B2C webshop with Next.js, PostgreSQL and Stripe in 14 days? extrahasznaltruha.hu case study: architecture decisions, performance optimization, and business results.

Key Takeaways

  • 1Next.js ISR + SSR combination enables fast page loads even with large product catalogs
  • 2PostgreSQL ACID transactions ensure data integrity for B2B orders and inventory management
  • 3Stripe webhook-based payment flow reduced lost transactions to near zero
  • 4A single codebase serves both B2B wholesalers and B2C retail customers with role-based pricing
  • 590+ Lighthouse score is achievable with 500+ products through optimized image handling and DB queries

AiSolve Team

AI Solutions Expert

AI-Built Webshop: extrahasznaltruha.hu — Next.js + PostgreSQL + Stripe [Case Study]

TL;DR — Quick Summary

  • Client: extrahasznaltruha.hu — B2B and B2C second-hand clothing trade
  • Stack: Next.js 15 + React 19 + PostgreSQL + Stripe + Tailwind CSS 4
  • Development time: 14 days (AiSolve.me guarantee met)
  • Lighthouse score: 94 Performance / 98 Accessibility / 100 Best Practices / 97 SEO
  • Result: +62% organic traffic, 23% cart abandonment reduction after 3 months

Project Background

extrahasznaltruha.hu is a second-hand clothing business near Nyíregyháza, Hungary, simultaneously serving B2B wholesale customers (textile processors, secondhand retailers, export partners) and B2C end consumers. Serving both business models in parallel presents significant architectural challenges.

Their previous solution — a WordPress + WooCommerce setup — was slow, lacked proper B2B pricing logic, and had an unreliable Stripe integration where payment confirmations regularly failed. Three core requirements were set for the new webshop: handle 500+ products with fast loading, serve B2B and B2C clients from a single platform with different pricing, and implement a reliable webhook-based payment flow with automated B2B invoicing.

Key Metrics at Launch

94
Lighthouse Performance
14 days
Development time
500+
Products managed
Stripe
Webhook integration

Architecture Decisions

Why Next.js? — Combining SSR and ISR

Product pages are built with ISR (Incremental Static Regeneration): pages are statically served but regenerate every 60 seconds in the background when inventory changes. This means users always receive a pre-generated, instantly loading page — no waiting for server-side rendering. The cart, checkout flow, and B2B portal use real-time SSR rendering to ensure prices and stock levels are always current. The Next.js App Router allowed us to cleanly separate these two approaches at the route level.

Why PostgreSQL? — ACID Transactions and Complex Queries

B2B orders require complex workflows: when an order is placed, the system must simultaneously reserve inventory, create the order record, trigger invoicing, and notify the warehouse — all atomically. If any step fails, the entire transaction must roll back. This requires PostgreSQL's ACID guarantees. We used Prisma ORM for type-safe queries and automatic migrations, significantly shortening development time.

Why Stripe? — Webhooks and B2B Invoicing

The previous system handled payment confirmations via redirect URL — if a user closed their browser before the redirect completed, the payment was lost in the database. With Stripe's webhook approach, this problem disappears entirely: Stripe notifies the server directly for every payment event, regardless of client behavior. B2B customers receive automatic PDF invoices via Stripe Invoicing, including EU tax numbers and reverse charge notation required for B2B export transactions.

B2B vs. B2C Logic in a Single System

The Next.js middleware layer determines the user's role on the very first request and routes it to the appropriate server component. This means the same URL (/products/xyz) shows a consumer price to B2C visitors and a wholesale price to authenticated B2B partners — within a single render cycle.

Business Results — 3 Months Post-Launch

+62%
Organic search traffic growth
-23%
Cart abandonment reduction
0
Lost Stripe transactions (was 3-5/week)
+41%
B2B partner registrations in Q1

Planning a Webshop? Request a Free Consultation!

Tell us about your business model and challenges — we'll respond within 24 hours with a tailored architecture proposal and quote. 0 HUF upfront, 14-day delivery guarantee, 90+ Lighthouse.

Request a Consultation →

Készen állsz a saját weboldaladra?

Ingyenes konzultáció során átbeszéljük, hogyan segíthetünk vállalkozásodnak növekedni egy modern, gyors és konverzióoptimalizált weboldallal. 14 nap alatt kész, 0 Ft induló költséggel.

AiSolve Team

AI Solutions Expert

Our expert helps in the practical application of AI technologies and the automation of business processes.

Frequently Asked Questions

Why not WordPress + WooCommerce if it's cheaper?

Achieving a 90+ Lighthouse score on WordPress WooCommerce is difficult, especially with 500+ products and complex B2B logic. PHP-based rendering is fundamentally slower than Next.js Server Components, and the WooCommerce plugin ecosystem carries higher security risks.

How do you handle real-time inventory management?

Inventory levels are stored in PostgreSQL and updated atomically in an ACID transaction on every order. ISR revalidation refreshes product pages every 60 seconds. When a product sells out, the page automatically switches to an Out of Stock state on the next revalidation cycle.

Can you build a similar webshop for other product categories?

Yes. We apply the Next.js + PostgreSQL + Stripe stack to any webshop type: food, service subscriptions, B2B raw material trading, digital products, and physical goods alike.

Which AiSolve.me package is needed for a webshop like this?

Webshop development is available within the Scale Premium package (72,000 HUF/month), which includes e-commerce integration, Stripe payment system, B2B logic, and monthly performance reports. The upfront cost is 0 HUF, and the 14-day delivery guarantee applies.

Related Articles