<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adrian Synowiecki</title>
    <description>The latest articles on DEV Community by Adrian Synowiecki (@adrian_synowiecki).</description>
    <link>https://dev.to/adrian_synowiecki</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3933055%2F00a06f70-a111-4f82-a424-c04916d7f375.png</url>
      <title>DEV Community: Adrian Synowiecki</title>
      <link>https://dev.to/adrian_synowiecki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adrian_synowiecki"/>
    <language>en</language>
    <item>
      <title>AMPER B2C od środka: jak zbudowaliśmy platformę e-commerce opartą na Django</title>
      <dc:creator>Adrian Synowiecki</dc:creator>
      <pubDate>Fri, 15 May 2026 11:54:24 +0000</pubDate>
      <link>https://dev.to/adrian_synowiecki/amper-b2c-od-srodka-jak-zbudowalismy-platforme-e-commerce-oparta-na-django-3g8h</link>
      <guid>https://dev.to/adrian_synowiecki/amper-b2c-od-srodka-jak-zbudowalismy-platforme-e-commerce-oparta-na-django-3g8h</guid>
      <description>&lt;p&gt;&lt;strong&gt;Repozytorium&lt;/strong&gt;: &lt;a href="https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c" rel="noopener noreferrer"&gt;github.com/AMPLIFIER-sp-z-o-o/amper-b2c&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Strona produktu&lt;/strong&gt;: &lt;a&gt;ampliapps.com/amper-b2c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;W AMPER B2C najciekawsze nie są pojedyncze ekrany sklepu, tylko sposób, w jaki część sklepowa, panel administracyjny, katalog, magazyn, finalizacja zakupu, zamówienia i media są spięte jednym modelem danych.&lt;/p&gt;

&lt;p&gt;Poniżej przechodzę przez projekt od strony praktycznej: co widzi klient, co może zmienić administrator i które fragmenty kodu mają znaczenie, kiedy sklep działa na zmieniających się danych. Tekst powstał na podstawie publicznego repozytorium oraz środowiska QA.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Strona główna nie jest zaszyta w szablonie
&lt;/h2&gt;

&lt;p&gt;Strona główna składa się z rekordów w bazie: głównych banerów, sekcji produktowych, grup banerów, bloków HTML, kategorii widocznych w sklepie i sliderów. Dzięki temu kampanię albo kolejność sekcji można zmienić z panelu, bez grzebania w szablonach.&lt;/p&gt;

&lt;p&gt;W repozytorium widać też mechanikę podglądu szkiców. Formularze w panelu mogą zapisać robocze zmiany w sesji, a sklep potrafi pokazać taki podgląd przed publikacją. To drobiazg, który oszczędza dużo nerwów przy pracy nad treścią strony.&lt;/p&gt;

&lt;p&gt;Ten sam kierunek widać przy dynamicznych stronach. Model &lt;code&gt;DynamicPage&lt;/code&gt; przechowuje slug, treść z CKEditora, podstawowe ustawienia SEO, widoczność, noindex i wykluczenie z mapy strony. W praktyce oznacza to, że strony informacyjne można podpinać do nawigacji albo stopki bez dopisywania osobnego widoku dla każdej z nich.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm1qcfnnev1zc2tvk5nd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm1qcfnnev1zc2tvk5nd.png" alt="AMPER B2C desktopowa strona główna" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: strona główna z nawigacją, kategoriami, banerami kampanii i sekcjami produktowymi.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpqh6ar3qqc2ludacqyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpqh6ar3qqc2ludacqyx.png" alt="AMPER B2C admin sekcje strony głównej" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: sekcje strony głównej w panelu, z kolejnością i statusem aktywności.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpwm5d0b4ejhutuqeqjx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpwm5d0b4ejhutuqeqjx.png" alt="AMPER B2C admin bannery" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: konfiguracja banerów, obrazków i ustawień kampanii.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Katalog jest oparty na danych
&lt;/h2&gt;

