Boutique Saffron
v1.0A fashion boutique's shop and back office in loud neo-brutalist blocks: collections, product pages, a stamping add-to-cart, checkout and tracking, plus an orders board, products, discounts and customers.
Adres strony: /
Wbudowane
Co dostajesz- Jasny i ciemnyUżywa kolorów twojego motywu
- Komputer, tablet i telefonEkrany, dla których powstał
- Pakiety…
- Rozmiar kodu…
- Oszczędza baterię30 fps, bezczynny w spoczynku
- Pauza, gdy niewidocznyPoza ekranem lub w innej karcie
- Mniej ruchuSpokojny dla osób, które o to proszą
Sprawdzane przy każdej zmianie
Bezpieczeństwo sprawdzone: 3 gru- Sprawdzanie typówTypeScript w trybie strict
- Lint i formatowanieESLint · Prettier
- Testy i buildZrzuty ekranu w jasnym i ciemnym
- Audyt bezpieczeństwaBrak ostrzeżeń wysokich i krytycznych
- Wiek pakietówKażda wersja publiczna od 7+ dni
- CPU w spoczynkuPoniżej pół rdzenia w spoczynku, ≤ 30 fps
Kod
boutique-saffronReact
- boutique-saffron.tsxThe page: the sections in order.
- content.tsEvery word and number: brand, nav links, each section's copy and lists.
- theme.tsThe colors as CSS variables, and the shared class strings.
- README.mdHow to install it, and where to change the text, colors and form.
- pagesOne file per page: the sections it shows, in order.
- account.tsxThe shopper's account (#/account?tab=): an overview, their orders with tracking, saved addresses (add, edit, remove with a confirm and undo) and their profile.
- admin.tsxThe owner's sales overview: the last 28 days (to yesterday) in numbers and charts, sales by collection and channel, best sellers, low stock and the newest orders.
- cart.tsxThe cart: each line with its photo, variant, quantity (holding stock) and remove with undo; a discount code, the free-shipping meter, totals and the way to checkout.
- checkout.tsxCheckout in three steps: where it goes (a saved address or a new one), how (standard, express or pickup) and payment, beside the order summary; placing it opens the success page.
- customers.tsxCustomers: who buys, how often and how much, with a search and segments (VIP, new, newsletter), and each customer's drawer with their orders.
- discounts.tsxDiscount codes: each as a loud ticket with what it takes off, its uses against its limit and its end date; turn on or off, add or edit in a dialog, delete with a confirm and undo.
- home.tsxThe storefront's home: the loud hero, the collections as photo tiles, new in, the flash sale, best sellers, a live "just bought" feed, reviews and the shop's own door.
- notifications.tsxNotifications: new orders, low stock, reviews, customers and payouts, newest first; filter by kind, open one (marks it read), mark read or unread, mark all with undo.
- order.tsxAn order after checkout: the success page (#/success/<id>) with what was bought and when it comes, and tracking (#/track/<id>) with each step's time, plus a lookup when the number is unknown.
- orders.tsxThe orders board: New, Packed, Shipped and Delivered columns to drag (or move by keyboard) with undo, a channel filter, live web orders arriving, and each order's drawer.
- product.tsxA product (#/product/<id>): the gallery, color and size with the stock of each, quantity, add to cart with the stamp, the wishlist, its story and care, reviews and related pieces.
- products.tsxThe owner's products: every piece with its stock, status and price, a search and collection filter, the editor in a drawer (#/products?edit=<id> or new), and delete with a confirm and undo.
- search.tsxSearch: the query in the address (#/search?q=linen), results with the same filters and sort as the shop, and a helpful no-results state.
- settings.tsxThe settings page: the shop's profile (name, email, phone, pickup address) saved with a toast, Appearance (theme and language), and the signed-in account with Sign out.
- shop.tsxA collection (#/shop?cat=knitwear, New in, Sale or everything): its banner, the filters beside the grid, the sort, and a way out when the filters keep nothing.
- sign-in.tsxThe sign-in page (#/sign-in): the shop window photo with a loud sticker line beside the form card, without the store bar or the side rail; on a phone the photo becomes a strip above the card.
- wishlist.tsxThe wishlist: every saved piece as a card with quick add, what is on sale or low called out, and a way to the shop when it is empty.
- sectionsOne file per page section.
- account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
- appearance.tsxSettings → Appearance: the theme (System, Dark or Light), each shown as a small preview, and the language (System or one of locales/list.ts). The picked one is the saffron block with a check.
- filters.tsxThe shop's filters, kept in the address so Back and a shared link keep them: size, color, top price, in stock only, and the sort.
- order-drawer.tsxOne order in the drawer from the right: who and where, what they bought, its steps with times, the note, and the button that moves it on.
- owner-rail.tsxThe back office's thick-bordered side rail (logo, the owner pages with their live counts, back to the shop) and its slim top bar (menu on narrow screens, the page, theme, alerts, account).
- product-card.tsxA product in a grid: its photo and tags, the heart, name, price, stars and colors, and quick add by size, which stamps the card's photo into the cart.
- product-editor.tsxThe product editor in a drawer: name, collection, prices, status and tags, which colors and sizes it comes in, and the stock of every variant in one grid.
- promo-strip.tsxThe live strip over the shop: a marquee of offers, the flash sale's countdown and how many people are shopping now, all on the shared clock.
- reviews.tsxA product's reviews: the average and how the stars spread, the newest reviews with a show-all, and a form to write one.
- sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
- store-bar.tsxThe shop's loud top bar: the live promo strip, the logo, search, wishlist, account, the cart with its count and total, the switch to the back office, and the chunky category tabs.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- deal.tsThe deal card style: each card is dealt from the side of the current nav item, a short slide toward its place, one quickly after another.
- rowsWhat several sections share.
- turn.tsThe turn row motion: each row on screen swings in from behind, hinged on its left edge, from faint (its free edge never comes forward, so it never widens the page).
- core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
- index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
- appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
- avatar.tsxA person's initials in a round, thick-edged badge; the fill is picked from the name so the same person keeps one color.
- backdrop.tsxThe backdrop behind every page: a still print-shop dot grid in the ink, as strong as the Glow setting says; with followBackground it paints your background instead. Its colors are the ink and the primary, never the secondary or a chart color: the background never follows chart colors (npm test).
- bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
- board-model.tsA board as data: every card's place (one order) and column, and how a move changes them.
- board.tsxA board of columns and cards: drag a card (mouse, pen or a short press on touch) with a lift and a gap where it will land, or pick it up with Space and move it with the arrow keys; the other cards glide out of the way.
- cart-actions.tsAdding to the cart (the stamp, the saved cart, the stock left on every page that shows it) and the wishlist heart, shared by every page that sells.
- clock.tsOne shared clock for every LIVE thing (the marquee, the sale countdown, the shoppers count, the new-order feed): at most 30 ticks a second, paused in hidden tabs and for things off screen.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
- dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
- drag-board.tsThe board's drag engine: mouse, pen and touch drags with a lift, a gap where the card will land, auto-scroll near the edges, and a drop or Escape that settles the card into place.
- drawer.tsxA drawer from the right: a full-height native <dialog> for one thing's details (a client, an order). It springs in, slides out, closes on Esc, the close button or a click beside it, and keeps showing its thing while it slides away.
- field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
- flip.tsFLIP: when cards change place, each one glides from where it was to where it is now instead of jumping.
- format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
- icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
- keyboard-move.tsMoving a board card with the keyboard: Space picks it up, the arrow keys move it, Space or Enter drops it, Escape puts it back; each step is read out.
- language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
- line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
- moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts play, timed by their moments in theme.ts.
- motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
- router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
- scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
- select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
- session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
- sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
- stamp.tsThe add-to-cart stamp: a copy of the product's photo lifts off its card on a hard shadow, flies to the cart button and drops into it with a thud.
- states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
- store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
- ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
- toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
- ui.tsxThe shop's small shared pieces: a framed photo, stars, a price, a status or tag chip, a color swatch, a quantity stepper, chunky tabs and a number block.
- use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
- use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
- dataThe pretend data and the fake API: swap it for your backend.
- account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes: the boutique's owner, who shops it too.
- api-owner.tsThe owner's side of the fake API: sales overview, the orders board, products, discounts, customers and notifications.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- catalog.tsThe pretend catalog: 40 products in seven categories, each with colors, sizes, stock per variant, two photos and its story.
- db.tsThe pretend database: one working copy of the seed data that the shopper and owner APIs both read and change for the visit.
- extras.tsThe rest of the pretend shop: reviews, discount codes, the owner's notifications, the signed-in shopper's addresses, cart and wishlist.
- net.tsThe pretend network: the short wait and the failing loads behind the demo's Slow network and Show error state switches. Delete it when you wire your backend.
- people.tsThe pretend customers and their orders: 60 shoppers and 130 orders over the last eight weeks, newest still waiting to be packed.
- localesEvery word the app shows, one JSON file a language; list.ts names them.
- en.jsonOne language's words, with the keys of en.json.
- list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).
boutique-saffron.tsx
The page: the sections in order.
Ładowanie…
- Dobry do
- Small fashion and gift boutiques that want a bold online shop and a simple back office for orders, stock and codes.
- Jak to działa
- Add to cart stamps the photo into the cart with a hard-shadow thud, the total and stock update, and orders move across a board.
- Jak używać
- Edit words in locales/, colors in theme.ts, and swap the bodies in data/api.ts and data/api-owner.ts for calls to your backend.