Inventory Tansy
v1.0A minimal SaaS inventory app for a home-goods brand: products, stock at three warehouses, purchase orders you receive line by line, suppliers and cycle counts, in quiet greys with one amber accent.
पेज का पता: /
पहले से मौजूद
आपको क्या मिलता है- लाइट और डार्कआपकी थीम के रंग इस्तेमाल करता है
- डेस्कटॉप, टैबलेट, और फ़ोनजिन स्क्रीन के लिए यह बना है
- पैकेज…
- कोड साइज़…
- बैटरी पर हल्का30 fps, स्थिर होने पर निष्क्रिय
- छिपने पर रुक जाता हैस्क्रीन से बाहर या दूसरा टैब
- कम मोशनमाँगने वालों के लिए शांत
हर बदलाव पर जाँचा गया
सिक्योरिटी जाँच 3 दिस॰- टाइप जाँचTypeScript स्ट्रिक्ट
- लिंट और फ़ॉर्मैटESLint · Prettier
- टेस्ट और बिल्डलाइट और डार्क स्क्रीनशॉट
- सिक्योरिटी ऑडिटकोई हाई या क्रिटिकल एडवाइज़री नहीं
- पैकेज की उम्रहर वर्शन 7+ दिन से पब्लिक
- आइडल CPUरुके रहने पर आधे कोर से कम, ≤ 30 fps
कोड
inventory-tansyReact
- inventory-tansy.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.
- counts.tsxCycle counts: the counts open now (Grace's fills in live as she scans), every session with its variance, and beside them the variance by warehouse and the biggest misses. Start count opens a new one for a warehouse and category.
- low-stock.tsxLow stock: everything at or under its reorder point in three groups (out of stock, low, already on order), the shortest cover first, each with what to order and Reorder; Reorder all drafts one order per supplier. A delivery that lifts a product over takes it off this list.
- orders.tsxPurchase orders: every order with its status, due day and how much has come in, filtered by status, supplier or search in the address (#/orders?status=open); beside it, spend by supplier over 90 days and the late ones. A row opens its sheet to send or receive.
- overview.tsxOverview: the four numbers, low stock with Reorder (and the restocked moment), deliveries due with Receive, units picked per day, the live feed and stock by warehouse.
- products.tsxEvery product in one table: search, category, supplier, state and sort live in the address (#/products?state=low&sort=cover), rows glide to their new places when the order changes, a pick of rows gets the bulk bar, and a row opens the product's sheet.
- settings.tsxSettings: tabs for warehouses, categories, units and appearance (theme and language); the tab lives in the address (#/settings?tab=units).
- sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card over the backdrop, without the sidebar and top bar.
- stock.tsxStock: units per product at each warehouse (a cell opens Adjust for that warehouse, Transfer moves units between them), the transfers on the road with Mark arrived, and every move as it happens. Tab, search and category live in the address.
- suppliers.tsxSuppliers: who makes what, their lead time, how often they deliver on time, open orders and 90-day spend, searchable and sortable in the address; a row opens the supplier's sheet.
- 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 choice shown as a small preview, and the language (System, English or Español). The picked one has the accent edge and a check.
- bottom-tabs.tsxThe phone's tab bar: the four pages used most (Low stock with its count), and More for the rest (the sidebar in a sheet). It sticks to the bottom of the screen under the page.
- bulk-bar.tsxThe bar that rises when products are picked: how many, reorder them (a draft per supplier), move them to a category, delete them (Undo in the toast), or clear the pick.
- count-sheet.tsxA cycle count in the side sheet (?count=CC-31): each product's expected units against what was counted and the variance, typed in place while it is open (Grace's scanner fills hers live); Finish posts the variances to stock. Plus the start form (?new=count).
- feed.tsxThe live feed: every stock move, newest first, two lines each: the product and its change (−3, +48), then who, what kind, where and when. A pick that arrives slides in at the top.
- kpi-strip.tsxThe KPI strip: four numbers in one bordered box, each with its note under it and a sparkline; a changed number rolls to its new value (a pick lowers stock value, a receipt drops the low count).
- low-list.tsxOverview's low-stock list: the products at or under their reorder point, the shortest cover first. When a delivery lifts one back over, its number rolls up, its chip turns to Restocked with a check, and a moment later the row slips out while the rest glide up.
- overview-panels.tsxOverview's other panels: units picked per day (today in the accent, rising as picks land), the deliveries due this week with Receive, and stock by warehouse as three bars.
- po-form.tsxThe purchase order form in a dialog: a new draft (?new=po, + New PO, ⌘K; ?for=<product> starts it with that product) or an edit of a draft (?edit-po=PO-1047). Pick the supplier, then its products and quantities; it saves as a draft to send from its sheet.
- po-sheet.tsxA purchase order in the side sheet (?po=PO-1043): its status and numbers, then tabs for the lines, receiving and details. Send a draft, receive a delivery line by line or all at once (stock rolls up, a product back over its reorder point turns Restocked), or cancel.
- product-forms.tsxThe product forms in dialogs: a new product or an edit (?new=product, ?edit-product=<id>), a stock adjustment with its reason (?adjust=<id>) and a transfer between warehouses (?transfer=<id>). Each checks its own fields and says what is wrong under them.
- product-sheet.tsxA product in the side sheet (?product=pr-kt-stm-sag): its state and four numbers, then tabs for stock by warehouse (with its last two weeks as a line), its moves and its open orders. Adjust, transfer, reorder, edit or delete from the top.
- settings-lists.tsxSettings → Warehouses, Categories and Units: each a list you edit in place (Edit turns a row into fields, Save or Cancel), add to at the bottom and delete from; one still in use stays, and the toast says why.
- sidebar.tsxThe sidebar: the workspace, search with the ⌘K shortcut, the pages in two groups with their counts (Low stock's in the accent) and a pill that glides to the current one, Settings, and the live strap with its pause.
- 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.
- supplier-sheet.tsxA supplier in the side sheet (?supplier=s1): who to call, its lead time and on-time rate, then tabs for the products it makes and its orders; plus the supplier form (?new=supplier, ?edit-supplier=s1).
- top-bar.tsxThe top bar: the menu button on tablets, the workspace and page, the live dot, search on narrow screens, the theme switch, + New PO and the account menu. It frosts only once the page scrolls under it.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- text.tsThe text card style: cards fade in while titles, labels and numbers (data-build="text") slide up from behind a mask; numbers show their final text.
- rowsWhat several sections share.
- count.tsThe count row motion: each row on screen brightens from faint while its numbers (<Ticker>) count up, rounded every frame.
- 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 badge, tinted with the primary.
- backdrop.tsxThe backdrop behind the app: Tansy is Solid, so it stays faded out on the still ground; with followBackground it paints your background instead.
- bar-chart.tsxA bar chart: rounded bars grow in, and the picked bar (in the accent), 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.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page, an action, a product by name or SKU, an order or a supplier, 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.
- field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
- filters.tsxThe filter row every list page shares: a search box and pickers whose choices live in the address (?q=mug&category=c1), so Back brings them back, and Clear when any is set.
- flip.tsFLIP for a list that re-sorts or filters: after each change every row that stayed glides from where it was to where it is now. Rows carry data-flip="<id>"; positions are measured inside the list, so a page scroll never reads as a move.
- 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.
- 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 accent: a smooth curve draws itself in, the latest point marked, and new values roll the line to its new shape (a product's stock over two weeks).
- live-clock.tsxOne shared clock for everything live: it ticks only while something on screen listens, the app is on screen, the tab is visible and live isn't paused, and the bare button that pauses it. What a tick does (move the demo's time, bring in an event, reload) is the app's, passed to liveClock.
- live.tsThe app's one live clock: every 5 seconds a warehouse picks an order (data/live.ts) and every 9 the counter scans a shelf, then every page reloads in place; every 30 the "2 min ago" times redraw. It rests while nothing live is on screen, the tab is hidden or live is paused.
- 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.
- overlays.tsxEverything that opens over the page from the address: a product, order, supplier or count in the side sheet, and the forms (new PO, product, adjust, transfer, supplier, count). Any page opens one by adding its query (?po=PO-1043).
- read.tsOne read of the fake API by its key, through useApi: useRead("overview"), useRead<"order">(`order:${id}`). Each key keeps one load function, so a page that mounts again finds its answer.
- router.tsThe page switcher: reads the app's page from the address hash (#/products, #/orders?status=sent).
- 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.
- side-sheet.tsxThe detail sheet: a modal panel that slides in from the end edge over the page (a product, an order, a supplier, a count), with tabs whose underline glides to the one picked. Escape, a tap outside or its close button slides it away; the address keeps what it shows (?po=PO-1043&dtab=lines).
- 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.
- stock.tsxThe small pieces every stock page shares: a stock state's glyph and word, an order's status, a category's dot and name, a unit's name, a person's initials, the cover bar and which rows just arrived (they slide in).
- 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.
- 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.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- db.tsThe pretend database the fake API reads and writes: the seeded rows held in memory, and every change a page can make to them (each stock change logs its movement, as a real stock system would).
- live.tsThe live demo: the warehouses working while you watch. Each pick takes units off a product at one warehouse for an order, and the counter on the open cycle count scans the next shelf, through the same database the pages read. Wire your backend's events here instead.
- now.tsThe demo's "now": today at 14:10 plus the real time since the app loaded, so the warehouse day is well under way at any hour; every seeded date is set from it. Wire your backend and use the real time.
- seed-catalog.tsThe pretend catalog of Larkfield Home, a home-goods brand with three warehouses: the warehouses, categories, units, the six staff, eight suppliers and every product with its stock per warehouse. Swap it for your own from your backend.
- seed-ops.tsThe pretend day-to-day: purchase orders in every state, transfers between warehouses, cycle counts, every stock movement of the last two weeks and the units picked per day. Dates are set from the demo's now (data/now.ts). Swap it for your own from your backend.
- types.tsThe shapes of the pretend data: warehouses, products and their stock per warehouse, purchase orders, suppliers, transfers, cycle counts and every stock movement. A real backend returns the same shapes.
- views.tsWhat each page reads: the database turned into rows, totals and charts. Each function answers one read of the fake API (data/api.ts).
- 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.
- es.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}).
inventory-tansy.tsx
The page: the sections in order.
लोड हो रहा है…
- इनके लिए अच्छा
- Small product brands with a few warehouses who track stock, reorder points, purchase orders, suppliers and counts.
- यह कैसे काम करता है
- Receive a PO line: on-hand numbers tick up, the low badge drops out, and live picks keep stock moving in the feed.
- कैसे इस्तेमाल करें
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.