&lt;p&gt;Produkt w AMPER B2C nie jest tylko nazwą, ceną i obrazkiem. Ma kategorię, status, obrazy, cenę, stany magazynowe, magazyny i atrybuty. Atrybuty są osobnymi definicjami oraz opcjami, więc mogą być używane w filtrach, na kartach produktów i na stronach kategorii.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm8ktexzeea7bp5geoli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm8ktexzeea7bp5geoli.png" alt="AMPER B2C desktopowy katalog" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: katalog w sklepie z kartami produktów, cenami, atrybutami, koszykiem i listami zakupowymi.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsece78un7lz8y390l7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsece78un7lz8y390l7x.png" alt="AMPER B2C desktopowa strona kategorii" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: strona kategorii zawężona do wybranego kontekstu katalogu.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmphukzrmz6wzy3oih7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmphukzrmz6wzy3oih7.png" alt="AMPER B2C desktopowe wyniki wyszukiwania" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: wyszukiwanie z filtrowaniem, sortowaniem i paginacją.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgby4fh99u4u14zd8kbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgby4fh99u4u14zd8kbu.png" alt="AMPER B2C admin lista produktów" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: lista produktów w adminie, ze statusami, cenami, obrazami, stanem magazynowym, sprzedażą i przychodem.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;W kodzie istotny jest też prefetch obrazów i atrybutów kafelkowych. To nie jest efektowna funkcja na screenshot, ale przy większym katalogu chroni widoki list produktów przed klasycznym problemem N+1 query.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Strona produktu korzysta z tego samego modelu
&lt;/h2&gt;

&lt;p&gt;Strona produktu renderuje dane z katalogu: obraz, opis, cenę, dostępność, breadcrumb kategorii i atrybuty. Status produktu rozróżnia między innymi &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;hidden&lt;/code&gt; i &lt;code&gt;disabled&lt;/code&gt;, więc produkt można ukryć albo zostawić widoczny bez możliwości zakupu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwy9p6x3ohgpsarr15308.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwy9p6x3ohgpsarr15308.png" alt="AMPER B2C desktopowa strona produktu" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: strona produktu z obrazem, opisem, ceną, ilością, koszykiem, listą zakupową i atrybutami.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Koszyk i finalizacja zakupu odświeżają dane przed zakupem
&lt;/h2&gt;

&lt;p&gt;Koszyk przechowuje linie zamówienia, ilości, ceny, rabaty, kupony, metodę dostawy, metodę płatności i podsumowanie kosztów. Przed finalizacją zakupu dane są ponownie synchronizowane z bazą. Jeśli ktoś zmieni cenę albo warunki kuponu w panelu, klient zobaczy aktualną wersję zamówienia.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz880r3efw1r1raw1c4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz880r3efw1r1raw1c4n.png" alt="AMPER B2C desktopowy koszyk" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: koszyk z kontrolą ilości, kodem promocyjnym, listami zakupowymi i przeliczaną sumą.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgn1l83hwdqhw3vxlwzna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgn1l83hwdqhw3vxlwzna.png" alt="AMPER B2C desktopowa finalizacja zakupu" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: finalizacja zakupu z danymi przechowywanymi po stronie serwera i czasem wygaśnięcia.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8yqm32bj0122xlxotdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8yqm32bj0122xlxotdd.png" alt="AMPER B2C admin kupony" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: konfiguracja kuponów z typem rabatu, aktywnością, zakresem dat, limitami użycia i minimalną wartością koszyka.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizr4mnftk1ep5envzccq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizr4mnftk1ep5envzccq.png" alt="AMPER B2C admin metody dostawy" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: metody dostawy konfigurowane w panelu.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpvf8v9f52rmz3nx9pl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpvf8v9f52rmz3nx9pl4.png" alt="AMPER B2C admin stock produktów" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: stany produktów utrzymywane osobno dla magazynów.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Najważniejszy fragment dzieje się podczas składania zamówienia. Produkty i rekordy stanów magazynowych są blokowane przez &lt;code&gt;select_for_update()&lt;/code&gt;, stan jest sprawdzany ponownie, ilości są zmniejszane w magazynie, kupon jest weryfikowany jeszcze raz i dopiero wtedy powstaje zamówienie.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Zamówienia zachowują własną historię
&lt;/h2&gt;

&lt;p&gt;Zamówienie zapisuje kopię danych klienta, adresu dostawy, metody dostawy, płatności, wartości produktów, rabatu, kosztu dostawy, waluty i końcowej sumy. Linie zamówienia zachowują cenę jednostkową oraz sumę linii, więc historia nie zmienia się po późniejszej edycji katalogu.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyljqene166d88v21amf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyljqene166d88v21amf.png" alt="AMPER B2C admin zamówienia" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: panel zamówień z trwałymi rekordami biznesowymi.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Osobno modelowana jest też alokacja stanów między magazynami. Linia zamówienia może przechować informację, z którego magazynu pochodził produkt. To dobry punkt wyjścia pod późniejsze integracje ERP albo WMS.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Ulubione produkty są bliżej list zakupowych
&lt;/h2&gt;

&lt;p&gt;W tym projekcie ulubione produkty nie kończą się na prostym serduszku przy karcie produktu. Użytkownik może mieć wiele list, anonimowi użytkownicy są śledzeni po kluczu sesji, elementy pamiętają cenę z momentu dodania, a listę można udostępnić przez niezgadywalny identyfikator.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63x14xmur36rzgrdvb9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63x14xmur36rzgrdvb9n.png" alt="AMPER B2C desktopowe favorites" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: widok list zakupowych w sklepie.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Ciekawy jest moment logowania. Domyślne listy anonimowe mogą połączyć się z kontem bez duplikatów, a własne listy anonimowe są przenoszone do użytkownika z automatycznym rozwiązywaniem konfliktów nazw.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Media mogą działać lokalnie albo przez S3
&lt;/h2&gt;

&lt;p&gt;Obrazy produktów, kategorii, banerów i rekordy biblioteki mediów korzystają z &lt;code&gt;DynamicMediaStorage&lt;/code&gt;. Ten mechanizm przechowywania może działać lokalnie albo przez S3 z opcjonalnym CDN, więc ten sam model obsługuje różne konfiguracje środowiska.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshbrffahs3sv37r6z38v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshbrffahs3sv37r6z38v.png" alt="AMPER B2C admin media library" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: biblioteka mediów w panelu, z metadanymi plików i powiązaniami źródłowymi.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Co wyróżnia kod
&lt;/h2&gt;

&lt;p&gt;W repozytorium najbardziej warte uwagi są te fragmenty, które zwykle wychodzą dopiero przy realnym użyciu sklepu: blokowanie stanów magazynowych przy składaniu zamówienia, ponowna weryfikacja kuponu, odświeżanie sum koszyka, serwerowe przechowywanie danych finalizacji zakupu, kopie danych zamówień, łączenie anonimowych list zakupowych z kontem oraz przechowywanie mediów lokalnie albo przez S3/CDN.&lt;/p&gt;

&lt;p&gt;To nie są widowiskowe elementy interfejsu, ale właśnie one decydują o tym, czy sklep zachowuje się przewidywalnie, kiedy dane zmieniają się w panelu administracyjnym, a klient jest w środku procesu zakupowego.&lt;/p&gt;

&lt;h2&gt;
  
  
  Zobacz projekt
&lt;/h2&gt;

&lt;p&gt;Kod: &lt;a href="https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c" rel="noopener noreferrer"&gt;https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Strona produktu: &lt;a href="https://ampliapps.com/amper-b2c/" rel="noopener noreferrer"&gt;https://ampliapps.com/amper-b2c/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Środowisko QA: &lt;a href="https://amper-b2c.ampliapps.com/" rel="noopener noreferrer"&gt;https://amper-b2c.ampliapps.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Login QA: &lt;strong&gt;&lt;a href="mailto:admin@example.com"&gt;admin@example.com&lt;/a&gt;&lt;/strong&gt; / &lt;strong&gt;admin&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Inside AMPER B2C: how we built an e-commerce platform on Django</title>
      <dc:creator>Adrian Synowiecki</dc:creator>
      <pubDate>Fri, 15 May 2026 11:52:47 +0000</pubDate>
      <link>https://dev.to/adrian_synowiecki/inside-amper-b2c-how-we-built-an-e-commerce-platform-on-django-4c7f</link>
      <guid>https://dev.to/adrian_synowiecki/inside-amper-b2c-how-we-built-an-e-commerce-platform-on-django-4c7f</guid>
      <description>&lt;p&gt;&lt;strong&gt;Repository&lt;/strong&gt;: &lt;a href="https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c" rel="noopener noreferrer"&gt;github.com/AMPLIFIER-sp-z-o-o/amper-b2c&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Product page&lt;/strong&gt;: &lt;a href="https://ampliapps.com/amper-b2c/" rel="noopener noreferrer"&gt;ampliapps.com/amper-b2c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is interesting about AMPER B2C is not a single storefront screen. It is the way the storefront, admin panel, catalog, inventory, checkout, orders, and media are tied together by one data model.&lt;/p&gt;

&lt;p&gt;This is a practical walk through the project: what customers see, what administrators can change, and which parts of the code matter when the store is running on data that keeps changing. The article is based on the public repository and the QA environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The homepage is not hardcoded into a template
&lt;/h2&gt;

&lt;p&gt;The homepage is built from database records: hero banners, product sections, banner groups, HTML blocks, storefront categories, and sliders. That means a campaign or section order can be changed from the admin panel without touching templates.&lt;/p&gt;

&lt;p&gt;The repository also includes draft preview logic. Admin forms can save draft changes into the session, and the storefront can render those changes before they are published. It is a small detail, but it makes day-to-day content work much less fragile.&lt;/p&gt;

&lt;p&gt;The same idea appears in dynamic pages. The &lt;code&gt;DynamicPage&lt;/code&gt; model stores the slug, CKEditor content, basic SEO settings, visibility, noindex, and sitemap exclusion. In practice, informational pages can be linked from the navigation or footer without adding a separate view for each page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm1qcfnnev1zc2tvk5nd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxm1qcfnnev1zc2tvk5nd.png" alt="AMPER B2C desktop homepage" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: homepage with navigation, categories, campaign banners, and product sections.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpqh6ar3qqc2ludacqyx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpqh6ar3qqc2ludacqyx.png" alt="AMPER B2C admin homepage sections" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: homepage sections in the admin panel, with ordering and active status.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpwm5d0b4ejhutuqeqjx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpwm5d0b4ejhutuqeqjx.png" alt="AMPER B2C admin banners" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: banner configuration, images, and campaign settings.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The catalog is data-driven
&lt;/h2&gt;

&lt;p&gt;A product in AMPER B2C is not just a name, price, and image. It has a category, status, images, price, stock, warehouses, and attributes. Attributes are modeled as separate definitions and options, so they can be reused in filters, product cards, and category pages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm8ktexzeea7bp5geoli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm8ktexzeea7bp5geoli.png" alt="AMPER B2C desktop catalog" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: catalog view with product cards, prices, attributes, cart actions, and shopping lists.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsece78un7lz8y390l7x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsece78un7lz8y390l7x.png" alt="AMPER B2C desktop category page" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: category page narrowed to a specific catalog context.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmphukzrmz6wzy3oih7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgmmphukzrmz6wzy3oih7.png" alt="AMPER B2C desktop search results" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: search with filtering, sorting, and pagination.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgby4fh99u4u14zd8kbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgby4fh99u4u14zd8kbu.png" alt="AMPER B2C admin product list" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: product list in the admin panel, with statuses, prices, images, stock, sales, and revenue.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One useful implementation detail is prefetching product images and tile attributes. It is not a flashy screenshot feature, but with a larger catalog it keeps product listing views away from the classic N+1 query problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The product page uses the same model
&lt;/h2&gt;

&lt;p&gt;The product page renders catalog data: image, description, price, availability, category breadcrumb, and attributes. Product status distinguishes values such as &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;hidden&lt;/code&gt;, and &lt;code&gt;disabled&lt;/code&gt;, so a product can be hidden or left visible without allowing purchase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwy9p6x3ohgpsarr15308.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwy9p6x3ohgpsarr15308.png" alt="AMPER B2C desktop product page" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: product page with image, description, price, quantity, cart action, shopping list, and attributes.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Cart and checkout refresh data before purchase
&lt;/h2&gt;

&lt;p&gt;The cart stores order lines, quantities, prices, discounts, coupons, delivery method, payment method, and totals. Before checkout, the data is synchronized with the current database state again. If someone changes a price or coupon rule in the admin panel, the customer sees the updated order before submitting it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz880r3efw1r1raw1c4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwz880r3efw1r1raw1c4n.png" alt="AMPER B2C desktop cart" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: cart with quantity control, promo code, shopping lists, and recalculated total.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgn1l83hwdqhw3vxlwzna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgn1l83hwdqhw3vxlwzna.png" alt="AMPER B2C desktop checkout" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: checkout with server-side data storage and expiry time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8yqm32bj0122xlxotdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8yqm32bj0122xlxotdd.png" alt="AMPER B2C admin coupons" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: coupon configuration with discount type, active state, date range, usage limits, and minimum cart value.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizr4mnftk1ep5envzccq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizr4mnftk1ep5envzccq.png" alt="AMPER B2C admin delivery methods" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: delivery methods configured from the admin panel.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpvf8v9f52rmz3nx9pl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpvf8v9f52rmz3nx9pl4.png" alt="AMPER B2C admin product stock" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: product stock maintained separately per warehouse.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The most important part happens during order placement. Products and stock records are locked with &lt;code&gt;select_for_update()&lt;/code&gt;, stock is checked again, quantities are decreased in the warehouse, the coupon is verified one more time, and only then is the order created.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Orders keep their own history
&lt;/h2&gt;

&lt;p&gt;An order stores a copy of the customer details, delivery address, delivery method, payment details, product value, discount, delivery cost, currency, and final total. Order lines keep their own unit price and line total, so history does not change when the catalog is edited later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyljqene166d88v21amf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyljqene166d88v21amf.png" alt="AMPER B2C admin orders" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: orders panel with durable business records.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Stock allocation between warehouses is modeled separately as well. An order line can store which warehouse supplied the product. That is a good starting point for later ERP or WMS integrations.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Favorites are closer to shopping lists
&lt;/h2&gt;

&lt;p&gt;In this project, favorites do not stop at a simple heart icon on a product card. A user can have multiple lists, anonymous users are tracked by session key, items remember the price from the moment they were added, and a list can be shared through a non-guessable identifier.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63x14xmur36rzgrdvb9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F63x14xmur36rzgrdvb9n.png" alt="AMPER B2C desktop favorites" width="800" height="556"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: shopping list view in the storefront.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The login moment is interesting. Default anonymous lists can merge into the account without duplicates, while custom anonymous lists are moved to the user with automatic conflict handling for names.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Media can run locally or through S3
&lt;/h2&gt;

&lt;p&gt;Product images, category images, banners, and media library records use &lt;code&gt;DynamicMediaStorage&lt;/code&gt;. The same storage model can run locally or through S3 with an optional CDN, so different environments can use different media setups.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshbrffahs3sv37r6z38v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fshbrffahs3sv37r6z38v.png" alt="AMPER B2C admin media library" width="800" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Screen: media library in the admin panel, with file metadata and source references.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What stands out in the code
&lt;/h2&gt;

&lt;p&gt;The parts of the repository worth looking at are the ones that usually matter only when a real store is being used: stock locking during order placement, coupon revalidation, cart total refreshes, server-side checkout data, order data copies, merging anonymous shopping lists into user accounts, and media storage that can run locally or through S3/CDN.&lt;/p&gt;

&lt;p&gt;These are not the most visually impressive parts of the interface, but they decide whether the store behaves predictably when data changes in the admin panel while a customer is already in the middle of a purchase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explore the project
&lt;/h2&gt;

&lt;p&gt;Code: &lt;a href="https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c" rel="noopener noreferrer"&gt;https://github.com/AMPLIFIER-sp-z-o-o/amper-b2c&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Product page: &lt;a href="https://ampliapps.com/amper-b2c/" rel="noopener noreferrer"&gt;https://ampliapps.com/amper-b2c/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;QA environment: &lt;a href="https://amper-b2c.ampliapps.com/" rel="noopener noreferrer"&gt;https://amper-b2c.ampliapps.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;QA login: &lt;strong&gt;&lt;a href="mailto:admin@example.com"&gt;admin@example.com&lt;/a&gt;&lt;/strong&gt; / &lt;strong&gt;admin&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>django</category>
      <category>opensource</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
